xf86-video-intel: src/i830_driver.c

Keith Packard keithp at kemper.freedesktop.org
Tue Jul 7 14:23:29 PDT 2009


 src/i830_driver.c |    9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

New commits:
commit a66357832388ba9db21a4b3bf8311d9d1f1ab308
Author: Keith Packard <keithp at keithp.com>
Date:   Tue Jul 7 14:13:57 2009 -0700

    non-DRI FB resize failed to assign the screen pixmap devPrivate.ptr (22328)
    
    When not using DRI, the screen pixmap is not in a bo, and so the usual
    enable/disable access functions don't adjust the pixmap devPrivate field,
    leaving it to the frame buffer allocation code to assign this correctly.
    
    During mode setting and fb resizing, FB access is disabled, and the
    screen pixmap devPrivate is stashed away by xf86EnableDisableFBAccess,
    to be restored when FB access is turned back on. This means that we have to
    set the pixmap devPrivate.ptr (in case xf86EnableDisableFBAccess doesn't
    do this), along with storing the address in the scrn->pixmapPrivate field.
    
    Signed-off-by: Keith Packard <keithp at keithp.com>
    Reviewed-by: Jesse Barnes <jbarnes at virtuousgeek.org>

diff --git a/src/i830_driver.c b/src/i830_driver.c
index d1acaa5..8986368 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -926,6 +926,7 @@ i830_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	i830_memory *new_front, *old_front;
 	Bool	    tiled;
 	ScreenPtr   screen = screenInfo.screens[scrn->scrnIndex];
+	pointer	    data = NULL;
 
 	scrn->displayWidth = i830_pad_drawable_width(width, i830->cpp);
 	tiled = i830_tiled_width(i830, &scrn->displayWidth, i830->cpp);
@@ -945,9 +946,15 @@ i830_xf86crtc_resize (ScrnInfoPtr scrn, int width, int height)
 	i830_set_pixmap_bo(screen->GetScreenPixmap(screen),
 			   new_front->bo);
 	scrn->fbOffset = i830->front_buffer->offset;
+	if (!new_front->bo)
+	    data = i830->FbBase + scrn->fbOffset;
 	screen->ModifyPixmapHeader(screen->GetScreenPixmap(screen),
 				   width, height, -1, -1, scrn->displayWidth * i830->cpp,
-				   NULL);
+				   data);
+	/* ick. xf86EnableDisableFBAccess smashes the screen pixmap devPrivate,
+	 * so update the value it uses
+	 */
+	scrn->pixmapPrivate.ptr = data;
 	xf86DrvMsg(scrn->scrnIndex, X_INFO, "New front buffer at 0x%lx\n",
 		   i830->front_buffer->offset);
 	i830_set_new_crtc_bo(scrn);


More information about the xorg-commit mailing list