aboutsummaryrefslogtreecommitdiff
path: root/hw/display/bcm2835_fb.c
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
commit193100b571755023690787bcb1ebc91fcc03ed50 (patch)
tree475f8418482a816f2c6f06f352d26e991501d958 /hw/display/bcm2835_fb.c
parenta02755ece0c0652480ed9d9f2f0355fdc3632fdb (diff)
hw/misc/bcm2835_property: Track fb settings using BCM2835FBConfig
Refactor the fb property setting code so that rather than using a set of pointers to local variables to track whether a config value has been updated in the current mbox and if so what its new value is, we just copy all the current settings of the fb at the start, and then update that copy as we go along, before asking the fb to switch to it at the end. Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20180814144436.679-3-peter.maydell@linaro.org
Diffstat (limited to 'hw/display/bcm2835_fb.c')
-rw-r--r--hw/display/bcm2835_fb.c27
1 files changed, 3 insertions, 24 deletions
diff --git a/hw/display/bcm2835_fb.c b/hw/display/bcm2835_fb.c
index 0ffad49ab8..8155de5d0b 100644
--- a/hw/display/bcm2835_fb.c
+++ b/hw/display/bcm2835_fb.c
@@ -213,34 +213,13 @@ static void bcm2835_fb_mbox_push(BCM2835FBState *s, uint32_t value)
s->lock = false;
}
-void bcm2835_fb_reconfigure(BCM2835FBState *s, uint32_t *xres, uint32_t *yres,
- uint32_t *xoffset, uint32_t *yoffset, uint32_t *bpp,
- uint32_t *pixo, uint32_t *alpha)
+void bcm2835_fb_reconfigure(BCM2835FBState *s, BCM2835FBConfig *newconfig)
{
s->lock = true;
/* TODO: input validation! */
- if (xres) {
- s->config.xres = *xres;
- }
- if (yres) {
- s->config.yres = *yres;
- }
- if (xoffset) {
- s->config.xoffset = *xoffset;
- }
- if (yoffset) {
- s->config.yoffset = *yoffset;
- }
- if (bpp) {
- s->config.bpp = *bpp;
- }
- if (pixo) {
- s->config.pixo = *pixo;
- }
- if (alpha) {
- s->config.alpha = *alpha;
- }
+
+ s->config = *newconfig;
/* TODO - Manage properly virtual resolution */