summaryrefslogtreecommitdiff
path: root/randr/rrcrtc.c
diff options
context:
space:
mode:
authorKeith Packard <keithp@neko.keithp.com>2006-12-13 01:21:32 -0800
committerDave Airlie <airlied@linux.ie>2006-12-15 18:32:32 +1100
commit670bbb87310503fcc17203cecfa6f4f2f5db51d2 (patch)
tree7db9bd9af9048008436e6c86a20ae3a4667d4782 /randr/rrcrtc.c
parent6c6901434ab469dd03b79fc98cd4a2b64d339305 (diff)
RandR 1.2 rotation code must adjust width/height.
Mode lines reflect the monitor mode, not the projected size into the frame buffer. Flip width/height around so that the dimensions are oriented correctly. (cherry picked from 612a8e61803da8db0e305cbb093696b8e4284572 commit)
Diffstat (limited to 'randr/rrcrtc.c')
-rw-r--r--randr/rrcrtc.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index 05863a129..076742077 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -698,7 +698,15 @@ ProcRRSetCrtcConfig (ClientPtr client)
*/
if (pScrPriv->rrScreenSetSize)
{
- if (stuff->x + mode->mode.width > pScreen->width)
+ int source_width = mode->mode.width;
+ int source_height = mode->mode.height;
+
+ if (rotation == RR_Rotate_90 || rotation == RR_Rotate_270)
+ {
+ source_width = mode->mode.height;
+ source_height = mode->mode.width;
+ }
+ if (stuff->x + source_width > pScreen->width)
{
client->errorValue = stuff->x;
if (outputs)
@@ -706,7 +714,7 @@ ProcRRSetCrtcConfig (ClientPtr client)
return BadValue;
}
- if (stuff->y + mode->mode.height > pScreen->height)
+ if (stuff->y + source_height > pScreen->height)
{
client->errorValue = stuff->y;
if (outputs)