Bug 71789 - [r300g] Visuals not found in (default) depth = 24
Summary: [r300g] Visuals not found in (default) depth = 24
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Drivers/Gallium/r300 (show other bugs)
Version: 11.2
Hardware: PowerPC Linux (All)
: medium normal
Assignee: Default DRI bug account
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-19 14:05 UTC by Martin Pieuchot
Modified: 2017-04-08 16:41 UTC (History)
10 users (show)

See Also:
i915 platform:
i915 features:


Attachments
Xorg.log without configuration file (25.10 KB, text/plain)
2013-11-19 14:05 UTC, Martin Pieuchot
Details
Xorg.log with 16 bits depth in xorg.conf (24.42 KB, text/plain)
2013-11-19 14:06 UTC, Martin Pieuchot
Details
glxinfo output (4.62 KB, text/plain)
2015-06-04 03:15 UTC, herminio.hernandezjr
Details
strace default depth 24 (57.06 KB, text/plain)
2015-11-18 04:12 UTC, herminio.hernandezjr
Details
strace default depth 16 (1.46 MB, text/plain)
2015-11-18 04:13 UTC, herminio.hernandezjr
Details
xorg log (30.97 KB, text/plain)
2015-11-18 04:14 UTC, herminio.hernandezjr
Details
proposed patch (5.48 KB, patch)
2016-04-26 07:45 UTC, Mathieu Malaterre
Details | Splinter Review
final fix? (8.14 KB, patch)
2016-04-30 18:52 UTC, Marek Olšák
Details | Splinter Review
glxinfo output with final fix (49.25 KB, text/plain)
2016-05-01 10:22 UTC, Nathan-J. Hirschauer
Details
Piglit Sanity Check Results (5.61 KB, application/x-bzip)
2016-05-02 18:56 UTC, Nathan-J. Hirschauer
Details

Description Martin Pieuchot 2013-11-19 14:05:03 UTC
Created attachment 89467 [details]
Xorg.log without configuration file

Without xorg.conf or with a pixel depth of 24 bits, any application linked to libGL will fails to load the "r300" driver and after it the "swarst" driver with the following message:

  libGL error: failed to load driver: r300
  libGL error: Try again with LIBGL_DEBUG=verbose for more details.
  libGL error: failed to load driver: swrast
  libGL error: Try again with LIBGL_DEBUG=verbose for more details.

This problem is present in all the Mesa 9.x release up to 9.2.3.  But it is not in the 8 (which segfault at some point), 7.11 was working without config file.

After a bit of investigation, I found that driConvertConfigs() returns NULL in  dri2CreateScreen() when trying to find matching visuals (src/glx/dri_glx.c:450).  However if I specify a depth of 16 bits in my xorg.conf I cannot reproduce this problem.

This problem is present on OpenBSD -current (future 5.5) which has the drm drivers synced with Ubuntu's linux 3.8 kernel.
Comment 1 Martin Pieuchot 2013-11-19 14:06:02 UTC
Created attachment 89468 [details]
Xorg.log with 16 bits depth in xorg.conf
Comment 2 Martin Pieuchot 2014-01-06 15:47:17 UTC
FWIW the patches mentionned in http://lists.freedesktop.org/archives/mesa-dev/2013-December/050218.html work for me.
Comment 3 herminio.hernandezjr 2015-06-04 03:10:35 UTC
I am seeing the same thing in Debian Testing. Those patches woorked all the way up to mesa 10.5.5 then they began to fail.
Comment 4 herminio.hernandezjr 2015-06-04 03:15:03 UTC
Created attachment 116274 [details]
glxinfo output
Comment 5 herminio.hernandezjr 2015-11-18 04:11:26 UTC
I noticed in the 11.0.3 release notes that this issue was fix. However I am running Lubuntu 16.04 (development) on my iBook G4 and I am still. Getting the same issue. When I change to Defaul Depth 16 I get 3D acceleration. I ran strace under both conditions and am post them plus my Xorg.0.log
Comment 6 herminio.hernandezjr 2015-11-18 04:12:17 UTC
Created attachment 119753 [details]
strace default depth 24
Comment 7 herminio.hernandezjr 2015-11-18 04:13:21 UTC
Created attachment 119754 [details]
strace default depth 16
Comment 8 herminio.hernandezjr 2015-11-18 04:14:23 UTC
Created attachment 119755 [details]
xorg log
Comment 9 Martin Pieuchot 2015-12-19 12:16:45 UTC
I confirm that this bug is still present with Mesa 11.0.6.

Without forcing "DefaultDepth" to 16, I get:

  $ glxgears
  libGL error: No matching fbConfigs or visuals found
  libGL error: failed to load driver: r300
  libGL error: No matching fbConfigs or visuals found
  libGL error: failed to load driver: swrast
