Commit 2ed3f64d authored by Dave Airlie's avatar Dave Airlie

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's avatarKeith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent f2da2c12
......@@ -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 */
......
......@@ -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
......
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment