Make Xinearama screen information reflect CRTC rotation.

This commit is contained in:
Keith Packard 2007-01-25 00:29:20 +08:00 committed by Eric Anholt
parent 788cfce911
commit b6b8559321
4 changed files with 33 additions and 28 deletions

View File

@ -549,6 +549,9 @@ Bool
RRCrtcSetRotations (RRCrtcPtr crtc,
Rotation rotations);
void
RRCrtcGetScanoutSize(RRCrtcPtr crtc, int *width, int *height);
/*
* Destroy a Crtc at shutdown
*/

View File

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

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

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