Bug 1101699

Summary: cirrus: modesetting/fbdev drivers no longer working in xorg-server 1.20
Product: [openSUSE] openSUSE Tumbleweed Reporter: Stefan Dirsch <sndirsch>
Component: X.OrgAssignee: E-mail List <xorg-maintainer-bugs>
Status: RESOLVED FIXED QA Contact: E-mail List <xorg-maintainer-bugs>
Severity: Critical    
Priority: P2 - High CC: msrb, tiwai, tzimmermann
Version: Current   
Target Milestone: ---   
Hardware: Other   
OS: Other   
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---

Description Stefan Dirsch 2018-07-18 16:10:27 UTC
modesetting and fbdev drivers are no longer working with cirrus emulation of qemu/kvm.

modesetting
-------------
# X -retro
[  1460.410] failed to add fb -22
[  1460.410] (EE) modeset(0): failed to set mode: Invalid argument

fbdev
------
# X -retro
[  1615.736] (EE) FBDEV(0): mode initialization failed
[  1615.737] (EE) 
Fatal server error:
[  1615.737] (EE) AddScreen/ScreenInit failed for driver 0

This is a regression in xorg-server 1.20. It still works with xorg-server 1.19.6.
Comment 1 Stefan Dirsch 2018-07-18 16:17:12 UTC
Works fine with qxl.
Comment 2 Takashi Iwai 2018-07-19 07:42:48 UTC
Looks like a 24bpp problem as expected.  The onliner below seems fixing the problem with modesetting.

--- a/hw/xfree86/drivers/modesetting/drmmode_display.c
+++ b/hw/xfree86/drivers/modesetting/drmmode_display.c
@@ -990,7 +990,7 @@ drmmode_bo_import(drmmode_ptr drmmode, d
     }
 #endif
     return drmModeAddFB(drmmode->fd, bo->width, bo->height,
-                        drmmode->scrn->depth, drmmode->scrn->bitsPerPixel,
+                        drmmode->scrn->depth, drmmode->kbpp,
                         drmmode_bo_get_pitch(bo),
                         drmmode_bo_get_handle(bo), fb_id);
 }


The problem with fbdev seems different.  Yet another breakage...
Comment 3 Takashi Iwai 2018-07-19 07:48:09 UTC
It's now clear: the commit e33be78e2ab63abc84aa0baddff90bcefa9c183a
Author: Adam Jackson <ajax@redhat.com>
Date:   Fri Feb 28 13:19:00 2014 -0500

    xfree86: Remove 24bpp pixmap format support (v2)
Comment 4 Takashi Iwai 2018-07-19 08:13:06 UTC
... and passing cirrus.bpp=16 boot option results in Oops.  LOL.
Comment 5 Takashi Iwai 2018-07-19 10:18:45 UTC
(In reply to Takashi Iwai from comment #4)
> ... and passing cirrus.bpp=16 boot option results in Oops.  LOL.

For this problem, I opened another one, bug 1101822.
Comment 6 Stefan Dirsch 2018-07-19 10:45:15 UTC
Even if 16bpp in KMS will work (again?) we may also need this fix (which was committed after xorg-server 1.20) ?

commit 1c7f34e99ff9750979a03ae20c6be1f2b42c284c (HEAD -> master, origin/master, origin/HEAD)
Author: Stefan Agner <stefan@agner.ch>
Date:   Thu Dec 22 15:41:06 2016 +0100

    modesetting: Fix 16 bit depth/bpp mode

Also I'm not sure whether Mesa would work in 16bpp at all still ...
Comment 7 Takashi Iwai 2018-07-19 10:56:40 UTC
The modesetting works with 24bpp with my patch in comment 2.  The modesetting driver supports the shadow copying between 24 and 32 bpp.

The total breakage is only about fbdev.  I guess there is no hope for 24bpp with fbdev.  The attempt with cirrus.bpp=16 was just for checking whether it works or not :)
Comment 8 Stefan Dirsch 2018-07-19 12:44:12 UTC
https://lists.x.org/archives/xorg-devel/2018-July/057313.html

Ok. Let's forget about fbdev in 24bpp and close this bug.
Comment 9 Swamp Workflow Management 2018-07-19 14:20:22 UTC
This is an autogenerated message for OBS integration:
This bug (1101699) was mentioned in
https://build.opensuse.org/request/show/624084 Factory / xorg-x11-server