Make Xinearama screen information reflect CRTC rotation.

(cherry picked from commit b6b8559321)
This commit is contained in:
Keith Packard 2007-01-29 23:04:17 -08:00
parent 72754184f1
commit f993e142d2
4 changed files with 33 additions and 28 deletions

View file

@ -548,6 +548,9 @@ Bool
RRCrtcGammaSetSize (RRCrtcPtr crtc,
int size);
void
RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
/*
* Destroy a Crtc at shutdown
*/

View file

@ -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
*/

View file

@ -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

View file

@ -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);