Bug 23357

Summary: [GL40] [i686] KMS black screen with kernel 2.6.30
Product: DRI Reporter: minskey <chaohong.guo>
Component: DRM/IntelAssignee: Jesse Barnes <jbarnes>
Status: CLOSED FIXED QA Contact:
Severity: major    
Priority: medium Keywords: NEEDINFO
Version: DRI git   
Hardware: x86 (IA32)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments:
Description Flags
dmesg outputs after failed to start X
none
Xorg log after failed to start X
none
kconfig of the system none

Description minskey 2009-08-16 20:09:42 UTC
On HP Montenvia based prototype laptop, KMS shows black screen. 

System environment:
-- chipset:  GL40
-- system architecture: i686
-- xf86-video-intel:  2.7.0
-- xserver: 1.5.1
-- mesa:
-- libdrm:  2.4.12
-- kernel:  2.6.30
-- Linux distribution:  Red Flag 6.1
-- Machine or mobo model:  N/A prototype system
-- Display connector: LVDS

Kernel config:

         CONFIG_FRAMEBUFFER_CONSOLE = y

Reproducing steps:
       
       

1. If system boots with VGA=788, both VT & X gives a black screen. Note that, although screen is black, system is active. I can blindly switch between VT and X or among VTs.  So, I blindly switch to a VT, log in, and then "cat /proc/fb"  to a file,  it gets:

 0 VESA VGA
 1 inteldrmfb


2. Without VGA=788, after booting up, VT can display, cat /proc/fb, gets:

    0 inteldrmfb

In this case, the screen turns into black on both VT and X once starting X.



3. I tried to attach an extra VGA monitor to the laptop, and black screen as well.

4. Disable X starting in init_level 5, with VGA=788, after booting up, Screen is black. Try to adjust backlight via sys interface doesn't work.  Now, if ssh to
the system, and then startx, we can get the stack:

(--) TouchPad touchpad found
(II) Mouse: Setting mouse protocol to "ExplorerPS/2"
(II) Mouse: ps2EnableDataReporting: succeeded

Backtrace:
0: X(xf86SigHandler+0x79) [0x80b8ca9]
1: [0xffffe400]
2: /usr/lib/libdrm_intel.so.1 [0xbf2522]
3: /usr/lib/libdrm_intel.so.1(drm_intel_bo_unreference+0x16) [0xbee3e6]
4: /root/xf86-video-intel-2.7.0/src/.libs//intel_drv.so [0x6c0f8b]
5: X [0x8164a5a]
6: /usr/lib/xorg/modules/extensions//libextmod.so [0x1c2823]
7: X(ServerBitsFromGlyph+0x22a) [0x8095b0a]
8: X(AllocGlyphCursor+0x4cf) [0x807975f]
9: X(CreateRootCursor+0xe4) [0x8079854]
10: X(main+0x3ac) [0x806af3c]
11: /lib/libc.so.6(__libc_start_main+0xe0) [0x3010c0]
12: X(FontFileCompleteXLFD+0x1e5) [0x806a451]

Fatal server error:
Caught signal 11.  Server aborting

(II) UnloadModule: "synaptics"
(II) UnloadModule: "kbd"
(II) UnloadModule: "mouse"

            
5.Following the suggestion from Gordon, I tried the patch mentioned in 
http://bugs.freedesktop.org/show_bug.cgi?id=21084,  but it doesn't work.


Additional info:
       UMS works well.
Comment 1 Jesse Barnes 2009-08-25 18:19:26 UTC
Can you attach your full X log and dmesg to this bug?
Comment 2 minskey 2009-08-25 22:08:54 UTC
Created attachment 28912 [details]
dmesg outputs after failed to start X

Adding dmesg outputs after failed to start X
Comment 3 minskey 2009-08-25 22:15:00 UTC
Created attachment 28913 [details]
Xorg log after failed to start X
Comment 4 minskey 2009-08-25 22:15:30 UTC
Created attachment 28914 [details]
kconfig of the system
Comment 5 Jesse Barnes 2009-08-31 09:43:59 UTC
DRI is failing to initialize on your platform for some reason:
(II) AIGLX: Screen 0 is not DRI2 capable
(II) AIGLX: Screen 0 is not DRI capable
(II) AIGLX: Loaded and initialized /usr/lib/dri/swrast_dri.so
(II) GLX: Initialized DRISWRAST GL provider for screen 0

Is Mesa installed properly?  A newer driver version (like 2.8) may work better here...
Comment 6 Gordon Jin 2009-09-13 22:50:09 UTC
Chaohong, any update?
Comment 7 minskey 2009-09-13 23:48:33 UTC
(In reply to comment #6)
> Chaohong, any update?
> 

I tried 2.8 & latest DDX driver git tree.  It doesn't work neither.  I am build kernel 2.6.31-rc9, and will update the report later. Probably, it is a bug in kernel side.
Comment 8 minskey 2009-09-15 00:24:12 UTC
At last, I found the root cause: it is a bug in DDX 2.7.0 driver. In 2.7.0 driver, if we don't use DRI2 and use DRI only, then we don't define DRI2, at initialization pI830->directRenderingType = DRI_NONE.  So with KMS enabled, I830PreInit calls I830DrmModeInit().  In the I830DrmModeInit(), there is a line code:

   if (pI830->accel == ACCEL_UXA && pI830->directRenderingType != DRI_XF86DRI)
       pI830->can_resize = TRUE;

Notice that pI830->directRenderingType is initialized to DRI_NONE, so, can_resize is set to TRUE. (BTW, if I change this to FALSE, Xserver works well).


And then, in I830ScreenInit(), there is the following code:

#ifdef DRI2
   if (pI830->directRenderingType == DRI_NONE && I830DRI2ScreenInit(pScreen))
       pI830->directRenderingType = DRI_DRI2;
#endif

#ifdef XF86DRI
   /* If DRI hasn't been explicitly disabled, try to initialize it.
    * It will be used by the memory allocator.
    */
   if (!pI830->can_resize && pI830->directRenderingType == DRI_NONE &&
    /* !!!!!!!!!!! so, here DRI won't be init'ed because can_resize is TRUE */

 I830DRIScreenInit(pScreen))
       pI830->directRenderingType = DRI_XF86DRI;
#endif



I gave it a try and set pI830->can_resize to FALSE, and don't enable resizable framebuffer,  it works.


The bug won't occur in latest DDX driver. So, you can close it if you want.






Comment 9 Jesse Barnes 2009-09-15 08:50:09 UTC
Thanks Chaohong, I'll close it out then.

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.