Bug 23525 - Software rendering on QEMU guests badly broken
Software rendering on QEMU guests badly broken
Status: REOPENED
Product: Mesa
Classification: Unclassified
Component: Mesa core
git
x86-64 (AMD64) Linux (All)
: medium major
Assigned To: mesa-dev
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2009-08-26 06:45 UTC by Brian Wheeler
Modified: 2011-11-26 12:24 UTC (History)
2 users (show)

See Also:


Attachments
example of corruption (108.00 KB, image/png)
2009-08-26 06:46 UTC, Brian Wheeler
Details
fix 24 bits colors / 24 bpp implementation (572 bytes, patch)
2011-07-21 08:12 UTC, Marc Pignat
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Brian Wheeler 2009-08-26 06:45:47 UTC
Environment:
  * QEMU's latest git, although I've seen this in many earlier versions
    * -vga cirrus 
  * Fedora 12 running as a guest (also happens in the moblin snapshot)

When running the gnome shell preview or glx gears, the display is highly corrupted.  It looks like a bytes-per-pixel issue since the image appears in three places.

When using the VESA emulation glxgears works just fine, but the bulk of the gnome shell doesn't. (and I'm limited to 800x600 with no acceleration)

Fedora 12 has rpms versioned 7.6.0-8 so I assume it is a git snapshot.
Comment 1 Brian Wheeler 2009-08-26 06:46:13 UTC
Created attachment 28916 [details]
example of corruption
Comment 2 Andrew Randrianasulu 2009-12-12 22:07:21 UTC
May be it was bug in Qemu emulator itself  OR Mesa's swrast doesn't work too well with 24/24 (as opposed to 24/32) screen/framebuffer (bpp/fbbpp) configuration.

At least Ubuntu 10.04 LiveCD show this problem, too (it uses mesa 7.6.1-rc2-1ubuntu1).
Comment 3 Andrew Randrianasulu 2009-12-13 01:49:34 UTC
(In reply to comment #2)
> May be it was bug in Qemu emulator itself  OR Mesa's swrast doesn't work too
> well with 24/24 (as opposed to 24/32) screen/framebuffer (bpp/fbbpp)
> configuration.
> 
> At least Ubuntu 10.04 LiveCD show this problem, too (it uses mesa
> 7.6.1-rc2-1ubuntu1).
> 

But it works OK in 16/16 bpp .... 

sudo gedit /etc/X11/xinit/xserverrc - add -fbbpp 16 as server argument
sudo /etc/init.d/gdm stop
startx

(not sure how to force gdm to do the same)
Comment 4 Bernhard M. Wiedemann 2011-02-08 03:16:02 UTC
Mesa-7.10 swrast on Qemu/KVM's emulated 24bit cirrus graphics is still broken.
Looks like this:
http://openqa.opensuse.org/opensuse/permanent/bug/bfo23525.png

but works on vesa driver that has
(II) VESA(0): Creating default Display subsection in Screen section
	"Default Screen" for depth/fbbpp 24/24
(==) VESA(0): Depth 24, (==) framebuffer bpp 24
...
(==) Depth 24 pixmap format is 32 bpp

and also works on fbdev with 16/16
Comment 5 Marc Pignat 2011-07-21 08:12:08 UTC
Created attachment 49386 [details] [review]
fix 24 bits colors / 24 bpp implementation
Comment 6 Brian Paul 2011-07-21 10:55:28 UTC
The patch was committed to master as commit cfec000e7514342fd51859906e173ba2d474a55c

How confident are you in the patch?  Should it go into the 7.11 release?
Comment 7 Marc Pignat 2011-07-22 02:57:10 UTC
Hi Brian!

I have done these tests:
* without my patch : 
 * qemu + cirrus emulation + glxgears -> failed
 * qemu + vga emulation + glxgears -> working fine
* with my patch
 * qemu + cirrus emulation -> working
 * qemu + vga emulation -> still working fine
 
So it seems that this patch solves the problem, and does not introduce
another bug.

So I'm confident in this patch ;)

Regards
Comment 8 Brian Paul 2011-07-22 06:39:30 UTC
OK, I've cherry-picked this to 7.11.
Comment 9 Bernhard M. Wiedemann 2011-11-26 12:24:54 UTC
Just noticed this issue still occurred with Mesa-7.11 (even on real Cirrus HW)
Checking the source, I found that the patch from comment 5 was missing.
Applying the patch, fixed glxgears,
but left other programs (e.g. KDE4's khelpcenter and konqueror (both using KHTML)) with similar bpp corruptions in image rendering, which are not present with other drivers.