[PATCH 24/36] xf86: add initial scanout pixmap support

Dave Airlie airlied at gmail.com
Mon Jul 2 03:13:17 PDT 2012


From: Dave Airlie <airlied at redhat.com>

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

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/modes/xf86Crtc.h    |    5 +++++
 hw/xfree86/modes/xf86RandR12.c |   11 +++++++++++
 2 files changed, 16 insertions(+)

diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 55466b6..ae4b5e0 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -219,6 +219,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
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 5a85ed1..0a58b58 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -1827,6 +1827,15 @@ xf86RandR15ProviderGetProperty(ScreenPtr pScreen,
 }
 
 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)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
@@ -1852,6 +1861,8 @@ xf86RandR12Init12(ScreenPtr pScreen)
     rp->rrProviderSetRole = xf86RandR15ProviderSetRole;
     rp->rrProviderSetProperty = xf86RandR15ProviderSetProperty;
     rp->rrProviderGetProperty = xf86RandR15ProviderGetProperty;
+    rp->rrCrtcSetScanoutPixmap = xf86CrtcSetScanoutPixmap;
+
     pScrn->PointerMoved = xf86RandR12PointerMoved;
     pScrn->ChangeGamma = xf86RandR12ChangeGamma;
 
-- 
1.7.10.2



More information about the xorg-devel mailing list