mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-23 23:30:02 +00:00
randr: do full transform when checking SetScreenSize size
When validating the size passed to SetScreenSize, the CRTC mode size needs to be applied the full CRTC transform, otherwise the check may bogusly fail. Do a full transform on the CRTC mode size when checking the SetScreenSize request size instead of the current code that only manually handles rotation. Signed-off-by: Icenowy Zheng <uwu@icenowy.me> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1971>
This commit is contained in:
committed by
Enrico Weigelt
parent
f0a679cfb2
commit
e2550d065b
@@ -271,17 +271,14 @@ ProcRRSetScreenSize(ClientPtr client)
|
|||||||
RRModePtr mode = crtc->mode;
|
RRModePtr mode = crtc->mode;
|
||||||
|
|
||||||
if (!RRCrtcIsLeased(crtc) && mode) {
|
if (!RRCrtcIsLeased(crtc) && mode) {
|
||||||
int source_width = mode->mode.width;
|
struct pixman_box16 display_box = {
|
||||||
int source_height = mode->mode.height;
|
crtc->x, crtc->y,
|
||||||
Rotation rotation = crtc->rotation;
|
crtc->x + mode->mode.width,
|
||||||
|
crtc->y + mode->mode.height
|
||||||
|
};
|
||||||
|
pixman_f_transform_bounds(&crtc->f_transform, &display_box);
|
||||||
|
|
||||||
if (rotation & (RR_Rotate_90 | RR_Rotate_270)) {
|
if (display_box.x2 > stuff->width || display_box.y2 > stuff->height)
|
||||||
source_width = mode->mode.height;
|
|
||||||
source_height = mode->mode.width;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (crtc->x + source_width > stuff->width ||
|
|
||||||
crtc->y + source_height > stuff->height)
|
|
||||||
return BadMatch;
|
return BadMatch;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user