diff options
author | Keith Packard <keithp@keithp.com> | 2007-01-25 00:29:20 +0800 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2007-01-24 13:34:58 -0800 |
commit | b6b855932109b4bc3454f07bef8cb079d79ca369 (patch) | |
tree | f564ccbe6e3bf4288ff4abb291fb00bf6da54d2b /randr | |
parent | 788cfce911793a26aed16f38f30678ecee82c873 (diff) |
Make Xinearama screen information reflect CRTC rotation.
Diffstat (limited to 'randr')
-rw-r--r-- | randr/randrstr.h | 3 | ||||
-rw-r--r-- | randr/rrcrtc.c | 26 | ||||
-rw-r--r-- | randr/rrpointer.c | 26 | ||||
-rw-r--r-- | randr/rrxinerama.c | 6 |
4 files changed, 33 insertions, 28 deletions
diff --git a/randr/randrstr.h b/randr/randrstr.h index 99022c313..505821269 100644 --- a/randr/randrstr.h +++ b/randr/randrstr.h @@ -549,6 +549,9 @@ Bool RRCrtcSetRotations (RRCrtcPtr crtc, Rotation rotations); +void +RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height); + /* * Destroy a Crtc at shutdown */ diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c index cfd4da9f7..098fbe300 100644 --- a/randr/rrcrtc.c +++ b/randr/rrcrtc.c @@ -397,6 +397,32 @@ RRCrtcGammaNotify (RRCrtcPtr crtc) return TRUE; /* not much going on here */ } +/** + * Returns the width/height that the crtc scans out from the framebuffer + */ +void +RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height) +{ + if (crtc->mode == NULL) { + *width = 0; + *height = 0; + return; + } + + switch (crtc->rotation & 0xf) { + case RR_Rotate_0: + case RR_Rotate_180: + *width = crtc->mode->mode.width; + *height = crtc->mode->mode.height; + break; + case RR_Rotate_90: + case RR_Rotate_270: + *width = crtc->mode->mode.height; + *height = crtc->mode->mode.width; + break; + } +} + /* * Set the size of the gamma table at server startup time */ diff --git a/randr/rrpointer.c b/randr/rrpointer.c index 2a5ae7d2f..802dcb2c4 100644 --- a/randr/rrpointer.c +++ b/randr/rrpointer.c @@ -22,32 +22,6 @@ #include "randrstr.h" -/** - * Returns the width/height that the crtc scans out from the framebuffer - */ -static void -RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height) -{ - if (crtc->mode == NULL) { - *width = 0; - *height = 0; - return; - } - - switch (crtc->rotation & 0xf) { - case RR_Rotate_0: - case RR_Rotate_180: - *width = crtc->mode->mode.width; - *height = crtc->mode->mode.height; - break; - case RR_Rotate_90: - case RR_Rotate_270: - *width = crtc->mode->mode.height; - *height = crtc->mode->mode.width; - break; - } -} - /* * When the pointer moves, check to see if the specified position is outside * any of theavailable CRTCs and move it to a 'sensible' place if so, where diff --git a/randr/rrxinerama.c b/randr/rrxinerama.c index 8b951455c..1db27f14c 100644 --- a/randr/rrxinerama.c +++ b/randr/rrxinerama.c @@ -290,10 +290,12 @@ ProcRRXineramaQueryScreens(ClientPtr client) RRCrtcPtr crtc = pScrPriv->crtcs[i]; if (RRXineramaCrtcActive (crtc)) { + int width, height; + RRCrtcGetScanoutSize (crtc, &width, &height); scratch.x_org = crtc->x; scratch.y_org = crtc->y; - scratch.width = crtc->mode->mode.width; - scratch.height = crtc->mode->mode.height; + scratch.width = width; + scratch.height = height; if(client->swapped) { register int n; swaps(&scratch.x_org, n); |