All of lore.kernel.org
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Christian Zigotzky <chzigotzky@xenosoft.de>
Cc: "Darren Stevens" <darren@stevens-zone.net>,
	"R.T.Dickinson" <rtd2@xtra.co.nz>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	kraxel@cs.tu-berlin.de,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"mad skateman" <madskateman@gmail.com>,
	airlied@gmail.com, deller@gmx.de
Subject: Re: Fbdev issue after the drm updates 'drm-next-2023-10-31-1'
Date: Mon, 13 Nov 2023 13:48:33 +0100	[thread overview]
Message-ID: <CAMuHMdU-8Fu55C2zu_XxmG8n5paOQYfqNA84JNvXo4c87D-kFw@mail.gmail.com> (raw)
In-Reply-To: <6530cea3-4507-454e-bc36-a6970c8e7578@xenosoft.de>

Hi Christian,

On Sun, Nov 12, 2023 at 3:23 PM Christian Zigotzky
<chzigotzky@xenosoft.de> wrote:
> On 07 November 2023 at 09:36 am, Christian Zigotzky wrote:
> > I have found out that fbdev no longer works with virtio-gpu-pci and
> > virtio-vga. It is not a problem with the penguin logos.
> >
> > Could you please check fbdev in QEMU virtual machines with
> > virtio-gpu-pci and virtio-vga graphics?
>
> > On 02 November 2023 at 03:45 pm, Christian Zigotzky wrote:
> >> There is a fbdev issue with the virtio-gpu-pci and virtio-vga. (The
> >> penguins are not displayed at boot time)
> >>
> >> Error message:  [    0.889302] virtio-pci 0000:00:02.0: [drm] *ERROR*
> >> fbdev: Failed to setup generic emulation (ret=-2)
> >>
> >> The kernel 6.6 final doesn't have this issue.
> >>
> >> Please check the fbdev changes in the drm updates
> >> 'drm-next-2023-10-31-1'.

Thanks for your report!

