x fails to startup in qemu - no driver for Cirrus card

Bug #193323 reported by Reinhard Tartler
16
Affects Status Importance Assigned to Milestone
qemu (Ubuntu)
Invalid
Medium
Unassigned
Hardy
Invalid
Undecided
Unassigned
xserver-xorg-video-cirrus (Ubuntu)
Fix Released
Undecided
Unassigned
Hardy
Fix Released
Medium
StefanPotyra

Bug Description

The cirrus driver advertises supported depths wrongly, for e.g. the cirrus gd5446, telling that the cards would unconditionally support 32bpp. However this is not the case for the 5446 and the 5430. Hence autoconfigured X won't start with this graphics cards. In previous ubuntu releases, this was no problem, since the default depth was set to 24bpp, however hardy defaults to 32bpp. At a later point, the driver correctly fails to set the max value of the pixel clock, since this is indeed conditioned on the given graphics adapter.

The proposed patch is taken from the intrepid package (1.2.1), which conditionally advertises the capabilities based on the detected graphics card.

Impact: regressing since gutsy, for everyone with a gd5446 (won't be too many I assume, since it's an old graphics adaptor). Additionally anyone trying the live cd in a vm which simulates the gd5446 (e.g. qemu).

TEST CASE: boot hardy live cd on a box (or vm) with a gd5446. X won't start. install the new driver right into the livefs and try to start X. Works.
vm's you can use for testing: qemu or FAUmachine (not packaged), which both come with different implementations of the gd5446.
kvm (which also uses the gd5446 from qemu) is not affected, since dexconf detects the kvm instance and sets the default depth to 24bpp.

Revision history for this message
Reinhard Tartler (siretart) wrote :
Revision history for this message
Iandefor (iandefor) wrote :

Having the same problem here using Alpha 5.

Revision history for this message
Iandefor (iandefor) wrote :

By the way, this can be worked around by passing -std-vga to qemu.

Revision history for this message
Schorsch (schorsch1749) wrote :

confirm with hardy a6

Revision history for this message
Schorsch (schorsch1749) wrote :

>> By the way, this can be worked around by passing -std-vga to qemu.

Thats true. However there is at least one qemu-launcher-frontend - qtemu - which offers no choice to select the standard vesa card instead of the cirrus card.

Revision history for this message
StefanPotyra (sistpoty) wrote :

Hi,

I'm marking this bug as invalid for xsever-xorg-video-cirrus.
Ratiionale:
I'm working on FAUmachine (www.faumachine.org), which is based partially on qemu (and this is valid for the video card as well, and it shows the same problem).
I've looked through the debdiff from gutsy->hardy, which didn't show anything besides PCI ids relevant for the emulated cirrus card. I believe, these are right in
qemu as well. So it shouldn't be a problem for xserver-xorg-vide-cirrus (but maybe a problem in some other X component).

My best guess, from looking at logs (of FAUmachine) so far is, that some other X component decided (not sure which one) to check for the monitor via calls to the video card and if that fails use a failsafe configuration for the monitor, which in turn won't yield valid modes for the cirrus card. That's however just a guess.
This guess is based on logs I've seen from FAUmachine, which say that the cirrus card is getting probed for DDC requests (which is not implemented yet, either in FAUmachine nor in qemu afaik), so these fail and don't return the right data.

HTH,
   Stefan.

Changed in xserver-xorg-video-cirrus:
status: New → Invalid
Revision history for this message
StefanPotyra (sistpoty) wrote :

This might also give some clue on why it worked with gutsy, and why it doesn't work in hardy:
"(II) CIRRUS(0): Creating default Display subsection in Screen section
 "Default Screen" for depth/fbbpp 24/32
(==) CIRRUS(0): Depth 24, (==) framebuffer bpp 32"

in gutsy, the framebuffer was still with 24 bits.

My guess what's going on there is the following:
xserver-xorg-video-cirrus will do in src/alp_driver.c an initialisation (function AlpPreInit). In there (somewhere around line 960) the maximum dot clock frequency gets set, depending on the bits per pixel (these seem to come from the framebuffer bpp?). For the gd5446 that's 0 though (line 146), as it doesn't support that 32bpp.

This still doesn't give much clue of *where* this comes from though.

Revision history for this message
Reinhard Tartler (siretart) wrote :

Confirming this bug, thanks to Stefan for the analysis!

Changed in qemu:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Reinhard Tartler (siretart) wrote :

bryce, soeren, kees just told me that you have been working on this bug. I tried it out with the release hardy iso image on my laptop, and can still reproduce it. Can you please recheck?

Revision history for this message
Reinhard Tartler (siretart) wrote :

additional information: Kees stated that adding HorizSync and VertRefresh lines works around the bug.

Revision history for this message
StefanPotyra (sistpoty) wrote :

more info: kvm does indeed work, because there's a quirk in dexconf to detect if run under kvm.

Revision history for this message
StefanPotyra (sistpoty) wrote :

I've tested this right now with FAUmachine, and there it is enough to add only DefaultDepth 24 to the xorg.conf.

My best guess is, that this is indeed a X problem, which results from the default depth being 32. Since a real cirrus gd5446 doesn't support this depth, I believe that X wouldn't start with a real card as well.

