mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-04 16:23:55 -06:00
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
This commit is contained in:
parent
6e0fafe2ef
commit
a02755ece0
3 changed files with 94 additions and 74 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue