Bug 29833 - [RADEON:KMS:M56P:R300G] crashes kicad when using modeset
Summary: [RADEON:KMS:M56P:R300G] crashes kicad when using modeset
Status: RESOLVED NOTABUG
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/DRI/r300 (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-27 03:34 UTC by Fabio Varesano
Modified: 2011-02-09 08:30 UTC (History)
2 users (show)

See Also:
i915 platform:
i915 features:


Attachments

Description Fabio Varesano 2010-08-27 03:34:57 UTC
Hi guys, 

I'm experiencing the bug detailed at https://bugs.launchpad.net/kicad/+bug/582997

Kicad, a software for drawing printed circuit boards in 3d, crashes if run it with modeset enabled on my M56P [Radeon Mobility X1600].

dmesg reports the following error:
[drm:r100_cs_track_check] *ERROR* [drm] No buffer for z buffer !
[drm:radeon_cs_ioctl] *ERROR* Invalid command stream !

Please have a look at all the other details on the linked bug. Please add a comment if you want me to test code, add details, etc. 


Thanks,

Fabio Varesano
Comment 1 Fabio Varesano 2010-08-27 03:37:51 UTC
booting kernel with radeon.modeset=0 fixes the crash.
Comment 2 Alex Deucher 2010-08-27 09:16:43 UTC
Please attach your xorg log and dmesg output.  Also what kernel and driver versions are you running?
Comment 3 Alex Deucher 2010-08-27 09:18:28 UTC
This is most likely a 3D driver bug.
Comment 4 Fabio Varesano 2010-08-27 10:42:57 UTC
[fabio@gamma ~]$ uname -a 
Linux gamma 2.6.35-ARCH #1 SMP PREEMPT Fri Aug 20 22:49:24 CEST 2010 x86_64 Intel(R) Core(TM)2 CPU T7200 @ 2.00GHz GenuineIntel GNU/Linux


xorg.conf: http://sprunge.us/WKda

dmesg: http://sprunge.us/KAGh

Xorg.0.log: http://sprunge.us/hcKb



[root@gamma ~]# X -version

This is a pre-release version of the X server from The X.Org Foundation.
It is not supported in any way.
Bugs may be filed in the bugzilla at http://bugs.freedesktop.org/.
Select the "xorg" product for bugs you find in this release.
Before reporting bugs in pre-release versions please check the
latest version in the X.Org Foundation git repository.
See http://wiki.x.org/wiki/GitPage for git access instructions.

X.Org X Server 1.8.1.902 (1.8.2 RC 2)
Release Date: 2010-06-21
X Protocol Version 11, Revision 0
Build Operating System: Linux 2.6.34-ARCH x86_64 
Current Operating System: Linux gamma 2.6.35-ARCH #1 SMP PREEMPT Fri Aug 20 22:49:24 CEST 2010 x86_64
Kernel command line: BOOT_IMAGE=/boot/vmlinuz26 root=/dev/disk/by-uuid/d3e811ea-3d79-4380-9a15-7f60474ef034 ro resume=/dev/sda6 quiet
Build Date: 21 June 2010  12:01:49PM
 
Current version of pixman: 0.18.4
        Before reporting problems, check http://wiki.x.org
        to make sure that you have the latest version.
Comment 5 Alain Portal 2010-09-02 07:30:09 UTC
I'm not sure this bug is relative to the radeon video driver because somebody reported a similar bug with a different video card:
https://bugzilla.redhat.com/show_bug.cgi?id=592047
Comment 7 Fabio Varesano 2010-10-06 08:51:18 UTC
Guys, would you please explain me how to troubleshoot this one? 

I do have programming knowledge but I need guidance on how to debug this one.

How can I check if this is a radeon bug or kicad bug or what else???
Comment 8 Fabio Pedretti 2010-10-06 09:11:19 UTC
You may want to try the r300 gallium driver that should be more stable e.g. installing the mesa packages from the xorg-edgers ppa:
https://edge.launchpad.net/~xorg-edgers/+archive/ppa
Comment 9 Alex Deucher 2010-10-06 09:15:57 UTC
The kernel is rejecting your command stream as invalid.  The command stream is the stream of register writes produced by the 3D driver based on the GL state.  The bug is either in the drm command checker in the kernel or in the mesa 3D driver.  The error in your dmesg is saying that the Z buffer is enabled in the command stream, but that there is no buffer associated with it.  I would guess perhaps ZB_CNTL (0x4F00) is not getting emitted as part of the command stream.
Comment 10 Fabio Varesano 2010-10-06 14:29:04 UTC
@Fabio Pedretti I'm running Archlinux so I'm unable to use the ppa .. how can I test it with my current config? (see my logs above for software versions)

@Alex ok.. how can I check if this is the case?
Comment 11 Fabio Pedretti 2010-10-07 01:55:24 UTC
> @Fabio Pedretti I'm running Archlinux so I'm unable to use the ppa .. how can I
> test it with my current config? (see my logs above for software versions)

I think you used Ubuntu since you referenced the Ubuntu bug. You should then compile mesa 7.9 from source and replace your r300_dri.so with the new one compiled found in lib/gallium/r300_dri.so.
Comment 12 Fabio Varesano 2010-10-08 00:57:43 UTC
I did what Fabio suggested above. I'm not sure on how to verify that I'm actually running the gallium driver. This is my Xorg log: http://sprunge.us/ZYiK

However, running with the gallium driver I now get this:

[fabio@gamma ~]$ pcbnew 
The program 'pcbnew' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadDrawable (invalid Pixmap or Window parameter)'.
  (Details: serial 88834 error_code 9 request_code 136 minor_code 8)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)