Revision history for this message
StefanPotyra (sistpoty) wrote :

setting xserver-xorg-video-cirrus task back to new again. I somehow believe that the error is there.

More precise: I think that
src/alp_driver.c:952
       switch(pScrn->bitsPerPixel) {
should be
       switch(pScrn->depth) {

but I must admit, that I don't have too much clue about X in general.

Changed in xserver-xorg-video-cirrus:
status: Invalid → New
Revision history for this message
StefanPotyra (sistpoty) wrote :

Aha, looking at the new xserver-xorg-video-cirrus driver (1.2.1-1) gives more clue, since it indeed contains a quirk at the second place, which might be responsible:

alp_driver.c:602 contains now:
 /* 32bpp only works on 5480 and 7548 */
 depth_flags = Support24bppFb;
 if (pCir->Chipset == PCI_CHIP_GD5480 || pCir->Chipset ==PCI_CHIP_GD7548)
     depth_flags |= Support32bppFb |
      SupportConvert32to24 |
      PreferConvert32to24;
 /*
  * The first thing we should figure out is the depth, bpp, etc.
  * We support both 24bpp and 32bpp layouts, so indicate that.
  */
 if (!xf86SetDepthBpp(pScrn, 0, 0, 24, depth_flags)) {
  return FALSE;

instead of:
 /*
  * The first thing we should figure out is the depth, bpp, etc.
  * We support both 24bpp and 32bpp layouts, so indicate that.
  */
 if (!xf86SetDepthBpp(pScrn, 0, 0, 0, Support24bppFb | Support32bppFb |
    SupportConvert32to24 | PreferConvert32to24)) {
  return FALSE;

I'll try tomorrow, if this works.

Revision history for this message
StefanPotyra (sistpoty) wrote :

this is indeed a bug in the driver, not in qemu. I'll attach a debdiff in a minute.

Changed in xserver-xorg-video-cirrus:
assignee: nobody → sistpoty
status: New → In Progress
Revision history for this message
StefanPotyra (sistpoty) wrote :

... and not in qemu.

Changed in qemu:
status: Triaged → Invalid
Revision history for this message
StefanPotyra (sistpoty) wrote :
Revision history for this message
StefanPotyra (sistpoty) wrote :

in case someone else wants to test, and doesn't want to fiddle with rebuilding the binary first, here's one.

Revision history for this message
StefanPotyra (sistpoty) wrote :

already fixed in intrepid with 1.2.1.

description: updated
Changed in xserver-xorg-video-cirrus:
assignee: nobody → sistpoty
status: New → In Progress
assignee: sistpoty → nobody
status: In Progress → Fix Released
Changed in qemu:
status: New → Invalid
Revision history for this message
Reinhard Tartler (siretart) wrote :

milestoning the bug, I'm currently testing the diff in qemu (non-kvm!)

Changed in xserver-xorg-video-cirrus:
importance: Undecided → Medium
milestone: none → ubuntu-8.04.1
Revision history for this message
Reinhard Tartler (siretart) wrote :

I'm happy to confirm that the patch indeed fixes the bug. I'm attaching an X.org log with a package build included sistpoty's patch for reference.

Great work, Stefan! :-)

Steve Langasek (vorlon)
Changed in xserver-xorg-video-cirrus:
milestone: ubuntu-8.04.1 → none
Revision history for this message
Steve Langasek (vorlon) wrote :

Accepted into -proposed, please test and give feedback here

Changed in xserver-xorg-video-cirrus:
status: In Progress → Fix Committed
Revision history for this message
Bryce Harrington (bryce) wrote :

Possibly with this fix, some portion of the kvm-specific changes to dexconf could be dropped.

If anyone is interested in assisting with this, please file a new bug assigned to me, attach a minimal xorg.conf that has been adequately tested. Here are the current kvm-specific things dexconf is doing:
a) hardcoding the driver to cirrus
b) specifying the depth
c) setting the HorizSync and VertRefresh
d) specifying the available resolutions

In theory, none of these four things should be necessary, but I suspect this bug fix only addresses b and maybe c. Please test if these can be removed and if so, file a bug and I can take care of dropping them in dexconf. Thanks ahead of time.

Revision history for this message
StefanPotyra (sistpoty) wrote :

I've filed bug 237164 for dexconf. Let's continue the discussion about it there.

Revision history for this message
Martin Pitt (pitti) wrote : Re: [Bug 193323] Re: x fails to startup in qemu - no driver for Cirrus card

Hi Reinhard,

Reinhard Tartler [2008-06-03 14:27 -0000]:
> I'm happy to confirm that the patch indeed fixes the bug. I'm attaching
> an X.org log with a package build included sistpoty's patch for
> reference.

Great, thanks for testing! Do you have the time to do the test with
the actual .debs from -proposed again, to verify the actual packages?
Thanks!

Revision history for this message
StefanPotyra (sistpoty) wrote :

just tested the package from -proposed on FAUmachine, works like a charm :).

Revision history for this message
Martin Pitt (pitti) wrote :

Copied to hardy-updates.

Changed in xserver-xorg-video-cirrus:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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