diff options
author | Alan Jian <alanjian85@gmail.com> | 2022-07-25 22:58:39 +0800 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2022-07-26 14:09:44 +0100 |
commit | 5865d99fe88d8c8fa437c18c6b63fb2a8165634f (patch) | |
tree | 49894f0f78a29ada64fca2b629a7fa652a48feef /hw/display | |
parent | c5cfdabaf5ba0963292d3f0e318170ae9fab3fcc (diff) | |
download | qemu-5865d99fe88d8c8fa437c18c6b63fb2a8165634f.zip qemu-5865d99fe88d8c8fa437c18c6b63fb2a8165634f.tar.gz qemu-5865d99fe88d8c8fa437c18c6b63fb2a8165634f.tar.bz2 |
hw/display/bcm2835_fb: Fix framebuffer allocation address
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>
Diffstat (limited to 'hw/display')
-rw-r--r-- | hw/display/bcm2835_fb.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c index 088fc3d..a052776 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; |