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 /src/radeon_driver.c | |
parent | a69f90be9384244744fabfa76469ede9cd26ac98 (diff) |
RADEON: more rotation work (still not there)
- once again borrowed heavily from intel
Diffstat (limited to 'src/radeon_driver.c')
-rw-r--r-- | src/radeon_driver.c | 36 |
1 files changed, 36 insertions, 0 deletions
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, 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")); |