Comment 10 Max May 2016-02-13 15:05:32 UTC
With Ubuntu Mate 16.04a2 on a G4 PowerBook5,8 I have to confirm, that this bug is still present with Mesa 11.1.1.
Comment 11 erhard_f 2016-02-14 13:49:12 UTC
Can confirm this bug on Ubuntu MATE 16.04 daily, Mesa 11.1.1. On a PowerBook 5,6.
Comment 12 erhard_f 2016-04-12 21:45:58 UTC
Still here on mesa 11.2 (Ubuntu MATE 16.04 daily). Tested on a PowerMac G5 7,3.
Comment 13 Mathieu Malaterre 2016-04-25 06:00:28 UTC
An updated patch is now available from:

https://lists.freedesktop.org/archives/mesa-dev/2016-April/114409.html

As mentioned over here:

https://lists.freedesktop.org/archives/mesa-dev/2016-April/114412.html

we'are actively looking forward for feedback.

I've also attached the patch directly to this bug tracker for convenience: r300g_be.patch
Comment 14 herminio.hernandezjr 2016-04-25 06:01:25 UTC
I also see in apitrace that GLXChooseVisual returns with NULL when I to run glxgears.
Comment 15 herminio.hernandezjr 2016-04-25 06:01:44 UTC
I also see in apitrace that GLXChooseVisual returns with NULL when I to run glxgears.
Comment 16 Mathieu Malaterre 2016-04-26 07:45:44 UTC
Created attachment 123267 [details] [review]
proposed patch
Comment 17 Elimar Riesebieter 2016-04-26 19:38:49 UTC
Patched r300g_be.patch against mesa 11.1.3. -> No acceleration at Depth 24.This is Debian sid.
Comment 18 Dan DeVoto 2016-04-27 15:13:43 UTC
Same here.  Glxinfo says r300 fails to load.

dan@powerbook2:~$ glxinfo
name of display: :0.0
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: r300
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Error: couldn't find RGB GLX visual or fbconfig

...
Comment 19 Nathan-J. Hirschauer 2016-04-27 16:55:36 UTC
Applied the patch on top of 43f46caf769b0a6d661850ce2fa64b6f4b085b9f, but unfortunately it didn't work. Tested on a PowerBook G4 5,6 with Linux 4.6-rc4 (5f44abd041c5f3be76d57579ab254d78e601315b) / Debian Sid.
Comment 20 Marek Olšák 2016-04-30 18:52:55 UTC
Created attachment 123370 [details] [review]
final fix?

Could you please test this patch?
Comment 21 Nathan-J. Hirschauer 2016-05-01 10:22:47 UTC
Created attachment 123385 [details]
glxinfo output with final fix

Patched it on top of cbcd7b60f573d027337a2390e67f6010e9992aaa and that one did actually work! I've attached the full glxinfo output in case someone is interested.
Comment 22 Elimar Riesebieter 2016-05-01 16:39:23 UTC
Applied against Debian 11.1.3-1. 3-D acceleration at depth=24 works. Power consumption running foobillardplus is very high. Colors at the Cairo Dock are looking pastel shaded.
Comment 23 Michel Dänzer 2016-05-02 01:02:47 UTC
Elimar, Nathan or anyone else, can you try if the piglit sanity tests pass with this patch?

Also, do OpenGL compositing managers such as gnome-shell show correct colours?
Comment 24 Nathan-J. Hirschauer 2016-05-02 18:56:53 UTC
Created attachment 123420 [details]
Piglit Sanity Check Results

I've attached the Piglit result of the sanity check to this issue, GNOME Shell also has a discolouration (the title bar and activity screen is red) and after using it for a couple of minutes it crashed (SIGSEGV):

[ 6088.876306] gnome-shell[8144]: unhandled signal 11 at 095b44c0 nip 095b44c0 lr 0de343b4 code 30001
[ 6112.441094] gnome-shell[8701]: unhandled signal 11 at 095b44c0 nip 095b44c0 lr 0de343b4 code 30001
Comment 25 erhard_f 2016-05-03 01:20:30 UTC
Patched on top on 79b0e13913b5189bb8629e80439fea746f99fe79 and it works! Many thanks!

Machine used is a PowerMac G5 7,3 with an AGP Radeon 9600 Pro (Mac edition). Running Compton composting manager (Ubuntu MATE 16.04) and it runs without glitches so far, colours look good. Only thing I noticed is the desktop gets unresponsive and the mouse pointer very jerky during youtube video playback.

