xf86: add initial scanout pixmap support (v2)

Add the simple passthrough interface for drivers to use,
so they can set scanout pixmaps.

v2: detach scanout pixmap properly.

Reviewed-by: Keith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
This commit is contained in:
Dave Airlie 2012-06-20 12:37:26 +01:00
parent f2da2c1204
commit 2ed3f64d9d
3 changed files with 18 additions and 0 deletions

View File

@ -734,6 +734,9 @@ xf86CrtcCloseScreen(ScreenPtr screen)
for (c = 0; c < config->num_crtc; c++) {
xf86CrtcPtr crtc = config->crtc[c];
if (crtc->randr_crtc->scanout_pixmap)
RRCrtcDetachScanoutPixmap(crtc->randr_crtc);
crtc->randr_crtc = NULL;
}
/* detach any providers */

View File

@ -218,6 +218,11 @@ typedef struct _xf86CrtcFuncs {
void
(*set_origin) (xf86CrtcPtr crtc, int x, int y);
/**
*/
Bool
(*set_scanout_pixmap)(xf86CrtcPtr crtc, PixmapPtr pixmap);
} xf86CrtcFuncsRec, *xf86CrtcFuncsPtr;
#define XF86_CRTC_VERSION 4

View File

@ -1789,6 +1789,15 @@ xf86RandR14ProviderGetProperty(ScreenPtr pScreen,
return config->provider_funcs->get_property(pScrn, property);
}
static Bool
xf86CrtcSetScanoutPixmap(RRCrtcPtr randr_crtc, PixmapPtr pixmap)
{
xf86CrtcPtr crtc = randr_crtc->devPrivate;
if (!crtc->funcs->set_scanout_pixmap)
return FALSE;
return crtc->funcs->set_scanout_pixmap(crtc, pixmap);
}
static Bool
xf86RandR12Init12(ScreenPtr pScreen)
{
@ -1814,6 +1823,7 @@ xf86RandR12Init12(ScreenPtr pScreen)
rp->rrProviderSetProperty = xf86RandR14ProviderSetProperty;
rp->rrProviderGetProperty = xf86RandR14ProviderGetProperty;
rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap;
pScrn->PointerMoved = xf86RandR12PointerMoved;
pScrn->ChangeGamma = xf86RandR12ChangeGamma;