qemu-arm
[Top][All Lists]
Advanced

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

Re: [PATCH 1/2] hw/misc/bcm2835_property: Fix framebuffer with recent RP


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH 1/2] hw/misc/bcm2835_property: Fix framebuffer with recent RPi kernels
Date: Sun, 17 Oct 2021 17:08:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0

Hi Benjamin,

On 10/17/21 09:48, Benjamin Herrenschmidt wrote:
> The framebuffer driver fails to initialize with recent Raspberry Pi
> kernels, such as the ones shipped in the current RaspiOS images
> (with the out of tree bcm2708_fb.c driver)

Which particular version?

> 
> The reason is that this driver uses a new firmware call to query the
> number of displays, and the fallback when this call fails is broken.
> 
> So implement the call and claim we have exactly one display
> 
> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
> ---
>  hw/misc/bcm2835_property.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
> index 73941bdae9..b958fa6a5c 100644
> --- a/hw/misc/bcm2835_property.c
> +++ b/hw/misc/bcm2835_property.c
> @@ -269,6 +269,10 @@ static void 
> bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
>              stl_le_phys(&s->dma_as, value + 12, 0);
>              resplen = 4;
>              break;
> +        case 0x00040013: /* Get num displays */
> +            stl_le_phys(&s->dma_as, value + 12, 1);
> +            resplen = 4;
> +            break;
>  
>          case 0x00060001: /* Get DMA channels */
>              /* channels 2-5 */
> 

I carry (among others) this patch for the raspi4:

-- >8 --
diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c
index 3b3f5a804d9..8bd149211af 100644
--- a/hw/misc/bcm2835_property.c
+++ b/hw/misc/bcm2835_property.c
@@ -36,6 +36,7 @@ static void
bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
      */
     BCM2835FBConfig fbconfig = s->fbdev->config;
     bool fbconfig_updated = false;
+    int fbconfig_idx = 0;

     value &= ~0xf;

@@ -290,6 +291,25 @@ static void
bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value)
             resplen = 4;
             break;

+        case 0x00040013: /* Get number of displays */
+            stl_le_phys(&s->dma_as, value + 12, 0 /* old fw: unique
display */);
+            resplen = 4;
+            break;
+
+        case 0x00048013: /* Select display  */
+            fbconfig_idx = ldl_le_phys(&s->dma_as, value + 12);
+            if (fbconfig_idx) {
+                qemu_log_mask(LOG_GUEST_ERROR,
+                              "bcm2835_property: Only one display
implemented,"
+                              " requested display #%d\n", fbconfig_idx);
+            }
+            resplen = 4;
+            break;
+
+        case 0x00040014: /* Get display settings */
+            resplen = 0; /* as old fw we don't support that */
+            break;
+
         case 0x00060001: /* Get DMA channels */
             /* channels 2-5 */
             stl_le_phys(&s->dma_as, value + 12, 0x003C);
---

FYI I plan to respin Alex's recent series with these patches:
20211004134742.2044280-1-alex.bennee@linaro.org/">https://lore.kernel.org/qemu-devel/20211004134742.2044280-1-alex.bennee@linaro.org/
as soon as I get some time...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]