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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Gerd,

On Wed, Nov 15, 2023 at 10:22 AM Gerd Hoffmann <kraxel@xxxxxxxxxx> wrote:
> On Wed, Nov 15, 2023 at 09:33:28AM +0100, Geert Uytterhoeven wrote:
> > On Tue, Nov 14, 2023 at 10:45 AM Christian Zigotzky
> > <chzigotzky@xxxxxxxxxxx> 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.

OK.

> 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
> machines.
>
> 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_HOST_XRGB8888,
> +       DRM_FORMAT_XRGB8888,
> +       DRM_FORMAT_BGRX8888,
>  };
>
>  static const uint32_t virtio_gpu_cursor_formats[] = {
> -       DRM_FORMAT_HOST_ARGB8888,
> +       DRM_FORMAT_ARGB8888,
> +       DRM_FORMAT_BGRA8888,
>  };
>
>  uint32_t virtio_gpu_translate_format(uint32_t drm_fourcc)

Thanks!
Almost there, the check in virtio_gpu_user_framebuffer_create()
must be extended, too.

I have submitted a patch
https://lore.kernel.org/r/282a31154172a78165912c832a09f6502515d139.1700140178.git.geert@xxxxxxxxxxxxxx/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux