diff options
author | Alex Deucher <alex@t41p.hsd1.va.comcast.net> | 2007-05-26 18:25:06 -0400 |
---|---|---|
committer | Alex Deucher <alex@t41p.hsd1.va.comcast.net> | 2007-05-26 18:25:06 -0400 |
commit | bbb769c4107bfcae682e46d026e54cbfb67d62cd (patch) | |
tree | b68a029fba4114e3eec3b0eebbe3bee907239c17 | |
parent | a69f90be9384244744fabfa76469ede9cd26ac98 (diff) |
RADEON: more rotation work (still not there)
- once again borrowed heavily from intel
-rw-r--r-- | src/radeon.h | 7 | ||||
-rw-r--r-- | src/radeon_driver.c | 36 |
2 files changed, 39 insertions, 4 deletions
diff --git a/src/radeon.h b/src/radeon.h index fcbae2ac..d75b1547 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 be1427b2..473aa301 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -3275,6 +3275,33 @@ Bool RADEONSetupMemXAA(int scrnIndex, ScreenPtr pScreen) } #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, ScreenPtr pScreen, 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, ScreenPtr pScreen, 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")); |