xf86-video-ati: Branch 'randr-1.2' - 2 commits

Alex Deucher agd5f at kemper.freedesktop.org
Sat May 26 15:26:54 PDT 2007


 src/radeon.h        |    7 +++----
 src/radeon_driver.c |   40 ++++++++++++++++++++++++++++++++--------
 2 files changed, 35 insertions(+), 12 deletions(-)

New commits:
diff-tree c2637a01f9aca4032262c66ade305f5fe2c54294 (from bbb769c4107bfcae682e46d026e54cbfb67d62cd)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Sat May 26 18:26:35 2007 -0400

    RADEON: remove some dead code from the last commit

diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index 473aa30..c57e13e 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3735,18 +3735,6 @@ Bool RADEONScreenInit(int scrnIndex, Scr
     info->BlockHandler = pScreen->BlockHandler;
     pScreen->BlockHandler = RADEONBlockHandler;
 
-#if 0
-    /* Rotation */
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "RandR enabled, ignore the following RandR disabled message.\n");
-    xf86DisableRandR(); /* Disable built-in RandR extension */
-
-    xf86RandR12Init (pScreen);
-    xf86RandR12SetRotations (pScreen, RR_Rotate_0);
-
-    info->CreateScreenResources = pScreen->CreateScreenResources;
-    pScreen->CreateScreenResources = RADEONCreateScreenResources;
-#endif
-
    if (!xf86CrtcScreenInit (pScreen))
        return FALSE;
 
diff-tree bbb769c4107bfcae682e46d026e54cbfb67d62cd (from a69f90be9384244744fabfa76469ede9cd26ac98)
Author: Alex Deucher <alex at t41p.hsd1.va.comcast.net>
Date:   Sat May 26 18:25:06 2007 -0400

    RADEON: more rotation work (still not there)
    
    - once again borrowed heavily from intel

diff --git a/src/radeon.h b/src/radeon.h
index fcbae2a..d75b154 100644
--- a/src/radeon.h
+++ b/src/radeon.h
@@ -725,10 +725,7 @@ typedef struct {
     /* X itself has the 3D context */
     Bool              XInited3D;
 
-  DisplayModePtr currentMode, savedCurrentMode;
-    /* merged fb stuff, also covers clone modes */
-    void        	(*PointerMoved)(int index, int x, int y);
-    Bool		NoVirtual;
+    DisplayModePtr currentMode, savedCurrentMode;
 
     int			constantDPI; /* -1 = auto, 0 = off, 1 = on */
     int			RADEONDPIVX, RADEONDPIVY;
@@ -745,6 +742,8 @@ typedef struct {
 
     RADEONBIOSConnector BiosConnector[RADEON_MAX_BIOS_CONNECTOR];
 
+    Rotation rotation;
+    void (*PointerMoved)(int, int, int);
     CreateScreenResourcesProcPtr CreateScreenResources;
 } RADEONInfoRec, *RADEONInfoPtr;
 
diff --git a/src/radeon_driver.c b/src/radeon_driver.c
index be1427b..473aa30 100644
--- a/src/radeon_driver.c
+++ b/src/radeon_driver.c
@@ -3275,6 +3275,33 @@ Bool RADEONSetupMemXAA(int scrnIndex, Sc
 }
 #endif /* USE_XAA */
 
+static void
+RADEONPointerMoved(int index, int x, int y)
+{
+    ScrnInfoPtr pScrn = xf86Screens[index];
+    RADEONInfoPtr  info  = RADEONPTR(pScrn);
+    int newX = x, newY = y;
+
+    switch (info->rotation) {
+    case RR_Rotate_0:
+	break;
+    case RR_Rotate_90:
+	newX = y;
+	newY = pScrn->pScreen->width - x - 1;
+	break;
+    case RR_Rotate_180:
+	newX = pScrn->pScreen->width - x - 1;
+	newY = pScrn->pScreen->height - y - 1;
+	break;
+    case RR_Rotate_270:
+	newX = pScrn->pScreen->height - y - 1;
+	newY = x;
+	break;
+    }
+
+    (*info->PointerMoved)(index, newX, newY);
+}
+
 /* Called at the start of each server generation. */
 Bool RADEONScreenInit(int scrnIndex, ScreenPtr pScreen,
                                 int argc, char **argv)
@@ -3708,6 +3735,7 @@ Bool RADEONScreenInit(int scrnIndex, Scr
     info->BlockHandler = pScreen->BlockHandler;
     pScreen->BlockHandler = RADEONBlockHandler;
 
+#if 0
     /* Rotation */
     xf86DrvMsg(pScrn->scrnIndex, X_INFO, "RandR enabled, ignore the following RandR disabled message.\n");
     xf86DisableRandR(); /* Disable built-in RandR extension */
@@ -3717,6 +3745,14 @@ Bool RADEONScreenInit(int scrnIndex, Scr
 
     info->CreateScreenResources = pScreen->CreateScreenResources;
     pScreen->CreateScreenResources = RADEONCreateScreenResources;
+#endif
+
+   if (!xf86CrtcScreenInit (pScreen))
+       return FALSE;
+
+    /* Wrap pointer motion to flip touch screen around */
+    info->PointerMoved = pScrn->PointerMoved;
+    pScrn->PointerMoved = RADEONPointerMoved;
 
     /* Colormap setup */
     RADEONTRACE(("Initializing color map\n"));


More information about the xorg-commit mailing list