summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2007-01-29 23:04:17 -0800
committerKeith Packard <keithp@neko.keithp.com>2007-01-29 23:04:17 -0800
commitf993e142d2b8c7ce27370fb2c18d2eafb6ff40ca (patch)
treee509231dae8c4d1422a3a8830f9bc41fa2134fdc
parent72754184f1215acd2b053d476fa46142d97c8ebd (diff)
Make Xinearama screen information reflect CRTC rotation.
(cherry picked from commit b6b855932109b4bc3454f07bef8cb079d79ca369)
-rw-r--r--randr/randrstr.h3
-rw-r--r--randr/rrcrtc.c26
-rw-r--r--randr/rrpointer.c26
-rw-r--r--randr/rrxinerama.c6
4 files changed, 33 insertions, 28 deletions
diff --git a/randr/randrstr.h b/randr/randrstr.h
index 7a34b39eb..f86f9b5d0 100644
--- a/randr/randrstr.h
+++ b/randr/randrstr.h
@@ -548,6 +548,9 @@ Bool
RRCrtcGammaSetSize (RRCrtcPtr crtc,
int size);
+void
+RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
+
/*
* Destroy a Crtc at shutdown
*/
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 63898f83e..1e0429071 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -406,6 +406,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 771ed0976..63a34b582 100644
--- a/randr/rrxinerama.c
+++ b/randr/rrxinerama.c
@@ -287,10 +287,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);