hw/misc/bcm2835_fb: Move config fields to their own struct
[qemu.git] / include / hw / display / bcm2835_fb.h
blob8485825ba5feb96b743eb11ee89a3035f81458ac
1 /*
2 * Raspberry Pi emulation (c) 2012 Gregory Estrade
3 * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous
5 * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft
6 * Written by Andrew Baumann
8 * This code is licensed under the GNU GPLv2 and later.
9 */
11 #ifndef BCM2835_FB_H
12 #define BCM2835_FB_H
14 #include "hw/sysbus.h"
15 #include "ui/console.h"
17 #define TYPE_BCM2835_FB "bcm2835-fb"
18 #define BCM2835_FB(obj) OBJECT_CHECK(BCM2835FBState, (obj), TYPE_BCM2835_FB)
21 * Configuration information about the fb which the guest can program
22 * via the mailbox property interface.
24 typedef struct {
25 uint32_t xres, yres;
26 uint32_t xres_virtual, yres_virtual;
27 uint32_t xoffset, yoffset;
28 uint32_t bpp;
29 uint32_t base;
30 uint32_t pixo;
31 uint32_t alpha;
32 } BCM2835FBConfig;
34 typedef struct {
35 /*< private >*/
36 SysBusDevice busdev;
37 /*< public >*/
39 uint32_t vcram_base, vcram_size;
40 MemoryRegion *dma_mr;
41 AddressSpace dma_as;
42 MemoryRegion iomem;
43 MemoryRegionSection fbsection;
44 QemuConsole *con;
45 qemu_irq mbox_irq;
47 bool lock, invalidate, pending;
49 BCM2835FBConfig config;
51 /* These are just cached values calculated from the config settings */
52 uint32_t size;
53 uint32_t pitch;
54 } BCM2835FBState;
56 void bcm2835_fb_reconfigure(BCM2835FBState *s, uint32_t *xres, uint32_t *yres,
57 uint32_t *xoffset, uint32_t *yoffset, uint32_t *bpp,
58 uint32_t *pixo, uint32_t *alpha);
60 #endif