1 /* 2 * Raspberry Pi emulation (c) 2012 Gregory Estrade 3 * Upstreaming code cleanup [including bcm2835_*] (c) 2013 Jan Petrous 4 * 5 * Rasperry Pi 2 emulation and refactoring Copyright (c) 2015, Microsoft 6 * Written by Andrew Baumann 7 * 8 * This code is licensed under the GNU GPLv2 and later. 9 */ 10 11 #ifndef BCM2835_FB_H 12 #define BCM2835_FB_H 13 14 #include "hw/sysbus.h" 15 #include "ui/console.h" 16 17 #define TYPE_BCM2835_FB "bcm2835-fb" 18 #define BCM2835_FB(obj) OBJECT_CHECK(BCM2835FBState, (obj), TYPE_BCM2835_FB) 19 20 typedef struct { 21 /*< private >*/ 22 SysBusDevice busdev; 23 /*< public >*/ 24 25 uint32_t vcram_base, vcram_size; 26 MemoryRegion *dma_mr; 27 AddressSpace dma_as; 28 MemoryRegion iomem; 29 MemoryRegionSection fbsection; 30 QemuConsole *con; 31 qemu_irq mbox_irq; 32 33 bool lock, invalidate, pending; 34 uint32_t xres, yres; 35 uint32_t xres_virtual, yres_virtual; 36 uint32_t xoffset, yoffset; 37 uint32_t bpp; 38 uint32_t base, pitch, size; 39 uint32_t pixo, alpha; 40 } BCM2835FBState; 41 42 void bcm2835_fb_reconfigure(BCM2835FBState *s, uint32_t *xres, uint32_t *yres, 43 uint32_t *xoffset, uint32_t *yoffset, uint32_t *bpp, 44 uint32_t *pixo, uint32_t *alpha); 45 46 #endif 47