[PATCH] hw/arm/bcm2835_property: Add support for RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS

Enrik Berkhan posted 1 patch 3 years, 5 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220812143519.59134-1-Enrik.Berkhan@inka.de
Maintainers: Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
hw/misc/bcm2835_property.c | 4 ++++
1 file changed, 4 insertions(+)
[PATCH] hw/arm/bcm2835_property: Add support for RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS
Posted by Enrik Berkhan 3 years, 5 months ago
In more recent Raspbian OS Linux kernels, the fb driver gives up
immediately if RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS fails or no
displays are reported.

This change simply always reports one display. It makes bcm2835_fb work
again with these more recent kernels.

Signed-off-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
---
 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 e94e951057..890ae7bae5 100644
--- a/hw/misc/bcm2835_property.c
+++ b/hw/misc/bcm2835_property.c
@@ -270,6 +270,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 number of displays */
+            stl_le_phys(&s->dma_as, value + 12, 1);
+            resplen = 4;
+            break;
 
         case 0x00060001: /* Get DMA channels */
             /* channels 2-5 */
-- 
2.34.1
Re: [PATCH] hw/arm/bcm2835_property: Add support for RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS
Posted by Richard Henderson 3 years, 5 months ago
On 8/12/22 07:35, Enrik Berkhan wrote:
> In more recent Raspbian OS Linux kernels, the fb driver gives up
> immediately if RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS fails or no
> displays are reported.
> 
> This change simply always reports one display. It makes bcm2835_fb work
> again with these more recent kernels.
> 
> Signed-off-by: Enrik Berkhan <Enrik.Berkhan@inka.de>

Thanks, queued to target-arm.next.


r~
Re: [PATCH] hw/arm/bcm2835_property: Add support for RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS
Posted by Philippe Mathieu-Daudé via 3 years, 5 months ago
On 12/8/22 16:35, Enrik Berkhan wrote:
> In more recent Raspbian OS Linux kernels, the fb driver gives up
> immediately if RPI_FIRMWARE_FRAMEBUFFER_GET_NUM_DISPLAYS fails or no
> displays are reported.
> 
> This change simply always reports one display. It makes bcm2835_fb work
> again with these more recent kernels.
> 
> Signed-off-by: Enrik Berkhan <Enrik.Berkhan@inka.de>
> ---
>   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 e94e951057..890ae7bae5 100644
> --- a/hw/misc/bcm2835_property.c
> +++ b/hw/misc/bcm2835_property.c
> @@ -270,6 +270,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 number of displays */
> +            stl_le_phys(&s->dma_as, value + 12, 1);
> +            resplen = 4;
> +            break;
>   
>           case 0x00060001: /* Get DMA channels */
>               /* channels 2-5 */

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>