Any idea? How can I break on the gdk_x_error() function?
Comment 13 Fabio Pedretti 2010-10-08 01:13:25 UTC
To see which mesa driver you are using try:
glxinfo | grep OpenGL
Comment 14 Fabio Varesano 2010-10-08 01:25:05 UTC
(In reply to comment #13)
> To see which mesa driver you are using try:
> glxinfo | grep OpenGL

[fabio@gamma ~]$ glxinfo | grep OpenGL
OpenGL vendor string: X.Org R300 Project
OpenGL renderer string: Gallium 0.4 on RV530
OpenGL version string: 2.1 Mesa 7.9
OpenGL shading language version string: 1.20
OpenGL extensions:
[fabio@gamma ~]$

Looks correct to me.
Comment 15 Alain Portal 2010-10-08 10:01:29 UTC
(In reply to comment #13)
> To see which mesa driver you are using try:
> glxinfo | grep OpenGL

Here is mine, I get the same crash

[alain@portable ~]$ glxinfo | grep OpenGL
OpenGL vendor string: DRI R300 Project
OpenGL renderer string: Mesa DRI R300 (RV515 7210) 20090101  TCL DRI2
OpenGL version string: 1.5 Mesa 7.7.1-DEVEL
OpenGL extensions:
Comment 16 Alex Deucher 2010-10-08 10:17:20 UTC
(In reply to comment #10)
> @Alex ok.. how can I check if this is the case?

enable state debugging and make sure the zs and zb state atoms are getting emitted.  See radeon_print_state_atom() in radeon_common.c for more info.
Comment 17 Fabio Pedretti 2010-10-11 02:47:42 UTC
Note that the gallium driver only work with KMS (with radeon.modeset=0 it doesn't work).
Comment 18 Jerome Glisse 2011-02-09 07:24:46 UTC
Still an issue with more recent driver ?
Comment 19 Fabio Varesano 2011-02-09 08:30:59 UTC
(In reply to comment #18)
> Still an issue with more recent driver ?

Nope. This was actually a bug in the program. 
However only some video drivers was letting this crash.

For more info see: https://bugs.launchpad.net/kicad/+bug/582997
The fix has been committed in rev 2767 if you guys are interested in what was wrong.

Thanks.


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.