Garbage when using qemu/kvm and cirrus emulation

Bug #810339 reported by Marc Pignat
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Mesa
Fix Released
High
mesa (Ubuntu)
Fix Released
Undecided
Chris Halse Rogers

Bug Description

How to reproduce :
glxgears

(glxgears will display garbage on screen)

ProblemType: Bug
DistroRelease: Ubuntu 11.10
Package: libgl1-mesa-glx 7.11~1-0ubuntu3
ProcVersionSignature: Ubuntu 3.0.0-5.6-generic 3.0.0-rc7
Uname: Linux 3.0.0-5-generic x86_64
Architecture: amd64
CompizPlugins: No value set for `/apps/compiz-1/general/screen0/options/active_plugins'
CompositorRunning: None
Date: Thu Jul 14 11:07:19 2011
DistUpgraded: Fresh install
DistroCodename: oneiric
DistroVariant: ubuntu
GraphicsCard:
 Cirrus Logic GD 5446 [1013:00b8] (prog-if 00 [VGA controller])
   Subsystem: Red Hat, Inc Device [1af4:1100]
InstallationMedia: Ubuntu 11.10 "Oneiric Ocelot" - Alpha amd64 (20110531.1)
Lsusb: Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
MachineType: Bochs Bochs
ProcEnviron:
 PATH=(custom, no user)
 LANG=en_US.UTF-8
 SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=/boot/vmlinuz-3.0.0-5-generic root=UUID=a0a28524-bdce-4d53-aa8b-f6f36554f5d3 ro quiet splash vt.handoff=7
Renderer: Unknown
SourcePackage: mesa
UdevDb: Error: [Errno 2] No such file or directory
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 01/01/2007
dmi.bios.vendor: Bochs
dmi.bios.version: Bochs
dmi.chassis.type: 1
dmi.chassis.vendor: Bochs
dmi.modalias: dmi:bvnBochs:bvrBochs:bd01/01/2007:svnBochs:pnBochs:pvr:cvnBochs:ct1:cvr:
dmi.product.name: Bochs
dmi.sys.vendor: Bochs
version.compiz: compiz 1:0.9.4+bzr20110606-0ubuntu6
version.ia32-libs: ia32-libs 20090808ubuntu13
version.libdrm2: libdrm2 2.4.26-1ubuntu1
version.libgl1-mesa-dri: libgl1-mesa-dri 7.11~1-0ubuntu3
version.libgl1-mesa-dri-experimental: libgl1-mesa-dri-experimental N/A
version.libgl1-mesa-glx: libgl1-mesa-glx 7.11~1-0ubuntu3
version.xserver-xorg: xserver-xorg 1:7.6+7ubuntu1
version.xserver-xorg-video-ati: xserver-xorg-video-ati 1:6.14.2-1ubuntu2
version.xserver-xorg-video-intel: xserver-xorg-video-intel 2:2.15.0-3ubuntu2
version.xserver-xorg-video-nouveau: xserver-xorg-video-nouveau 1:0.0.16+git20110411+8378443-1

Related branches

Revision history for this message
In , Bdwheele (bdwheele) wrote :

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.

Revision history for this message
In , Bdwheele (bdwheele) wrote :

Created attachment 28916
example of corruption

Revision history for this message
In , Randrik (randrik) wrote :

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).

Revision history for this message
In , Randrik (randrik) wrote :

(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)

Revision history for this message
In , Freedesktopbmw (freedesktopbmw) wrote :

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

Revision history for this message
Marc Pignat (swid) wrote :
Revision history for this message
Marc Pignat (swid) wrote :
tags: added: patch
Revision history for this message
Bryce Harrington (bryce) wrote :

Hi Marc,

Thanks for including a patch! A few questions though:

a. Did you write this patch yourself, or obtain it from someplace else? If so, can you provide a link to where it came from?

b. Do you know if this patch has been sent upstream yet? If not, it'll need forwarded there.

c. Did you test this patch yourself locally and verify it does fix the issue for you? Do you know of anyone else that has tested it?

Meanwhile, I'm assigning the bug to RAOF for him to consider for inclusion in oneiric's mesa package.

Changed in mesa (Ubuntu):
assignee: nobody → Chris Halse Rogers (raof)
status: New → Incomplete
Revision history for this message
Marc Pignat (swid) wrote :

Hi Bryce!

a) I wrote it myself

b) I have sent it upstream (http://lists.freedesktop.org/archives/mesa-dev/2011-June/008997.html)
It should be included upstream soon, as it fixes the upstream bug https://bugs.freedesktop.org/show_bug.cgi?id=23525

c) I tested it on a kvm machine using the cirrus video emulation, it fixes the problem. I have also tested
 it does not break other video modes (using vga emulation).

Changed in mesa (Ubuntu):
status: Incomplete → In Progress
Changed in mesa:
importance: Unknown → High
status: Unknown → Confirmed
Revision history for this message
In , Marc Pignat (swid) wrote :

Created attachment 49386
fix 24 bits colors / 24 bpp implementation

Revision history for this message
In , Brian-e-paul (brian-e-paul) wrote :

The patch was committed to master as commit cfec000e7514342fd51859906e173ba2d474a55c

How confident are you in the patch? Should it go into the 7.11 release?

Revision history for this message
In , Marc Pignat (swid) wrote :

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

Revision history for this message
In , Brian-e-paul (brian-e-paul) wrote :

OK, I've cherry-picked this to 7.11.

Revision history for this message
Marc Pignat (swid) wrote :

Patch accepted upstream, will be in mesa 7.11

Changed in mesa:
status: Confirmed → Fix Released
Revision history for this message
Dave Gilbert (ubuntu-treblig) wrote :

Hi Marc,
  Nicely fixed - that bug has been around for ages!
  One question; Am I reading your comments right that this is due to the card running in packed 24 bpp rather than 32? If so do you know why? Is that a limitation of the cirrus being emulated?

Dave

Revision history for this message
Marc Pignat (swid) wrote :

Hi Dave,
I have no idea of the chip capabilities...
I just found a way to fix that bug.

Changed in mesa (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (3.5 KiB)

This bug was fixed in the package mesa - 7.11-0ubuntu1

---------------
mesa (7.11-0ubuntu1) oneiric; urgency=low

  * Fake merge from Debian experimental, updating previous changelog entries.
    New upstream release fixes infrequent X crash (LP: #800778).
    Remaining Ubuntu changes:
   - debian/control
      + Drop lesstif-dev from Build-Depends; it's in Universe.
      + Comment out GLw libs since it depends on lesstif-dev.
      + Drop i686 swx11 libgl package.
      + Add libdrm-dev to mesa-common-dev Depends.
      + Drop libwayland-dev from Build-Depends; it's in Universe.
      + Update Breaks for Ubuntu versions
      + Enable llvm on armel as well as i386 and amd64
    - debian/rules
      + Use --disable-glw for swx11 targets too.
      + Don't enable motif for swx11 targets.
      + Use lzma compression for binary debs to save CD space.
      + Drop unloved mach64 driver.
      + Use --enable-shared-dricore to claw back CD space.
      + Enable llvmpipe software rasteriser.
      + Enable llvm on armel as well as i386 and amd64
    - debian/patches
      + 100_no_abi_tag.patch
      + 101_ubuntu_hidden_glname.patch
      + 103_savage-expose_fbmodes_with_nonzero_alpha.patch
    - rules, libgl1-mesa-{glx,dev,swx11,swx11-dev}.install.in,
      libgl1-mesa-{glx,swx11}.{postinst,prerm}.in, libgl1-mesa-dev.links.in:
      Install libGL.so* in /usr/lib/mesa to allow things to work with
      alternatives.
    - debian/not-installed:
      + Drop i686 files; we don't build 686-optimised packages in the first
        place.
    - debian/gbp.conf
      + Point at Ubuntu branch to make git-buildpackage less narky.
    - 113_fix_tls.diff: Fix crashes in unrelated code due to TLS usage.
    - debian/patches/111_export_searchdirs_in_dripc.diff:
      + Add drisearchdirs variable to dri.pc so the Xserver can pick up the
        alternate DRI driver dirs.
    - debian/patches/115_llvm_dynamic_linking.diff
      + Dynamically link DRI drivers to libllvm. Saves ~6MiB per DRI driver.
    - debian/patches/116_use_shared_galliumcore.diff:
    - debian/libgl1-mesa-dri.install.in:
      + Link gallium DRI drivers against shared gallium routines to save CD
        space.
  * debian/rules:
  * debian/libgl1-mesa-dri-experimental.install.{i386,amd64}.in
    - Explicitly install i915g only when it has been built, matching what is
      done with r300g.
  * debian/rules:
  * debian/control:
  * debian/libegl1-mesa{,-dev}.install.in:
  * debian/libegl1-mesa.symbols:
    - Enable the Wayland EGL backend.
  * debian/rules:
  * debian/libegl1-mesa.{postinst,prerm,install}.in:
  * debian/libegl1-mesa-dev.{install,links}.in:
  * debian/libgles{1,2}-mesa.install.in:
  * debian/libgles{1,2}-mesa-dev.links.in:
  * debian/libopenvg1-mesa{,-dev}.install.in:
  * debian/libopenvg1-mesa-dev.links.in:
    - Use alternatives for libEGL to match the handling of libGL.
      libEGL (and associated GL|ES and OpenVG libraries) now live in
      /usr/lib/$MULTIARCH/mesa-egl. (LP: #812639)
  * debian/patches/118_fix_24bpp_software_rendering.diff:
    - Cherry pick upstream patch from master fixing graphical corruption when
      using a 24bpp framebuffer and software renderin...

Read more...

Changed in mesa (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Marc Pignat (swid) wrote :

mesa (7.11-0ubuntu1) oneiric, tested and working!

Revision history for this message
In , Freedesktopbmw (freedesktopbmw) wrote :

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.

Changed in mesa:
status: Fix Released → Confirmed
Changed in mesa:
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.