diff options
author | Keith Packard <keithp@keithp.com> | 2009-02-03 20:18:37 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-02-03 20:21:07 -0800 |
commit | 7968823cbc02615e1080c0d3f34dcebe14ea1771 (patch) | |
tree | 3128fdbbf9b7341b66acf6ba22121c183e6f31be /hw/xfree86/modes | |
parent | 763df9eec79a867978efc5138d8635a46c1a0d17 (diff) |
Handle the combination of panning and crtc transforms
This patch gets the shadow scanout buffer repainted on panning area changes.
It does not, however, track the mouse correctly.
Signed-off-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw/xfree86/modes')
-rw-r--r-- | hw/xfree86/modes/xf86Crtc.c | 36 |
1 files changed, 10 insertions, 26 deletions
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c index 40352b4fd..7dbabdac5 100644 --- a/hw/xfree86/modes/xf86Crtc.c +++ b/hw/xfree86/modes/xf86Crtc.c @@ -306,33 +306,14 @@ xf86CrtcSetModeTransform (xf86CrtcPtr crtc, DisplayModePtr mode, Rotation rotati } else crtc->transformPresent = FALSE; - /* Shift offsets that move us out of virtual size */ - if (x + mode->HDisplay > xf86_config->maxWidth || - y + mode->VDisplay > xf86_config->maxHeight) - { - if (x + mode->HDisplay > xf86_config->maxWidth) - crtc->x = xf86_config->maxWidth - mode->HDisplay; - if (y + mode->VDisplay > xf86_config->maxHeight) - crtc->y = xf86_config->maxHeight - mode->VDisplay; - if (crtc->x < 0 || crtc->y < 0) - { - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Mode %dx%d does not fit virtual size %dx%d - " - "internal error\n", mode->HDisplay, mode->VDisplay, - xf86_config->maxWidth, xf86_config->maxHeight); - goto done; - } - xf86DrvMsg (scrn->scrnIndex, X_ERROR, - "Mode %dx%d+%d+%d does not fit virtual size %dx%d - " - "offset updated to +%d+%d\n", - mode->HDisplay, mode->VDisplay, x, y, - xf86_config->maxWidth, xf86_config->maxHeight, - crtc->x, crtc->y); - } - if (crtc->funcs->set_origin && memcmp (mode, &saved_mode, sizeof(saved_mode)) == 0 && - saved_rotation == rotation) { + saved_rotation == rotation && + saved_transform_present == crtc->transformPresent && + (!crtc->transformPresent || RRTransformEqual(&saved_transform, &crtc->transform))) + { + if (!xf86CrtcRotate (crtc)) + goto done; crtc->funcs->set_origin (crtc, crtc->x, crtc->y); ret = TRUE; goto done; @@ -441,8 +422,11 @@ xf86CrtcSetOrigin (xf86CrtcPtr crtc, int x, int y) { crtc->x = x; crtc->y = y; - if (crtc->funcs->set_origin) + if (crtc->funcs->set_origin) { + if (!xf86CrtcRotate (crtc)) + return; crtc->funcs->set_origin (crtc, x, y); + } else xf86CrtcSetMode (crtc, &crtc->mode, crtc->rotation, x, y); } |