Bug 22328

Summary: [UMS]blank screen with resolutions(1280x800,1024x768,800x600) when DRI off
Product: xorg Reporter: liuhaien <haien.liu>
Component: Driver/intelAssignee: Jesse Barnes <jbarnes>
Status: VERIFIED FIXED QA Contact: Xorg Project Team <xorg-team>
Severity: major    
Priority: high CC: lucian.grijincu, michael.fu, yifei.chen
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
xorg.0.log
none
xorg conf file
none
xorg.0.log
none
return screen offset when needed
none
Set screen pixmap devPrivate.ptr to new pixmap address none

Description liuhaien 2009-06-16 20:50:42 UTC
Created attachment 26874 [details]
xorg.0.log

system Environment:
--------------------------
Host:           x-gm45a
Arch:           i386
Platform:              GM45
Libdrm:		(master)3d4bfe8c893d016ef43d1ebf28e4607aa1f540a4
Mesa:		(master)1510c3cae1d840a065a22c891ad6db794dfe7a00
Xserver:		(master)b2d2af76b43d62c9be07fd736652f904632fd663
Xf86_video_intel:		(master)246cec965958e94babf5377e6f221522b05fb458
Kernel:       (for-linus)0e7ddf7eeeef5aea85412120539ab5369577faeb

Bug detailed description:
-------------------------
startx with dri off under UMS, the display will be blank with default resolution(1280x800)and others(1024x768,800x600). but it can display normal when change to 640x480.following is the output of xrandr:
[root@x-gm45a ~]# xrandr -q
Screen 0: minimum 320 x 200, current 1024 x 768, maximum 4096 x 4096
VGA disconnected (normal left inverted right x axis y axis)
LVDS connected 1024x768+0+0 (normal left inverted right x axis y axis) 261mm x 163mm
   1280x800       60.0 +
   1024x768       85.0*    75.0     70.1     60.0
   832x624        74.6
   800x600        85.1     72.2     75.0     60.3     56.2
   640x480        85.0     72.8     75.0     59.9
   720x400        85.0
   640x400        85.1
   640x350        85.1
HDMI-1 disconnected (normal left inverted right x axis y axis)

Reproduce steps:
----------------
1. xinit&
Comment 1 liuhaien 2009-06-16 20:51:18 UTC
Created attachment 26875 [details]
xorg conf file
Comment 2 Michael Fu 2009-06-17 02:31:21 UTC
I would argue if this is still a bug need to fix...
Comment 3 Gordon Jin 2009-06-17 02:36:55 UTC
In the F2F meeting, it's suggested to add "basic support for non-DRI" as the third configuration to be supported in Q2.
Comment 4 MaLing 2009-06-17 02:57:47 UTC
please upload log files for 1280x800 and 640x480 respectively with modedebug option on.

thanks
Ma Ling
Comment 5 Michael Fu 2009-06-17 17:51:24 UTC
(In reply to comment #3)
> In the F2F meeting, it's suggested to add "basic support for non-DRI" as the
> third configuration to be supported in Q2.
> 

ok. even though it doesn't look like a mode setting related issue..could you please re-assign for efficiency?
Comment 6 Gordon Jin 2009-06-17 18:17:10 UTC
Well, see if Jesse has idea on this one.
Comment 7 Jesse Barnes 2009-06-23 14:51:17 UTC
The log seems to be from a KMS enabled session, which doesn't appear to have this problem.  With UMS I get a crash... debugging now.
Comment 8 Jesse Barnes 2009-06-23 14:55:23 UTC
Hm, no the crash was due to some of my test code, this works for me with and without KMS on GM45.  May have been fixed by a recent commit...
Comment 9 liuhaien 2009-06-25 22:11:55 UTC
(In reply to comment #8)
> Hm, no the crash was due to some of my test code, this works for me with and
> without KMS on GM45.  May have been fixed by a recent commit...
> 

Jesse,it is still broken on my side with below commits,so reopen it:
Kernel:       (for-linus)0e7ddf7eeeef5aea85412120539ab5369577faeb
Libdrm:         (master)790097c51330090b2b7b90429b9ab8ddf259fd8e
Mesa:           (master)cdbcb051d93836861bc4d4e1027156111ac249d2
Xserver:                (master)9480725af0275b72b24b9e1cb3b68d5b97288d01
Xf86_video_intel:     
(master)f0270bbb47baed78a0ff6189ae20d3ac322ec02b
Kernel:       (for-linus)0e7ddf7eeeef5aea85412120539ab5369577faeb
Comment 10 liuhaien 2009-06-25 22:15:53 UTC
Created attachment 27144 [details]
xorg.0.log

the correct log from UMS is attached. So sorry for last one.
Comment 11 Jesse Barnes 2009-07-07 13:07:02 UTC
Created attachment 27478 [details] [review]
return screen offset when needed

In the non-DRI case, the screen pixmap won't have a pointer assigned after it moves, so we need to check for that case when we fetch the offset.  Can you confirm this works for you?
Comment 12 Keith Packard 2009-07-07 13:44:16 UTC
I think this patch would be better; can you test it?

diff --git a/src/i830_driver.c b/src/i830_driver.c
index c125a73..7db273d 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,11 @@ 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);
        xf86DrvMsg(scrn->scrnIndex, X_INFO, "New front buffer at 0x%lx\n",
                   i830->front_buffer->offset);
        i830_set_new_crtc_bo(scrn);

Comment 13 Keith Packard 2009-07-07 14:19:11 UTC
Created attachment 27481 [details] [review]
Set screen pixmap devPrivate.ptr to new pixmap address

Here's a patch which correctly sets the screen pixmap to point at the new memory.
Comment 14 Jesse Barnes 2009-07-07 14:21:24 UTC
Yeah that last patch works for me too; it's probably a better one to apply than mine too.

Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Comment 15 Jesse Barnes 2009-07-07 14:24:19 UTC
Fix pushed:

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

    non-DRI FB resize failed to assign the screen pixmap devPrivate.ptr (22328)
Comment 16 Keith Packard 2009-07-07 15:25:53 UTC
*** Bug 22076 has been marked as a duplicate of this bug. ***
Comment 17 Gordon Jin 2009-07-07 19:10:12 UTC
Yifei, please verify with the latest xf86-video-intel master.
Comment 18 Yifei Chen 2009-07-08 01:22:03 UTC
It works fine now.

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.