Fbdev issue after the drm updates 'drm-next-2023-10-31-1'

Gerd Hoffmann kraxel at redhat.com
Wed Nov 15 20:22:04 AEDT 2023

On Wed, Nov 15, 2023 at 09:33:28AM +0100, Geert Uytterhoeven wrote:
> Hi Christian,
> CC virtgpu
> On Tue, Nov 14, 2023 at 10:45 AM Christian Zigotzky
> <chzigotzky at xenosoft.de> wrote:
> > On 13 November 2023 at 01:48 pm, Geert Uytterhoeven wrote:
> > > I can confirm there is no graphics output with m68k/virt, and
> Before the error message you reported:
>     virtio-mmio virtio-mmio.125: [drm] *ERROR* fbdev: Failed to setup
> generic emulation (ret=-2)
> it also prints:
>     virtio-mmio virtio-mmio.125: [drm] bpp/depth value of 32/24 not supported
>     virtio-mmio virtio-mmio.125: [drm] No compatible format found
> Upon closer look, it turns out virtgpu is special in that its main
> plane supports only a single format: DRM_FORMAT_HOST_XRGB8888, which
> is XR24 on little-endian, and BX24 on big-endian.  I.e. on big-endian,
> virtgpu does not support XR24.

Driver and device support both XR24 and BX24 on both little endian and
big endian just fine.

Problem is both fbdev interfaces and the ADDFB ioctl specify the format
using bpp instead of fourcc, and advertising only one framebuffer format
-- in native byte order -- used to worked best, especially on bigendian

That was years ago though, IIRC predating the generic fbdev emulation,
so maybe it's time to revisit that.  Changing it should be as simple as
updating the format arrays:

--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -30,11 +30,13 @@
 #include "virtgpu_drv.h"
 static const uint32_t virtio_gpu_formats[] = {
+       DRM_FORMAT_XRGB8888,
+       DRM_FORMAT_BGRX8888,
 static const uint32_t virtio_gpu_cursor_formats[] = {
+       DRM_FORMAT_ARGB8888,
+       DRM_FORMAT_BGRA8888,
 uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)


More information about the Linuxppc-dev mailing list