aboutsummaryrefslogtreecommitdiff
path: root/include/hw/display
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2018-08-24 13:17:48 +0100
committerPeter Maydell <peter.maydell@linaro.org>2018-08-24 13:17:48 +0100
commita02755ece0c0652480ed9d9f2f0355fdc3632fdb (patch)
treecb1b48f435e3a8d8e1060913ef0f3a759499086c /include/hw/display
parent6e0fafe2ef02378c696e7cf84ef41511e3b3b81a (diff)
hw/misc/bcm2835_fb: Move config fields to their own struct
The handling of framebuffer properties in the bcm2835_property code is a bit clumsy, because for each of the many fb related properties we try to track the value we're about to set and whether we're going to be setting a value, and then we hand all the new values off to the framebuffer via a function which takes them all as separate arguments. It would be simpler if the property code could easily copy all the framebuffer's current settings, update them with the new specified values and then ask the framebuffer to switch to the new set. As the first part of this refactoring, pull all the fb config settings fields in BCM2835FBState out into their own struct. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180814144436.679-2-peter.maydell@linaro.org
Diffstat (limited to 'include/hw/display')
-rw-r--r--include/hw/display/bcm2835_fb.h26
1 files changed, 20 insertions, 6 deletions
diff --git a/include/hw/display/bcm2835_fb.h b/include/hw/display/bcm2835_fb.h
index ae0a3807f2..8485825ba5 100644
--- a/include/hw/display/bcm2835_fb.h
+++ b/include/hw/display/bcm2835_fb.h
@@ -17,6 +17,20 @@
#define TYPE_BCM2835_FB "bcm2835-fb"
#define BCM2835_FB(obj) OBJECT_CHECK(BCM2835FBState, (obj), TYPE_BCM2835_FB)
+/*
+ * Configuration information about the fb which the guest can program
+ * via the mailbox property interface.
+ */
+typedef struct {
+ uint32_t xres, yres;
+ uint32_t xres_virtual, yres_virtual;
+ uint32_t xoffset, yoffset;
+ uint32_t bpp;
+ uint32_t base;
+ uint32_t pixo;
+ uint32_t alpha;
+} BCM2835FBConfig;
+
typedef struct {
/*< private >*/
SysBusDevice busdev;
@@ -31,12 +45,12 @@ typedef struct {
qemu_irq mbox_irq;
bool lock, invalidate, pending;
- uint32_t xres, yres;
- uint32_t xres_virtual, yres_virtual;
- uint32_t xoffset, yoffset;
- uint32_t bpp;
- uint32_t base, pitch, size;
- uint32_t pixo, alpha;
+
+ BCM2835FBConfig config;
+
+ /* These are just cached values calculated from the config settings */
+ uint32_t size;
+ uint32_t pitch;
} BCM2835FBState;
void bcm2835_fb_reconfigure(BCM2835FBState *s, uint32_t *xres, uint32_t *yres,