xf86-video-intel: src/sna/sna_display.c
Chris Wilson
ickle at kemper.freedesktop.org
Fri Sep 7 05:09:45 PDT 2012
src/sna/sna_display.c | 20 +++++++++++---------
1 file changed, 11 insertions(+), 9 deletions(-)
New commits:
commit 0c39c363d7235d03f27337c731c0ffe3369bf713
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Sep 7 13:07:52 2012 +0100
sna: Protect sna_crtc_resize() against early invocation with no RootWindow
If the outputs are resized very early on, in CreateScreenResources, then
we will not yet have created a RootWindow and so trying to change its
pixmap is a futile effort.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index bde296d..f69ca97 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -2266,24 +2266,24 @@ sna_crtc_resize(ScrnInfoPtr scrn, int width, int height)
PixmapPtr old_front, new_front;
int i;
- DBG(("%s (%d, %d) -> (%d, %d)\n",
- __FUNCTION__,
+ DBG(("%s (%d, %d) -> (%d, %d)\n", __FUNCTION__,
scrn->virtualX, scrn->virtualY,
width, height));
if (scrn->virtualX == width && scrn->virtualY == height)
return TRUE;
+ assert(sna->front);
assert(scrn->pScreen->GetScreenPixmap(scrn->pScreen) == sna->front);
- assert(scrn->pScreen->GetWindowPixmap(scrn->pScreen->root) == sna->front);
+
DBG(("%s: creating new framebuffer %dx%d\n",
__FUNCTION__, width, height));
old_front = sna->front;
new_front = scrn->pScreen->CreatePixmap(scrn->pScreen,
- width, height,
- scrn->depth,
- SNA_CREATE_FB);
+ width, height,
+ scrn->depth,
+ SNA_CREATE_FB);
if (!new_front)
return FALSE;
@@ -2312,9 +2312,11 @@ sna_crtc_resize(ScrnInfoPtr scrn, int width, int height)
sna_crtc_disable(crtc);
}
- sna_redirect_screen_pixmap(scrn, old_front, sna->front);
- assert(scrn->pScreen->GetScreenPixmap(scrn->pScreen) == sna->front);
- assert(scrn->pScreen->GetWindowPixmap(scrn->pScreen->root) == sna->front);
+ if (scrn->pScreen->root) {
+ sna_redirect_screen_pixmap(scrn, old_front, sna->front);
+ assert(scrn->pScreen->GetScreenPixmap(scrn->pScreen) == sna->front);
+ assert(scrn->pScreen->GetWindowPixmap(scrn->pScreen->root) == sna->front);
+ }
scrn->pScreen->DestroyPixmap(old_front);
More information about the xorg-commit
mailing list