Will try Piglit tests the next days.
Comment 26 Mathieu Malaterre 2016-05-03 06:48:14 UTC
I believe that the testers should also make sure to use PCI instead of AGP during there testing. See bug: https://bugs.freedesktop.org/show_bug.cgi?id=95017.
Comment 27 erhard_f 2016-05-05 20:07:15 UTC
Built piglit from svn on Ubuntu MATE 16.04 ppc. Already the sanity test fails, specifically:
root@T800:~/build/piglit# /root/build/piglit/bin/gl-1.0-readpixsanity -auto -fbo
	RGB(A) worst-case error was 6.641274 bits at (32, 80)
		expected (0.840188, 0.394383, 0.783099, 0.798440)
		got (0.799995, 0.784309, 0.396076, 0.839211)
	Depth worst-case error was 23.862089 bits at (107, 6)
		expected 0.911647; got 0.002813.
	Stencil failed at (0, 1).
		Expected 255; got 233.
PIGLIT: {"result": "fail" }

But I must admit that I've no experience with piglit, built and used it for the first time.
Comment 28 Marek Olšák 2016-05-06 08:51:55 UTC
At this stage I just need a confirmation that more than 60% of apps work and show correct colors (mainly games). I don't expect all apps to be perfect right now.
Comment 29 Michel Dänzer 2016-05-06 09:23:56 UTC
That piglit sanity is failing with the patch may confirm my suspicion that something doesn't add up yet I'm afraid: Since the kernel driver and xf86-video-ati EXA code are using the same hardware formats for display/rendering with BE & LE, I was wondering how the patch could result in both display and glReadPixels working correctly for winsys buffers. Looks like indeed only display works correctly, which indicates that the GPU is effectively writing/reading PIPE_FORMAT_x8R8G8B8_* pixels like PIPE_FORMAT_B8G8R8x8_* (which is what the kernel driver and EXA code are using).
Comment 30 Marek Olšák 2016-05-06 09:48:16 UTC
(In reply to Michel Dänzer from comment #29)
> That piglit sanity is failing with the patch may confirm my suspicion that
> something doesn't add up yet I'm afraid: Since the kernel driver and
> xf86-video-ati EXA code are using the same hardware formats for
> display/rendering with BE & LE, I was wondering how the patch could result
> in both display and glReadPixels working correctly for winsys buffers. Looks
> like indeed only display works correctly, which indicates that the GPU is
> effectively writing/reading PIPE_FORMAT_x8R8G8B8_* pixels like
> PIPE_FORMAT_B8G8R8x8_* (which is what the kernel driver and EXA code are
> using).

The patch is correct from the LE perspective. It simply adds ARGB support and was tested thoroughly on LE. The side effect is that BE can use the format now too, but there may be other issues with BE.
Comment 31 herminio.hernandezjr 2016-05-08 06:17:05 UTC
I can verify the patch works. However there are some issues

1. I see my colors are off when I use compiz as my WM and try to rotate the cube.

2.piglit samity tests fail with this error:
spec/!opengl 1.0/gl-1.0-readpixsanity/gl-1.0-readpixsanity: fail

3. games like alien-arean and supertuxkart crash my system when trying to load the game.

4. I can play video in mpv using opengl but get the following error:
[vo/opengl] Could not create EGL context!
Comment 32 Michel Dänzer 2016-05-09 07:47:13 UTC
(In reply to Marek Olšák from comment #30)
> The patch is correct from the LE perspective. It simply adds ARGB support
> and was tested thoroughly on LE. The side effect is that BE can use the
> format now too, but there may be other issues with BE.

Makes sense. Maybe we can use bug 43698 to track the remaining issues.
Comment 33 Marek Olšák 2016-05-09 11:22:50 UTC
Fixed by 172bfdaa9e80342ade3f023f72d455d76713b866. Closing.
Comment 34 cosiekvfj 2017-02-06 21:26:32 UTC
Fix for this bug result in regression: https://bugs.freedesktop.org/show_bug.cgi?id=98869
Comment 35 richard 2017-04-08 13:01:00 UTC
Hello ,

how can i apply this patch?
I am using Powermac G5 7,3 with Radeon9650, Debian Wheezy, kernel 3.2.6
it gives

 dmesg | grep -E 'drm|radeon' | grep -iE 'firmware|microcode'
[    1.137001] radeonfb: Found Open Firmware ROM Image
[    1.137015] radeonfb: Retrieved PLL infos from Open Firmware
[   25.042791] [drm] Loading R300 Microcode
[   25.111223] platform radeon_cp.0: firmware: agent loaded radeon/R300_cp.bin into memory


after installing firmware-linux-nonfree.
Video playback is blue (no video shown) when using mplayer, mpv, vlc .. but html5 playback on youtube works normal (bit slow, though).
Comment 36 richard 2017-04-08 13:05:04 UTC
wheezy only have mesa 8 available, but videoplayback would be very nice please.
don't know how to change colour depth as there is no xorg.conf.
thank you very much
Comment 37 Marek Olšák 2017-04-08 16:41:11 UTC
You can try "git am -3 ...". If that doesn't help, then I don't know.


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.