[PATCH 27/36] randr: check the screen size bounds against the master

Dave Airlie airlied at gmail.com
Mon Jul 2 03:13:20 PDT 2012


From: Dave Airlie <airlied at redhat.com>

The master contains the complete screen size bounds, so check
the width/height against it.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 randr/rrcrtc.c |   14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/randr/rrcrtc.c b/randr/rrcrtc.c
index e5fe059..949ae60 100644
--- a/randr/rrcrtc.c
+++ b/randr/rrcrtc.c
@@ -1125,6 +1125,16 @@ ProcRRSetCrtcConfig(ClientPtr client)
             int source_height;
             PictTransform transform;
             struct pixman_f_transform f_transform, f_inverse;
+            int width, height;
+
+            if (pScreen->isGPU) {
+                width = pScreen->current_master->width;
+                height = pScreen->current_master->height;
+            }
+            else {
+                width = pScreen->width;
+                height = pScreen->height;
+            }
 
             RRTransformCompute(stuff->x, stuff->y,
                                mode->mode.width, mode->mode.height,
@@ -1134,13 +1144,13 @@ ProcRRSetCrtcConfig(ClientPtr client)
 
             RRModeGetScanoutSize(mode, &transform, &source_width,
                                  &source_height);
-            if (stuff->x + source_width > pScreen->width) {
+            if (stuff->x + source_width > width) {
                 client->errorValue = stuff->x;
                 free(outputs);
                 return BadValue;
             }
 
-            if (stuff->y + source_height > pScreen->height) {
+            if (stuff->y + source_height > height) {
                 client->errorValue = stuff->y;
                 free(outputs);
                 return BadValue;
-- 
1.7.10.2



More information about the xorg-devel mailing list