From 9a1f03f4ee207d58674fc76aecff546551c9da76 Mon Sep 17 00:00:00 2001 From: Peter Maydell Date: Fri, 24 Aug 2018 13:17:49 +0100 Subject: hw/display/bcm2835_fb: Abstract out calculation of pitch, size Abstract out the calculation of the pitch and size of the framebuffer into functions that operate on the BCM2835FBConfig struct -- these are about to get a little more complicated when we add support for virtual and physical sizes differing. Signed-off-by: Peter Maydell Reviewed-by: Richard Henderson Message-id: 20180814144436.679-6-peter.maydell@linaro.org --- hw/misc/bcm2835_property.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'hw/misc') diff --git a/hw/misc/bcm2835_property.c b/hw/misc/bcm2835_property.c index df0645d1b8..c8c4979bd2 100644 --- a/hw/misc/bcm2835_property.c +++ b/hw/misc/bcm2835_property.c @@ -146,7 +146,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) case 0x00040001: /* Allocate buffer */ stl_le_phys(&s->dma_as, value + 12, fbconfig.base); stl_le_phys(&s->dma_as, value + 16, - fbconfig.xres * fbconfig.yres * fbconfig.bpp / 8); + bcm2835_fb_get_size(&fbconfig)); resplen = 8; break; case 0x00048001: /* Release buffer */ @@ -210,7 +210,7 @@ static void bcm2835_property_mbox_push(BCM2835PropertyState *s, uint32_t value) break; case 0x00040008: /* Get pitch */ stl_le_phys(&s->dma_as, value + 12, - fbconfig.xres * fbconfig.bpp / 8); + bcm2835_fb_get_pitch(&fbconfig)); resplen = 4; break; case 0x00040009: /* Get virtual offset */ -- cgit v1.2.3