[Old patch from N900] XFree86: RandR: Add non-shadow rotate hook

Pauli ext-pauli.nieminen at nokia.com
Wed Dec 15 07:31:42 PST 2010


From: Daniel Stone <daniel.stone at collabora.co.uk>

Add a full rotate hook for drivers that can implement rotation on their
own.

Signed-off-by: Daniel Stone <daniel.stone at collabora.co.uk>
---

Daniel:
Do you mean this patch?

 hw/xfree86/modes/xf86Crtc.h   |    9 +++++++++
 hw/xfree86/modes/xf86Rotate.c |    3 +++
 2 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index 6ca0254..55bc1e9 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -47,6 +47,8 @@
 #define HARDWARE_CURSOR_ARGB				0x00004000
 #endif
 
+#define RANDR_ROTATE_MAJOR_INTERFACE
+
 typedef struct _xf86Crtc xf86CrtcRec, *xf86CrtcPtr;
 typedef struct _xf86Output xf86OutputRec, *xf86OutputPtr;
 
@@ -148,6 +150,13 @@ typedef struct _xf86CrtcFuncs {
 		 int size);
 
     /**
+     * Rotate the CRTC: avoids shadow_* hooks; driver must handle
+     * everything itself.  Optional.
+     */
+    int
+    (*rotate) (xf86CrtcPtr crtc, Rotation rotate);
+
+    /**
      * Allocate the shadow area, delay the pixmap creation until needed
      */
     void *
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index dcc3ec0..656305d 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -408,6 +408,9 @@ xf86CrtcRotate (xf86CrtcPtr crtc)
     RRTransformPtr	transform = NULL;
     Bool		damage = FALSE;
 
+    if (crtc->funcs->rotate)
+        return crtc->funcs->rotate(crtc, crtc->rotation);
+
     if (crtc->transformPresent)
 	transform = &crtc->transform;
 
-- 
1.7.0.4



More information about the xorg-devel mailing list