aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xorg/xorg_driver.c
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2010-02-25 16:51:30 +0100
committerJakob Bornecrantz <[email protected]>2010-02-27 02:12:48 +0000
commitbbefd86125f89451d75a96f31e1f4c871a1582c0 (patch)
tree75a6c9fb164b67579e9b271d634f7e2f4cd4eb58 /src/gallium/state_trackers/xorg/xorg_driver.c
parent122b472814d7694d997a55aac3d32340bf09218d (diff)
st/xorg: Re-enable crtc on resize
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_driver.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c24
1 files changed, 21 insertions, 3 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index aa8ab7901f7..8fb6e5a96dd 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -183,10 +183,12 @@ drv_probe_ddc(ScrnInfoPtr pScrn, int index)
static Bool
drv_crtc_resize(ScrnInfoPtr pScrn, int width, int height)
{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
modesettingPtr ms = modesettingPTR(pScrn);
ScreenPtr pScreen = pScrn->pScreen;
int old_width, old_height;
PixmapPtr rootPixmap;
+ int i;
if (width == pScrn->virtualX && height == pScrn->virtualY)
return TRUE;
@@ -204,13 +206,29 @@ drv_crtc_resize(ScrnInfoPtr pScrn, int width, int height)
pScrn->displayWidth = rootPixmap->devKind / (rootPixmap->drawable.bitsPerPixel / 8);
- if (ms->create_front_buffer(pScrn) && ms->bind_front_buffer(pScrn))
- return TRUE;
+ if (!ms->create_front_buffer(pScrn) || !ms->bind_front_buffer(pScrn))
+ goto error_create;
/*
- * This is the error recovery path.
+ * create && bind will turn off all crtc(s) in the kernel so we need to
+ * re-enable all the crtcs again. For real HW we might want to do this
+ * before destroying the old framebuffer.
*/
+ for (i = 0; i < xf86_config->num_crtc; i++) {
+ xf86CrtcPtr crtc = xf86_config->crtc[i];
+
+ if (!crtc->enabled)
+ continue;
+
+ crtc->funcs->set_mode_major(crtc, &crtc->mode, crtc->rotation, crtc->x, crtc->y);
+ }
+
+ return TRUE;
+ /*
+ * This is the error recovery path.
+ */
+error_create:
if (!pScreen->ModifyPixmapHeader(rootPixmap, old_width, old_height, -1, -1, -1, NULL))
FatalError("failed to resize rootPixmap error path\n");