[PATCH] hw/display/bcm2835_fb: Fix framebuffer allocation address

alanjian85 posted 1 patch 1 year, 9 months ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20220723111228.8611-1-alanjian85@outlook.com
Maintainers: Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <f4bug@amsat.org>
There is a newer version of this series
hw/display/bcm2835_fb.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
[PATCH] hw/display/bcm2835_fb: Fix framebuffer allocation address
Posted by alanjian85 1 year, 9 months ago
This patch fixes the dedicated framebuffer mailbox interface(marked as
deprecated in official docs, but can still be fixed for emulation purposes)
by removing unneeded offset to make it works like buffer allocate tag in
bcm2835_property interface[1], some baremetal applications like the
Screen01/Screen02 examples from Baking Pi tutorial[2] didn't work
before this patch.

[1] https://github.com/qemu/qemu/blob/master/hw/misc/bcm2835_property.c#L158
[2] https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen01.html

Signed-off-by: alanjian85 <alanjian85@outlook.com>
---
 hw/display/bcm2835_fb.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c
index 088fc3d51c..a05277674f 100644
--- a/hw/display/bcm2835_fb.c
+++ b/hw/display/bcm2835_fb.c
@@ -279,8 +279,7 @@ static void bcm2835_fb_mbox_push(BCM2835FBState *s, uint32_t value)
     newconf.xoffset = ldl_le_phys(&s->dma_as, value + 24);
     newconf.yoffset = ldl_le_phys(&s->dma_as, value + 28);
 
-    newconf.base = s->vcram_base | (value & 0xc0000000);
-    newconf.base += BCM2835_FB_OFFSET;
+    newconf.base = s->vcram_base + BCM2835_FB_OFFSET;
 
     /* Copy fields which we don't want to change from the existing config */
     newconf.pixo = s->config.pixo;
-- 
2.34.1
Re: [PATCH] hw/display/bcm2835_fb: Fix framebuffer allocation address
Posted by Peter Maydell 1 year, 9 months ago
On Sat, 23 Jul 2022 at 12:15, alanjian85 <alanjian85@gmail.com> wrote:
>
> This patch fixes the dedicated framebuffer mailbox interface(marked as
> deprecated in official docs, but can still be fixed for emulation purposes)
> by removing unneeded offset to make it works like buffer allocate tag in
> bcm2835_property interface[1], some baremetal applications like the
> Screen01/Screen02 examples from Baking Pi tutorial[2] didn't work
> before this patch.
>
> [1] https://github.com/qemu/qemu/blob/master/hw/misc/bcm2835_property.c#L158
> [2] https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen01.html
>
> Signed-off-by: alanjian85 <alanjian85@outlook.com>

Thanks for this patch. Our submission rules require a full
personal name in the Signed-off-by line, not just a username.
We can't take the patch without this, I'm afraid.

> ---
>  hw/display/bcm2835_fb.c | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)

Is there any difference between this patch and the one you
sent a few days previously?

https://patchew.org/QEMU/20220721081544.38228-1-alanjian85@outlook.com/

Generally if you're sending an updated version of patch it's helpful
to mark it as "[PATCH v2]" or whatever, and to include a note below
the '---' line that says what the changes are.

thanks
-- PMM