All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Maydell <peter.maydell@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 9/9] hw/display/bcm2835_fb: Fix framebuffer allocation address
Date: Tue, 26 Jul 2022 16:20:12 +0100	[thread overview]
Message-ID: <20220726152012.1631158-10-peter.maydell@linaro.org> (raw)
In-Reply-To: <20220726152012.1631158-1-peter.maydell@linaro.org>

From: Alan Jian <alanjian85@gmail.com>

This patch fixes the dedicated framebuffer mailbox interface by
removing an unneeded offset.  This means that we pick the framebuffer
address in the same way that we do if the guest code uses the buffer
allocate mechanism of the bcm2835_property interface (case
0x00040001: /* Allocate buffer */ in bcm2835_property.c).

The documentation of this mailbox interface doesn't say anything
about using parts of the request buffer address to affect the
chosen framebuffer address:
https://github.com/raspberrypi/firmware/wiki/Mailbox-framebuffer-interface

Some baremetal applications like the Screen01/Screen02 examples from
Baking Pi tutorial[1] didn't work before this patch.

[1] https://www.cl.cam.ac.uk/projects/raspberrypi/tutorials/os/screen01.html

Signed-off-by: Alan Jian <alanjian85@outlook.com>
Message-id: 20220725145838.8412-1-alanjian85@outlook.com
[PMM: tweaked commit message]
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 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 088fc3d51c5..a05277674f2 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.25.1



  parent reply	other threads:[~2022-07-26 15:26 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-26 15:20 [PULL 0/9] target-arm queue Peter Maydell
2022-07-26 15:20 ` [PULL 1/9] scripts/coverity-scan/COMPONENTS.md: Add loongarch component Peter Maydell
2022-07-26 15:20 ` [PULL 2/9] scripts/coverity-scan/COMPONENTS.md: Update slirp component info Peter Maydell
2022-07-26 15:20 ` [PULL 3/9] target/arm: Add MO_128 entry to pred_esz_masks[] Peter Maydell
2022-07-26 15:20 ` [PULL 4/9] configure: Add missing POSIX-required space Peter Maydell
2022-07-26 15:20 ` [PULL 5/9] configure: Add braces to clarify intent of $emu[[:space:]] Peter Maydell
2022-07-26 15:20 ` [PULL 6/9] configure: Don't use bash-specific string-replacement syntax Peter Maydell
2022-07-26 15:20 ` [PULL 7/9] configure: Drop dead code attempting to use -msmall-data on alpha hosts Peter Maydell
2022-07-26 15:20 ` [PULL 8/9] configure: Avoid '==' bashism Peter Maydell
2022-07-26 15:20 ` Peter Maydell [this message]
2022-07-26 18:36 ` [PULL 0/9] target-arm queue Richard Henderson

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=20220726152012.1631158-10-peter.maydell@linaro.org \
    --to=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    /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.