Bug 14314 - glxgears: brw_misc_state.c:214: upload_depthbuffer: Assertion `0' failed.
Summary: glxgears: brw_misc_state.c:214: upload_depthbuffer: Assertion `0' failed.
Status: VERIFIED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/i965 (show other bugs)
Version: git
Hardware: Other All
: medium normal
Assignee: haihao
QA Contact:
URL:
Whiteboard:
Keywords: NEEDINFO
Depends on: 13922
Blocks:
  Show dependency treegraph
 
Reported: 2008-01-31 02:28 UTC by Timo Jyrinki
Modified: 2009-08-24 12:29 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.0.log of a running session (25.31 KB, text/plain)
2008-01-31 02:29 UTC, Timo Jyrinki
Details
xorg.conf (3.77 KB, text/plain)
2008-01-31 02:29 UTC, Timo Jyrinki
Details
lspci -vvn (13.53 KB, text/plain)
2008-01-31 02:29 UTC, Timo Jyrinki
Details
glxinfo -t -v (5.47 KB, text/plain)
2008-01-31 02:30 UTC, Timo Jyrinki
Details
print more information about kernel memory manager (734 bytes, patch)
2008-02-04 18:54 UTC, haihao
Details | Splinter Review
new Xorg.0.log with TTM working (25.05 KB, text/plain)
2008-02-05 00:34 UTC, Timo Jyrinki
Details

Description Timo Jyrinki 2008-01-31 02:28:57 UTC
I'm getting this error message when trying to run glxgears on latest git/master versions of drm, libdrm, xserver, intel and mesa:

glxgears: brw_misc_state.c:214: upload_depthbuffer: Assertion `0' failed.

This's when AIGLX/Composite are disabled. If they are enabled, as per default, running glxgears gives a mostly black glxgears window, where gears are only occasionally seen when moving the window.

Running on Asus P5B-VM with GMA X3000 plus ADD2 card Pegasus 35111140 (Dual DVI-I).
Comment 1 Timo Jyrinki 2008-01-31 02:29:24 UTC
Created attachment 14049 [details]
Xorg.0.log of a running session
Comment 2 Timo Jyrinki 2008-01-31 02:29:39 UTC
Created attachment 14050 [details]
xorg.conf
Comment 3 Timo Jyrinki 2008-01-31 02:29:53 UTC
Created attachment 14051 [details]
lspci -vvn
Comment 4 Timo Jyrinki 2008-01-31 02:30:14 UTC
Created attachment 14052 [details]
glxinfo -t -v
Comment 5 Timo Jyrinki 2008-01-31 02:32:13 UTC
Please don't mind the video card Identifier in xorg.conf, I was just too lazy to rename it. The mentioned ATI card is not attached to the computer at the moment.
Comment 6 haihao 2008-01-31 21:31:40 UTC
> If they are enabled, as per default,
> running glxgears gives a mostly black glxgears window, where gears are only
> occasionally seen when moving the window.
> 
I don't see this issue.  Are you sure glxgears run on the latest git/master version?  Why I can't find any information about "memory manager" in your Xorg.0.log ?
Comment 7 Timo Jyrinki 2008-02-01 04:50:49 UTC
Yes, I'm fairly sure I'm running the latest:
- MESA: see glxinfo, it wouldn't say "2.0 Mesa 7.1" if it hadn't gotten into use the libGL* and i965_dri.so from the GIT version of MESA I built
- DRM/libdrm: latest git versions of both are being used, I checked that there are no multiple versions of those installed and the one that are in use are what I compiled from the latest GIT
- Xserver. As you can see from the Xserver log, it say 1.4.99.2, it's the GIT version from three days ago, compiled against the MESA GIT version and added with keyboard/mouse & intel DDX driver

So is there anything I'm missing? I'm also wondering what's causing the "Failed to initialize TTM buffer manager.", since in theory it should work/start with these? Is memory manager a separate module that should be compiled, or something that should be separately enabled with a configure option?
Comment 8 Kristian Høgsberg 2008-02-01 07:40:20 UTC
The idea is that cpp is no longer necessarily a global setting, you can have a GLXPixmap or a FBO with a different bit depth.  So we can't just look this up from the screen global setting.  Not sure why this assert triggers though, what's the actual value of region->cpp?
Comment 9 haihao 2008-02-01 22:09:56 UTC
(In reply to comment #7)
> - DRM/libdrm: latest git versions of both are being used, I checked that there
> are no multiple versions of those installed and the one that are in use are
> what I compiled from the latest GIT

Do you use the latest DRM kernel module?
Comment 10 haihao 2008-02-01 22:14:14 UTC
(In reply to comment #8)
> The idea is that cpp is no longer necessarily a global setting, you can have a
> GLXPixmap or a FBO with a different bit depth.  So we can't just look this up
> from the screen global setting.  Not sure why this assert triggers though,
> what's the actual value of region->cpp?
now the cpp of depth buffer is 3, but the actual value should be 4.


Comment 11 Timo Jyrinki 2008-02-02 02:39:35 UTC
(In reply to comment #9)
> Do you use the latest DRM kernel module?

Yes, "DRM/libdrm" meant that I have both the kernel modules and libdrm compiled from GIT. dmesg says (the version numbers apparently aren't updated in any way when using modules from git):
[   31.278055] [drm] Initialized drm 1.1.0 20060810
[   31.428083] [drm] Initialized i915 1.12.0 20070209 on minor 0
[   31.428092] [drm] Used old pci detect: framebuffer loaded

The modules:
-rw-r--r-- 1 timo timo 5225698 2008-02-02 12:23 drm.ko
-rw-r--r-- 1 timo timo 1428061 2008-02-02 12:23 i915.ko

Regarding debugging, I get X hanged if I try to run the glxgears via gdb.

As an additional note, if I don't disable AIGLX & composite (ie. when glxgears semi-runs), and enable compiz, I get the whole screen completely garbled with colored noise. I can see eg. the shapes of windows, so I may blindly type metacity --replace in terminal to restore ungarbled view.
Comment 12 haihao 2008-02-02 19:04:37 UTC
(In reply to comment #11)
> (In reply to comment #9)
> > Do you use the latest DRM kernel module?
> 
> Yes, "DRM/libdrm" meant that I have both the kernel modules and libdrm compiled
> from GIT. dmesg says (the version numbers apparently aren't updated in any way
> when using modules from git):
> [   31.278055] [drm] Initialized drm 1.1.0 20060810
> [   31.428083] [drm] Initialized i915 1.12.0 20070209 on minor 0
> [   31.428092] [drm] Used old pci detect: framebuffer loaded

I see the same issue if I use an old DRM kernel module (from 2.6.24-rc3), and the memory layout is same as your X.0.log.  So please double check your DRM (f.g Is your DRM from freedesktop.org, use insmod drm.ko/i915.ko before starting X, ) 
Comment 13 Timo Jyrinki 2008-02-04 01:18:39 UTC
I insmodded the compiled drm & i915 modules from the GIT drm directory before starting X, the GIT drm is from git://anongit.freedesktop.org/git/mesa/drm and has eg. drm_ttc.c. I have the same problems regardless:
without composite/AIGLX, I get the error message mentioned. With composite/AIGLX (ie. Xorg default settings), either nothing is drawn in the 3D application's window or only eg. something like 256x256 tile of the 3D window is drawn. I get the "Failed to initialize TTM buffer manager." too in both cases.

It also seems I'm not the only one with these problems:
http://lists.freedesktop.org/archives/xorg/2008-January/031847.html (see the whole thread, he updates also to the master of mesa/drm in addition to mesa/mesa and intel ddx driver later on). He has probably not tried disabling AIGLX/composite, and is thus seeing only the "not shown completely/correctly" problem.

I eg. started Flight Gear and had only the upper left corner of the window drawn. Additionally, there were some graphical errors/noise (not as much when using full-screen compiz) even in the part that was drawn.

I can confirm the finding in that thread that reverting commit d9edd8e90588417e3d549f25132dab2f21445792 in mesa gets rid of the clipping problems and eg. glxgears is drawn when the window size is increased. Also Flight Gear works, but Compiz still shows only garbled screen when tried to be enabled.

This bug is getting bloated, feel free to advise on which issues should be separated to own bugs. The issues are:
1. TTM is not initialized
2. Only parts of 3D windows are shown
3. Even if 2. is fixed by reverting the specific git commit, Compiz window is garbled
4. If AIGLX/Composite is disabled, glxgears gives error message
Comment 14 Timo Jyrinki 2008-02-04 04:00:23 UTC
Ah, after having a better search on the existing bugs, this bug can indeed be reduced to the original segmentation fault problem when AIGLX/Composite disabled + the compiz problem which might need its own bug still. The other two problems have their own bugs:

Adding dependency on bug #13922 as for the TTM not getting initialized problem. So at least that part can be handled there. It might be that the problem is caused by the lack of TTM.

Bug #14251 is handling the regression caused by the commmit d9edd8e90588417e3d549f25132dab2f21445792.
Comment 15 haihao 2008-02-04 09:08:34 UTC
(In reply to comment #11)
> (In reply to comment #9)
> > Do you use the latest DRM kernel module?
> 
> Yes, "DRM/libdrm" meant that I have both the kernel modules and libdrm compiled
> from GIT. dmesg says (the version numbers apparently aren't updated in any way
> when using modules from git):
> [   31.278055] [drm] Initialized drm 1.1.0 20060810
> [   31.428083] [drm] Initialized i915 1.12.0 20070209 on minor 0
> [   31.428092] [drm] Used old pci detect: framebuffer loaded
framebuffer kernel module is used. Could you try without this module? see tips in 
http://intellinuxgraphics.org/how_to_report_bug.html
Comment 16 haihao 2008-02-04 18:54:33 UTC
Created attachment 14143 [details] [review]
print more information about kernel memory manager

Could you apply with this patch to print more information about kernel memory manager, then post your new Xorg.0.log?
Comment 17 haihao 2008-02-04 20:54:23 UTC
(In reply to comment #10)
> (In reply to comment #8)
> > The idea is that cpp is no longer necessarily a global setting, you can have a
> > GLXPixmap or a FBO with a different bit depth.  So we can't just look this up
> > from the screen global setting.  Not sure why this assert triggers though,
> > what's the actual value of region->cpp?
> now the cpp of depth buffer is 3, but the actual value should be 4.
> 
Hi, Kristian
 It seems the driver should use the cpp value gotten from Xserver for static buffers(front/back/depth), and this doesn't impact FBO or GLXpixmap, right?
Comment 18 Timo Jyrinki 2008-02-05 00:31:57 UTC
Hi. Finally some progress, not on this bug as such but on the TTM issue. I wondered why your patch didn't output anything, and noticed the #ifdef DRI_MM in the code - turns out that I still had an old libdrm.pc pkgconfig file, which reported older version, which disabled DRI_MM in the intel DDX driver. So, as simple as that!

Anyway, this same error still occurs when AIGLX/Composite is disabled, but having the TTM is good anyway.
Comment 19 Timo Jyrinki 2008-02-05 00:34:27 UTC
Created attachment 14150 [details]
new Xorg.0.log with TTM working
Comment 20 Kristian Høgsberg 2008-02-05 09:27:51 UTC
(In reply to comment #17)
> (In reply to comment #10)
> > (In reply to comment #8)
> > > The idea is that cpp is no longer necessarily a global setting, you can have a
> > > GLXPixmap or a FBO with a different bit depth.  So we can't just look this up
> > > from the screen global setting.  Not sure why this assert triggers though,
> > > what's the actual value of region->cpp?
> > now the cpp of depth buffer is 3, but the actual value should be 4.
> > 
> Hi, Kristian
>  It seems the driver should use the cpp value gotten from Xserver for static
> buffers(front/back/depth), and this doesn't impact FBO or GLXpixmap, right?

The problem is that AIGLX is disabled.  With the new GLX visual setup, the X server relies on AIGLX to load the driver and ask the DRI driver which visuals it supports.  This means that disabling AIGLX on the server will cause spurious visual mismatches as the server now uses the software renderers (GLcore) visuals but the direct rendering client tries to use the visuals returned by the DRI driver loaded on the client side.

However, we could probably do a better job of inferring the cpp fromt the visual; instead of assuming rgbBits / 8 is a suitable value, I guess we should do something like

  if (intel->ctx.Visual.rgbBits == 16)
    region->cpp = 2;
  else
    /* assume 32 bits per pixel */
    region->cpp = 4;

in intel_recreate_static().  But again the real problem comes from AIGLX being disabled, and the above fix will only paper over it.
Comment 21 Eric Anholt 2008-02-05 11:01:04 UTC
Fix for the assertion failure is pushed.  Thanks!
Comment 22 Timo Jyrinki 2008-02-05 11:32:57 UTC
Yep, verifying that commit c0e026c8090954ddb629a01cc1a93c61b2fc8298 fixes the issue for me.
Comment 23 Timo Jyrinki 2008-02-06 02:49:11 UTC
Also, Kristian is correct that the fix only hides other problems regarding visuals when AIGLX is disabled, but at least something works also with it disabled now.
Comment 24 Adam Jackson 2009-08-24 12:29:19 UTC
Mass version move, cvs -> git


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.