I can confirm there is no graphics output with m68k/virt, and
bisected this to my own commit 6ae2ff23aa43a0c4 ("drm/client: Convert
drm_client_buffer_addfb() to drm_mode_addfb2()"), ouch...

It turns out the old call to drm_mode_addfb() caused a translation
from a fourcc to a bpp/depth pair to a _different_ fourcc, due to the
quirk processing in drm_driver_legacy_fb_format().
I.e. on m68k/virt, the original requested format was XR24, which was
translated to BX24. The former doesn't work, the latter works.

The following (gmail-whitespace-damaged) patch fixed the issue for me:

--- a/drivers/gpu/drm/drm_client.c
+++ b/drivers/gpu/drm/drm_client.c
@@ -400,6 +400,16 @@ static int drm_client_buffer_addfb(struct
drm_client_buffer *buffer,

        fb_req.width = width;
        fb_req.height = height;
+       if (client->dev->mode_config.quirk_addfb_prefer_host_byte_order) {
+               if (format == DRM_FORMAT_XRGB8888)
+                       format = DRM_FORMAT_HOST_XRGB8888;
+               if (format == DRM_FORMAT_ARGB8888)
+                       format = DRM_FORMAT_HOST_ARGB8888;
+               if (format == DRM_FORMAT_RGB565)
+                       format = DRM_FORMAT_HOST_RGB565;
+               if (format == DRM_FORMAT_XRGB1555)
+                       format = DRM_FORMAT_HOST_XRGB1555;
+       }
        fb_req.pixel_format = format;
        fb_req.handles[0] = handle;
        fb_req.pitches[0] = buffer->pitch;

However, I don't think we want to sprinkle more of these
translations around... So perhaps we should (re)add a call to
drm_driver_legacy_fb_format() to drm_client_buffer_addfb()?

Second, as I doubt you are using a big-endian system, you are probably
running into a slightly different issue.

Oh wait, you did CC linuxppc-dev, so perhaps you are running on a
big-endian machine?

If not, please add

    pr_info("%s: format = %p4cc\n", __func__, &format);

to drivers/gpu/drm/drm_client.c:drm_client_buffer_addfb(), and,
after reverting commit 6ae2ff23aa43a0c4, add

    pr_info("%s: bpp %u/depth %u => r.pixel_format = %p4cc\n",
__func__, or->bpp, or->depth, &r.pixel_format);

to drivers/gpu/drm/drm_framebuffer.c:drm_mode_addfb(), so we know the
translation in your case?

Thanks!

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

WARNING: multiple messages have this Message-ID (diff)
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Christian Zigotzky <chzigotzky@xenosoft.de>
Cc: "Darren Stevens" <darren@stevens-zone.net>,
	"R.T.Dickinson" <rtd2@xtra.co.nz>,
	"Thomas Zimmermann" <tzimmermann@suse.de>,
	kraxel@cs.tu-berlin.de,
	linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
	"Michel Dänzer" <michel@daenzer.net>,
	"Maling list - DRI developers" <dri-devel@lists.freedesktop.org>,
	"mad skateman" <madskateman@gmail.com>,
	deller@gmx.de
Subject: Re: Fbdev issue after the drm updates 'drm-next-2023-10-31-1'
Date: Mon, 13 Nov 2023 13:48:33 +0100	[thread overview]
Message-ID: <CAMuHMdU-8Fu55C2zu_XxmG8n5paOQYfqNA84JNvXo4c87D-kFw@mail.gmail.com> (raw)
In-Reply-To: <6530cea3-4507-454e-bc36-a6970c8e7578@xenosoft.de>

Hi Christian,

On Sun, Nov 12, 2023 at 3:23 PM Christian Zigotzky
<chzigotzky@xenosoft.de> wrote:
> On 07 November 2023 at 09:36 am, Christian Zigotzky wrote:
> > I have found out that fbdev no longer works with virtio-gpu-pci and
> > virtio-vga. It is not a problem with the penguin logos.
> >
> > Could you please check fbdev in QEMU virtual machines with
> > virtio-gpu-pci and virtio-vga graphics?
>
> > On 02 November 2023 at 03:45 pm, Christian Zigotzky wrote:
> >> There is a fbdev issue with the virtio-gpu-pci and virtio-vga. (The
> >> penguins are not displayed at boot time)
> >>
> >> Error message:  [    0.889302] virtio-pci 0000:00:02.0: [drm] *ERROR*
> >> fbdev: Failed to setup generic emulation (ret=-2)
> >>
> >> The kernel 6.6 final doesn't have this issue.
> >>
> >> Please check the fbdev changes in the drm updates
> >> 'drm-next-2023-10-31-1'.

Thanks for your report!

I can confirm there is no graphics output with m68k/virt, and
bisected this to my own commit 6ae2ff23aa43a0c4 ("drm/client: Convert
drm_client_buffer_addfb() to drm_mode_addfb2()"), ouch...

It turns out the old call to drm_mode_addfb() caused a translation
from a fourcc to a bpp/depth pair to a _different_ fourcc, due to the
quirk processing in drm_driver_legacy_fb_format().
I.e. on m68k/virt, the original requested format was XR24, which was
translated to BX24. The former doesn't work, the latter works.

The following (gmail-whitespace-damaged) patch fixed the issue for me:

--- a/drivers/gpu/drm/drm_client.c
+++ b/drivers/gpu/drm/drm_client.c
@@ -400,6 +400,16 @@ static int drm_client_buffer_addfb(struct
drm_client_buffer *buffer,

        fb_req.width = width;
        fb_req.height = height;
+       if (client->dev->mode_config.quirk_addfb_prefer_host_byte_order) {
+               if (format == DRM_FORMAT_XRGB8888)
+                       format = DRM_FORMAT_HOST_XRGB8888;
+               if (format == DRM_FORMAT_ARGB8888)
+                       format = DRM_FORMAT_HOST_ARGB8888;
+               if (format == DRM_FORMAT_RGB565)
+                       format = DRM_FORMAT_HOST_RGB565;
+               if (format == DRM_FORMAT_XRGB1555)
+                       format = DRM_FORMAT_HOST_XRGB1555;
+       }
        fb_req.pixel_format = format;
        fb_req.handles[0] = handle;
        fb_req.pitches[0] = buffer->pitch;

However, I don't think we want to sprinkle more of these
translations around... So perhaps we should (re)add a call to
drm_driver_legacy_fb_format() to drm_client_buffer_addfb()?

Second, as I doubt you are using a big-endian system, you are probably
running into a slightly different issue.

Oh wait, you did CC linuxppc-dev, so perhaps you are running on a
big-endian machine?

If not, please add

    pr_info("%s: format = %p4cc\n", __func__, &format);

to drivers/gpu/drm/drm_client.c:drm_client_buffer_addfb(), and,
after reverting commit 6ae2ff23aa43a0c4, add

    pr_info("%s: bpp %u/depth %u => r.pixel_format = %p4cc\n",
__func__, or->bpp, or->depth, &r.pixel_format);

to drivers/gpu/drm/drm_framebuffer.c:drm_mode_addfb(), so we know the
translation in your case?

Thanks!

Gr{oetje,eeting}s,

                        Geert


--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

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

  reply	other threads:[~2023-11-13 12:49 UTC|newest]

Thread overview: 137+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-30 11:59 Radeon NI: GIT kernel with the nislands_smc commit doesn't boot on a Freescale P5040 board and P.A.Semi Nemo board Christian Zigotzky
2021-04-30 11:59 ` Christian Zigotzky
2021-04-30 15:26 ` Deucher, Alexander
2021-04-30 15:26   ` Deucher, Alexander
2021-04-30 15:26   ` Deucher, Alexander
2021-04-30 15:56   ` Gustavo A. R. Silva
2021-04-30 15:56     ` Gustavo A. R. Silva
2021-04-30 15:56     ` Gustavo A. R. Silva
2021-05-03 22:25 ` [FSL P50x0] Xorg always restarts again and again after the the PowerPC updates 5.13-1 Christian Zigotzky
2021-05-04  4:56   ` Christophe Leroy
2021-05-04  7:21     ` Christian Zigotzky
2021-05-04  7:47       ` Christophe Leroy
2021-05-04  8:29         ` Christian Zigotzky
2021-05-04  8:58           ` Christophe Leroy
2021-05-04  9:09             ` Christian Zigotzky
2021-05-04  9:11               ` Christophe Leroy
2021-05-04  9:46                 ` Christian Zigotzky
2021-05-04  9:49                   ` Christophe Leroy
2021-05-04 10:07                     ` Christian Zigotzky
2021-05-04 11:02                       ` Christian Zigotzky
2021-05-04 13:48                         ` Christian Zigotzky
2021-05-04 14:48                           ` Christophe Leroy
2021-05-04 14:52                             ` Christian Zigotzky
2021-05-04 14:41                         ` Christophe Leroy
2021-05-04 14:59                           ` Christian Zigotzky
2021-05-04 15:17                             ` Christophe Leroy
2021-05-05 12:43                               ` Christian Zigotzky
2021-05-06  6:12                                 ` Christophe Leroy
2021-05-06  7:56                                   ` Christian Zigotzky
2021-05-06  8:09                                     ` Christophe Leroy
2021-05-06 13:58                                       ` Christian Zigotzky
2021-05-08 16:39                                         ` Christian Zigotzky
2021-05-09 12:27                                           ` Christian Zigotzky
2021-05-09 17:43                                             ` Christophe Leroy
2021-05-09 21:46                                               ` Christian Zigotzky
2021-05-09 17:36                                           ` Christophe Leroy
2021-05-13  6:47                                             ` Christian Zigotzky
2021-05-13 10:01                                               ` Christophe Leroy
2021-05-13 15:19                                                 ` Christian Zigotzky
2021-05-13 15:51                                                   ` Christophe Leroy
2021-05-13 16:35                                                     ` Christian Zigotzky
2021-05-13 17:00                                                       ` Christophe Leroy
2021-05-13 20:20                                                         ` Christian Zigotzky
2021-05-13 22:58                                                           ` Nicholas Piggin
2021-05-14  0:19                                                             ` Christian Zigotzky
2021-05-04 14:44                   ` Christophe Leroy
2021-05-06 23:55 ` Radeon NI: GIT kernel with the nislands_smc commit doesn't boot on a Freescale P5040 board and P.A.Semi Nemo board Gustavo A. R. Silva
2021-05-06 23:55   ` Gustavo A. R. Silva
2021-05-07  6:43   ` Christian Zigotzky
2021-05-07  6:43     ` Christian Zigotzky
2021-05-08 11:33     ` Christian Zigotzky
2021-05-08 11:33       ` Christian Zigotzky
2021-05-09 23:04       ` Gustavo A. R. Silva
2021-05-09 23:04         ` Gustavo A. R. Silva
2023-11-02 14:45       ` Fbdev issue after the drm updates 'drm-next-2023-10-31-1' Christian Zigotzky
2023-11-07  8:36         ` Christian Zigotzky
2023-11-12 14:23           ` Christian Zigotzky
2023-11-13 12:48             ` Geert Uytterhoeven [this message]
2023-11-13 12:48               ` Geert Uytterhoeven
2023-11-13 13:12               ` Christian Zigotzky
2023-11-13 13:12                 ` Christian Zigotzky
2023-11-14  9:45               ` Christian Zigotzky
2023-11-14  9:45                 ` Christian Zigotzky
2023-11-15  8:33                 ` Geert Uytterhoeven
2023-11-15  8:33                   ` Geert Uytterhoeven
2023-11-15  8:33                   ` Geert Uytterhoeven
2023-11-15  9:22                   ` Gerd Hoffmann
2023-11-15  9:22                     ` Gerd Hoffmann
2023-11-15  9:22                     ` Gerd Hoffmann
2023-11-16 13:13                     ` Geert Uytterhoeven
2023-11-16 13:13                       ` Geert Uytterhoeven
2023-11-16 13:13                       ` Geert Uytterhoeven
2021-11-04 10:45 ` [VirtIO GPU] Xorg doesn't start with the DRM updates 'drm-next-2021-11-03' in a virtual e5500 QEMU KVM-HV machine on a Freescale P5040 board Christian Zigotzky
2021-11-04 21:42   ` [PATCH] drm/virtio: Fix NULL dereference error in virtio_gpu_poll Vivek Kasireddy
2021-11-05 18:05     ` Christian Zigotzky
2021-11-05 18:05       ` Christian Zigotzky
2021-11-08 12:56     ` Gerd Hoffmann
2021-11-08 14:48   ` [FSL P50x0] Cyrus+ board doesn't boot with the PowerPC updates 5.16-1 Christian Zigotzky
2021-11-09 14:45     ` [PASEMI] Nemo board doesn't recognize any ATA disks with the pci-v5.16 updates Christian Zigotzky
2021-11-09 15:10       ` Christian Zigotzky
2021-11-09 15:10         ` Christian Zigotzky
2021-11-09 16:58         ` Bjorn Helgaas
2021-11-09 16:58           ` Bjorn Helgaas
2021-11-09 22:40           ` Krzysztof Wilczyński
2021-11-09 22:40             ` Krzysztof Wilczyński
2021-11-09 23:05             ` Arnd Bergmann
2021-11-09 23:05               ` Arnd Bergmann
2021-11-09 23:18               ` Krzysztof Wilczyński
2021-11-09 23:18                 ` Krzysztof Wilczyński
2021-11-10 16:42                 ` Robert Święcki
2021-11-10 16:42                   ` Robert Święcki
2021-11-10  3:52             ` Damien Le Moal
2021-11-10  3:52               ` Damien Le Moal
2021-11-10 18:07       ` Christian Zigotzky
2021-11-10 18:07         ` Christian Zigotzky
2021-11-10 18:41         ` Bjorn Helgaas
2021-11-10 18:41           ` Bjorn Helgaas
2021-11-10 19:09           ` Marc Zyngier
2021-11-10 19:09             ` Marc Zyngier
2021-11-11  5:24             ` Christian Zigotzky
2021-11-11  5:24               ` Christian Zigotzky
2021-11-11  7:13               ` Marc Zyngier
2021-11-11  7:13                 ` Marc Zyngier
2021-11-11  7:47                 ` Christian Zigotzky
2021-11-11  7:47                   ` Christian Zigotzky
2021-11-11 10:20                   ` Marc Zyngier
2021-11-11 10:20                     ` Marc Zyngier
2021-11-11 10:44                     ` Christian Zigotzky
2021-11-11 10:44                       ` Christian Zigotzky
2021-11-11 11:24                       ` Marc Zyngier
2021-11-11 11:24                         ` Marc Zyngier
2021-11-11 11:54                         ` Christian Zigotzky
2021-11-11 11:54                           ` Christian Zigotzky
2021-11-11 22:21                     ` Olof Johansson
2021-11-11 22:21                       ` Olof Johansson
2021-11-12 11:49                       ` Segher Boessenkool
2021-11-12 11:49                         ` Segher Boessenkool
2021-11-11 17:39         ` Marc Zyngier
2021-11-11 17:39           ` Marc Zyngier
2021-11-12  9:40           ` Christian Zigotzky
2021-11-12  9:40             ` Christian Zigotzky
2021-11-12 10:11             ` Christian Zigotzky
2021-11-12 10:11               ` Christian Zigotzky
2021-11-12 11:00               ` Christian Zigotzky
2021-11-12 11:00                 ` Christian Zigotzky
2021-11-12 13:41             ` Marc Zyngier
2021-11-12 13:41               ` Marc Zyngier
2021-11-12 14:15               ` Christian Zigotzky
2021-11-12 14:15                 ` Christian Zigotzky
2021-11-12 14:46                 ` Marc Zyngier
2021-11-12 14:46                   ` Marc Zyngier
2021-11-12 15:01                   ` Christian Zigotzky
2021-11-12 15:01                     ` Christian Zigotzky
2021-11-12 15:05                     ` Christian Zigotzky
2021-11-12 15:05                       ` Christian Zigotzky
2021-11-12 16:14         ` [irqchip: irq/irqchip-fixes] of/irq: Don't ignore interrupt-controller when interrupt-map failed irqchip-bot for Marc Zyngier
2021-11-09 16:13     ` [FSL P50x0] Cyrus+ board doesn't boot with the PowerPC updates 5.16-1 Christophe Leroy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMuHMdU-8Fu55C2zu_XxmG8n5paOQYfqNA84JNvXo4c87D-kFw@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=airlied@gmail.com \
    --cc=chzigotzky@xenosoft.de \
    --cc=darren@stevens-zone.net \
    --cc=deller@gmx.de \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=kraxel@cs.tu-berlin.de \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=madskateman@gmail.com \
    --cc=michel@daenzer.net \
    --cc=rtd2@xtra.co.nz \
    --cc=tzimmermann@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.