summaryrefslogtreecommitdiffstats
path: root/hw/display
diff options
context:
space:
mode:
authorEduardo Habkost2020-09-03 22:43:22 +0200
committerEduardo Habkost2020-09-09 15:26:43 +0200
commitdb1015e92e04835c9eb50c29625fe566d1202dbd (patch)
tree41fbc0bf3e3f29b7ecb339224a049e3f2a7db8fa /hw/display
parentDelete duplicate QOM typedefs (diff)
downloadqemu-db1015e92e04835c9eb50c29625fe566d1202dbd.tar.gz
qemu-db1015e92e04835c9eb50c29625fe566d1202dbd.tar.xz
qemu-db1015e92e04835c9eb50c29625fe566d1202dbd.zip
Move QOM typedefs and add missing includes
Some typedefs and macros are defined after the type check macros. This makes it difficult to automatically replace their definitions with OBJECT_DECLARE_TYPE. Patch generated using: $ ./scripts/codeconverter/converter.py -i \ --pattern=QOMStructTypedefSplit $(git grep -l '' -- '*.[ch]') which will split "typdef struct { ... } TypedefName" declarations. Followed by: $ ./scripts/codeconverter/converter.py -i --pattern=MoveSymbols \ $(git grep -l '' -- '*.[ch]') which will: - move the typedefs and #defines above the type check macros - add missing #include "qom/object.h" lines if necessary Reviewed-by: Daniel P. Berrangé <berrange@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-9-ehabkost@redhat.com> Reviewed-by: Juan Quintela <quintela@redhat.com> Message-Id: <20200831210740.126168-10-ehabkost@redhat.com> Message-Id: <20200831210740.126168-11-ehabkost@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/ads7846.c6
-rw-r--r--hw/display/artist.c6
-rw-r--r--hw/display/ati_int.h6
-rw-r--r--hw/display/bochs-display.c6
-rw-r--r--hw/display/cg3.c6
-rw-r--r--hw/display/cirrus_vga.c6
-rw-r--r--hw/display/cirrus_vga_isa.c6
-rw-r--r--hw/display/exynos4210_fimd.c6
-rw-r--r--hw/display/g364fb.c6
-rw-r--r--hw/display/jazz_led.c6
-rw-r--r--hw/display/milkymist-tmu2.c3
-rw-r--r--hw/display/milkymist-vgafb.c3
-rw-r--r--hw/display/next-fb.c3
-rw-r--r--hw/display/pl110.c6
-rw-r--r--hw/display/qxl.h6
-rw-r--r--hw/display/ramfb-standalone.c6
-rw-r--r--hw/display/sii9022.c6
-rw-r--r--hw/display/sm501.c11
-rw-r--r--hw/display/ssd0303.c6
-rw-r--r--hw/display/ssd0323.c6
-rw-r--r--hw/display/tcx.c6
-rw-r--r--hw/display/vga-isa.c6
-rw-r--r--hw/display/vga-pci.c6
-rw-r--r--hw/display/vhost-user-gpu-pci.c6
-rw-r--r--hw/display/vhost-user-vga.c6
-rw-r--r--hw/display/virtio-gpu-pci.c6
-rw-r--r--hw/display/virtio-vga.c6
-rw-r--r--hw/display/virtio-vga.h11
-rw-r--r--hw/display/vmware_vga.c1
29 files changed, 113 insertions, 57 deletions
diff --git a/hw/display/ads7846.c b/hw/display/ads7846.c
index 56bf82fe07..59bbce3979 100644
--- a/hw/display/ads7846.c
+++ b/hw/display/ads7846.c
@@ -16,8 +16,9 @@
#include "migration/vmstate.h"
#include "qemu/module.h"
#include "ui/console.h"
+#include "qom/object.h"
-typedef struct {
+struct ADS7846State {
SSISlave ssidev;
qemu_irq interrupt;
@@ -27,7 +28,8 @@ typedef struct {
int cycle;
int output;
-} ADS7846State;
+};
+typedef struct ADS7846State ADS7846State;
#define TYPE_ADS7846 "ads7846"
#define ADS7846(obj) OBJECT_CHECK(ADS7846State, (obj), TYPE_ADS7846)
diff --git a/hw/display/artist.c b/hw/display/artist.c
index 955296d3d8..c030894e7b 100644
--- a/hw/display/artist.c
+++ b/hw/display/artist.c
@@ -22,8 +22,10 @@
#include "ui/console.h"
#include "trace.h"
#include "framebuffer.h"
+#include "qom/object.h"
#define TYPE_ARTIST "artist"
+typedef struct ARTISTState ARTISTState;
#define ARTIST(obj) OBJECT_CHECK(ARTISTState, (obj), TYPE_ARTIST)
#ifdef HOST_WORDS_BIGENDIAN
@@ -40,7 +42,7 @@ struct vram_buffer {
unsigned int height;
};
-typedef struct ARTISTState {
+struct ARTISTState {
SysBusDevice parent_obj;
QemuConsole *con;
@@ -103,7 +105,7 @@ typedef struct ARTISTState {
uint32_t font_write_pos_y;
int draw_line_pattern;
-} ARTISTState;
+};
typedef enum {
ARTIST_BUFFER_AP = 1,
diff --git a/hw/display/ati_int.h b/hw/display/ati_int.h
index 2a16708e4f..2a8a3306da 100644
--- a/hw/display/ati_int.h
+++ b/hw/display/ati_int.h
@@ -13,6 +13,7 @@
#include "hw/pci/pci.h"
#include "hw/i2c/bitbang_i2c.h"
#include "vga_int.h"
+#include "qom/object.h"
/*#define DEBUG_ATI*/
@@ -29,6 +30,7 @@
#define PCI_DEVICE_ID_ATI_RADEON_QY 0x5159
#define TYPE_ATI_VGA "ati-vga"
+typedef struct ATIVGAState ATIVGAState;
#define ATI_VGA(obj) OBJECT_CHECK(ATIVGAState, (obj), TYPE_ATI_VGA)
typedef struct ATIVGARegs {
@@ -82,7 +84,7 @@ typedef struct ATIVGARegs {
uint32_t default_sc_bottom_right;
} ATIVGARegs;
-typedef struct ATIVGAState {
+struct ATIVGAState {
PCIDevice dev;
VGACommonState vga;
char *model;
@@ -97,7 +99,7 @@ typedef struct ATIVGAState {
MemoryRegion io;
MemoryRegion mm;
ATIVGARegs regs;
-} ATIVGAState;
+};
const char *ati_reg_name(int num);
diff --git a/hw/display/bochs-display.c b/hw/display/bochs-display.c
index a8e8ab8325..ef92f3a4e7 100644
--- a/hw/display/bochs-display.c
+++ b/hw/display/bochs-display.c
@@ -18,6 +18,7 @@
#include "ui/console.h"
#include "ui/qemu-pixman.h"
+#include "qom/object.h"
typedef struct BochsDisplayMode {
pixman_format_code_t format;
@@ -29,7 +30,7 @@ typedef struct BochsDisplayMode {
uint64_t size;
} BochsDisplayMode;
-typedef struct BochsDisplayState {
+struct BochsDisplayState {
/* parent */
PCIDevice pci;
@@ -53,7 +54,8 @@ typedef struct BochsDisplayState {
/* device state */
BochsDisplayMode mode;
-} BochsDisplayState;
+};
+typedef struct BochsDisplayState BochsDisplayState;
#define TYPE_BOCHS_DISPLAY "bochs-display"
#define BOCHS_DISPLAY(obj) OBJECT_CHECK(BochsDisplayState, (obj), \
diff --git a/hw/display/cg3.c b/hw/display/cg3.c
index 7cbe6e56ff..49d7e777f9 100644
--- a/hw/display/cg3.c
+++ b/hw/display/cg3.c
@@ -36,6 +36,7 @@
#include "qemu/log.h"
#include "qemu/module.h"
#include "trace.h"
+#include "qom/object.h"
/* Change to 1 to enable debugging */
#define DEBUG_CG3 0
@@ -65,9 +66,10 @@
#define CG3_VRAM_OFFSET 0x800000
#define TYPE_CG3 "cgthree"
+typedef struct CG3State CG3State;
#define CG3(obj) OBJECT_CHECK(CG3State, (obj), TYPE_CG3)
-typedef struct CG3State {
+struct CG3State {
SysBusDevice parent_obj;
QemuConsole *con;
@@ -82,7 +84,7 @@ typedef struct CG3State {
uint8_t r[256], g[256], b[256];
uint16_t width, height, depth;
uint8_t dac_index, dac_state;
-} CG3State;
+};
static void cg3_update_display(void *opaque)
{
diff --git a/hw/display/cirrus_vga.c b/hw/display/cirrus_vga.c
index 41e71af08a..9602cea4cc 100644
--- a/hw/display/cirrus_vga.c
+++ b/hw/display/cirrus_vga.c
@@ -44,6 +44,7 @@
#include "migration/vmstate.h"
#include "ui/pixel_ops.h"
#include "cirrus_vga_internal.h"
+#include "qom/object.h"
/*
* TODO:
@@ -178,10 +179,11 @@ typedef void (*cirrus_fill_t)(struct CirrusVGAState *s,
uint32_t dstaddr, int dst_pitch,
int width, int height);
-typedef struct PCICirrusVGAState {
+struct PCICirrusVGAState {
PCIDevice dev;
CirrusVGAState cirrus_vga;
-} PCICirrusVGAState;
+};
+typedef struct PCICirrusVGAState PCICirrusVGAState;
#define TYPE_PCI_CIRRUS_VGA "cirrus-vga"
#define PCI_CIRRUS_VGA(obj) \
diff --git a/hw/display/cirrus_vga_isa.c b/hw/display/cirrus_vga_isa.c
index 825ba57298..28d1fa41e7 100644
--- a/hw/display/cirrus_vga_isa.c
+++ b/hw/display/cirrus_vga_isa.c
@@ -30,16 +30,18 @@
#include "hw/qdev-properties.h"
#include "hw/isa/isa.h"
#include "cirrus_vga_internal.h"
+#include "qom/object.h"
#define TYPE_ISA_CIRRUS_VGA "isa-cirrus-vga"
+typedef struct ISACirrusVGAState ISACirrusVGAState;
#define ISA_CIRRUS_VGA(obj) \
OBJECT_CHECK(ISACirrusVGAState, (obj), TYPE_ISA_CIRRUS_VGA)
-typedef struct ISACirrusVGAState {
+struct ISACirrusVGAState {
ISADevice parent_obj;
CirrusVGAState cirrus_vga;
-} ISACirrusVGAState;
+};
static void isa_cirrus_vga_realizefn(DeviceState *dev, Error **errp)
{
diff --git a/hw/display/exynos4210_fimd.c b/hw/display/exynos4210_fimd.c
index 4b7286b7c9..993b7e9dae 100644
--- a/hw/display/exynos4210_fimd.c
+++ b/hw/display/exynos4210_fimd.c
@@ -32,6 +32,7 @@
#include "qemu/bswap.h"
#include "qemu/module.h"
#include "qemu/log.h"
+#include "qom/object.h"
/* Debug messages configuration */
#define EXYNOS4210_FIMD_DEBUG 0
@@ -293,10 +294,11 @@ struct Exynos4210fimdWindow {
};
#define TYPE_EXYNOS4210_FIMD "exynos4210.fimd"
+typedef struct Exynos4210fimdState Exynos4210fimdState;
#define EXYNOS4210_FIMD(obj) \
OBJECT_CHECK(Exynos4210fimdState, (obj), TYPE_EXYNOS4210_FIMD)
-typedef struct {
+struct Exynos4210fimdState {
SysBusDevice parent_obj;
MemoryRegion iomem;
@@ -325,7 +327,7 @@ typedef struct {
uint8_t *ifb; /* Internal frame buffer */
bool invalidate; /* Image needs to be redrawn */
bool enabled; /* Display controller is enabled */
-} Exynos4210fimdState;
+};
/* Perform byte/halfword/word swap of data according to WINCON */
static inline void fimd_swap_data(unsigned int swap_ctl, uint64_t *data)
diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c
index adcba96e34..df674c3c01 100644
--- a/hw/display/g364fb.c
+++ b/hw/display/g364fb.c
@@ -29,6 +29,7 @@
#include "trace.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
+#include "qom/object.h"
typedef struct G364State {
/* hardware */
@@ -486,13 +487,14 @@ static void g364fb_init(DeviceState *dev, G364State *s)
}
#define TYPE_G364 "sysbus-g364"
+typedef struct G364SysBusState G364SysBusState;
#define G364(obj) OBJECT_CHECK(G364SysBusState, (obj), TYPE_G364)
-typedef struct {
+struct G364SysBusState {
SysBusDevice parent_obj;
G364State g364;
-} G364SysBusState;
+};
static void g364fb_sysbus_realize(DeviceState *dev, Error **errp)
{
diff --git a/hw/display/jazz_led.c b/hw/display/jazz_led.c
index 1d845597f9..97ec36878b 100644
--- a/hw/display/jazz_led.c
+++ b/hw/display/jazz_led.c
@@ -29,22 +29,24 @@
#include "trace.h"
#include "hw/sysbus.h"
#include "migration/vmstate.h"
+#include "qom/object.h"
typedef enum {
REDRAW_NONE = 0, REDRAW_SEGMENTS = 1, REDRAW_BACKGROUND = 2,
} screen_state_t;
#define TYPE_JAZZ_LED "jazz-led"
+typedef struct LedState LedState;
#define JAZZ_LED(obj) OBJECT_CHECK(LedState, (obj), TYPE_JAZZ_LED)
-typedef struct LedState {
+struct LedState {
SysBusDevice parent_obj;
MemoryRegion iomem;
uint8_t segments;
QemuConsole *con;
screen_state_t state;
-} LedState;
+};
static uint64_t jazz_led_read(void *opaque, hwaddr addr,
unsigned int size)
diff --git a/hw/display/milkymist-tmu2.c b/hw/display/milkymist-tmu2.c
index c34ef1a1bf..66cb8e6a60 100644
--- a/hw/display/milkymist-tmu2.c
+++ b/hw/display/milkymist-tmu2.c
@@ -38,6 +38,7 @@
#include <X11/Xlib.h>
#include <epoxy/gl.h>
#include <epoxy/glx.h>
+#include "qom/object.h"
enum {
R_CTL = 0,
@@ -82,6 +83,7 @@ struct vertex {
} QEMU_PACKED;
#define TYPE_MILKYMIST_TMU2 "milkymist-tmu2"
+typedef struct MilkymistTMU2State MilkymistTMU2State;
#define MILKYMIST_TMU2(obj) \
OBJECT_CHECK(MilkymistTMU2State, (obj), TYPE_MILKYMIST_TMU2)
@@ -98,7 +100,6 @@ struct MilkymistTMU2State {
GLXFBConfig glx_fb_config;
GLXContext glx_context;
};
-typedef struct MilkymistTMU2State MilkymistTMU2State;
static const int glx_fbconfig_attr[] = {
GLX_GREEN_SIZE, 5,
diff --git a/hw/display/milkymist-vgafb.c b/hw/display/milkymist-vgafb.c
index 6a6441e6ea..bbf412d9a0 100644
--- a/hw/display/milkymist-vgafb.c
+++ b/hw/display/milkymist-vgafb.c
@@ -32,6 +32,7 @@
#include "ui/pixel_ops.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "qom/object.h"
#define BITS 8
#include "migration/vmstate.h"
@@ -68,6 +69,7 @@ enum {
};
#define TYPE_MILKYMIST_VGAFB "milkymist-vgafb"
+typedef struct MilkymistVgafbState MilkymistVgafbState;
#define MILKYMIST_VGAFB(obj) \
OBJECT_CHECK(MilkymistVgafbState, (obj), TYPE_MILKYMIST_VGAFB)
@@ -84,7 +86,6 @@ struct MilkymistVgafbState {
uint32_t regs[R_MAX];
};
-typedef struct MilkymistVgafbState MilkymistVgafbState;
static int vgafb_enabled(MilkymistVgafbState *s)
{
diff --git a/hw/display/next-fb.c b/hw/display/next-fb.c
index b0513a8fba..068dc0656f 100644
--- a/hw/display/next-fb.c
+++ b/hw/display/next-fb.c
@@ -30,7 +30,9 @@
#include "framebuffer.h"
#include "ui/pixel_ops.h"
#include "hw/m68k/next-cube.h"
+#include "qom/object.h"
+typedef struct NeXTFbState NeXTFbState;
#define NEXTFB(obj) OBJECT_CHECK(NeXTFbState, (obj), TYPE_NEXTFB)
struct NeXTFbState {
@@ -44,7 +46,6 @@ struct NeXTFbState {
uint32_t rows;
int invalidate;
};
-typedef struct NeXTFbState NeXTFbState;
static void nextfb_draw_line(void *opaque, uint8_t *d, const uint8_t *s,
int width, int pitch)
diff --git a/hw/display/pl110.c b/hw/display/pl110.c
index 61fefbffb3..4cf953c2f4 100644
--- a/hw/display/pl110.c
+++ b/hw/display/pl110.c
@@ -17,6 +17,7 @@
#include "qemu/timer.h"
#include "qemu/log.h"
#include "qemu/module.h"
+#include "qom/object.h"
#define PL110_CR_EN 0x001
#define PL110_CR_BGR 0x100
@@ -48,9 +49,10 @@ enum pl110_version
};
#define TYPE_PL110 "pl110"
+typedef struct PL110State PL110State;
#define PL110(obj) OBJECT_CHECK(PL110State, (obj), TYPE_PL110)
-typedef struct PL110State {
+struct PL110State {
SysBusDevice parent_obj;
MemoryRegion iomem;
@@ -73,7 +75,7 @@ typedef struct PL110State {
uint32_t palette[256];
uint32_t raw_palette[128];
qemu_irq irq;
-} PL110State;
+};
static int vmstate_pl110_post_load(void *opaque, int version_id);
diff --git a/hw/display/qxl.h b/hw/display/qxl.h
index 707631a1f5..4ecb6b2934 100644
--- a/hw/display/qxl.h
+++ b/hw/display/qxl.h
@@ -8,6 +8,7 @@
#include "ui/qemu-spice.h"
#include "ui/spice-display.h"
+#include "qom/object.h"
enum qxl_mode {
QXL_MODE_UNDEFINED,
@@ -27,7 +28,7 @@ enum qxl_mode {
#define QXL_PAGE_BITS 12
#define QXL_PAGE_SIZE (1 << QXL_PAGE_BITS);
-typedef struct PCIQXLDevice {
+struct PCIQXLDevice {
PCIDevice pci;
PortioList vga_port_list;
SimpleSpiceDisplay ssd;
@@ -126,7 +127,8 @@ typedef struct PCIQXLDevice {
int num_dirty_rects;
QXLRect dirty[QXL_NUM_DIRTY_RECTS];
QEMUBH *update_area_bh;
-} PCIQXLDevice;
+};
+typedef struct PCIQXLDevice PCIQXLDevice;
#define TYPE_PCI_QXL "pci-qxl"
#define PCI_QXL(obj) OBJECT_CHECK(PCIQXLDevice, (obj), TYPE_PCI_QXL)
diff --git a/hw/display/ramfb-standalone.c b/hw/display/ramfb-standalone.c
index b18db97eeb..dae32b9fda 100644
--- a/hw/display/ramfb-standalone.c
+++ b/hw/display/ramfb-standalone.c
@@ -5,14 +5,16 @@
#include "hw/qdev-properties.h"
#include "hw/display/ramfb.h"
#include "ui/console.h"
+#include "qom/object.h"
+typedef struct RAMFBStandaloneState RAMFBStandaloneState;
#define RAMFB(obj) OBJECT_CHECK(RAMFBStandaloneState, (obj), TYPE_RAMFB_DEVICE)
-typedef struct RAMFBStandaloneState {
+struct RAMFBStandaloneState {
SysBusDevice parent_obj;
QemuConsole *con;
RAMFBState *state;
-} RAMFBStandaloneState;
+};
static void display_update_wrapper(void *dev)
{
diff --git a/hw/display/sii9022.c b/hw/display/sii9022.c
index 3b82a8567f..4bf2c559cd 100644
--- a/hw/display/sii9022.c
+++ b/hw/display/sii9022.c
@@ -19,6 +19,7 @@
#include "migration/vmstate.h"
#include "hw/display/i2c-ddc.h"
#include "trace.h"
+#include "qom/object.h"
#define SII9022_SYS_CTRL_DATA 0x1a
#define SII9022_SYS_CTRL_PWR_DWN 0x10
@@ -35,16 +36,17 @@
#define SII9022_INT_STATUS_PLUGGED 0x04;
#define TYPE_SII9022 "sii9022"
+typedef struct sii9022_state sii9022_state;
#define SII9022(obj) OBJECT_CHECK(sii9022_state, (obj), TYPE_SII9022)
-typedef struct sii9022_state {
+struct sii9022_state {
I2CSlave parent_obj;
uint8_t ptr;
bool addr_byte;
bool ddc_req;
bool ddc_skip_finish;
bool ddc;
-} sii9022_state;
+};
static const VMStateDescription vmstate_sii9022 = {
.name = "sii9022",
diff --git a/hw/display/sm501.c b/hw/display/sm501.c
index 9cccc68c35..f886c1e51b 100644
--- a/hw/display/sm501.c
+++ b/hw/display/sm501.c
@@ -40,6 +40,7 @@
#include "ui/pixel_ops.h"
#include "qemu/bswap.h"
#include "trace.h"
+#include "qom/object.h"
#define MMIO_BASE_OFFSET 0x3e00000
#define MMIO_SIZE 0x200000
@@ -1931,10 +1932,11 @@ static const VMStateDescription vmstate_sm501_state = {
};
#define TYPE_SYSBUS_SM501 "sysbus-sm501"
+typedef struct SM501SysBusState SM501SysBusState;
#define SYSBUS_SM501(obj) \
OBJECT_CHECK(SM501SysBusState, (obj), TYPE_SYSBUS_SM501)
-typedef struct {
+struct SM501SysBusState {
/*< private >*/
SysBusDevice parent_obj;
/*< public >*/
@@ -1942,7 +1944,7 @@ typedef struct {
uint32_t vram_size;
uint32_t base;
SerialMM serial;
-} SM501SysBusState;
+};
static void sm501_realize_sysbus(DeviceState *dev, Error **errp)
{
@@ -2034,15 +2036,16 @@ static const TypeInfo sm501_sysbus_info = {
};
#define TYPE_PCI_SM501 "sm501"
+typedef struct SM501PCIState SM501PCIState;
#define PCI_SM501(obj) OBJECT_CHECK(SM501PCIState, (obj), TYPE_PCI_SM501)
-typedef struct {
+struct SM501PCIState {
/*< private >*/
PCIDevice parent_obj;
/*< public >*/
SM501State state;
uint32_t vram_size;
-} SM501PCIState;
+};
static void sm501_realize_pci(PCIDevice *dev, Error **errp)
{
diff --git a/hw/display/ssd0303.c b/hw/display/ssd0303.c
index 718378f6de..8804567c1f 100644
--- a/hw/display/ssd0303.c
+++ b/hw/display/ssd0303.c
@@ -16,6 +16,7 @@
#include "migration/vmstate.h"
#include "qemu/module.h"
#include "ui/console.h"
+#include "qom/object.h"
//#define DEBUG_SSD0303 1
@@ -46,9 +47,10 @@ enum ssd0303_cmd {
};
#define TYPE_SSD0303 "ssd0303"
+typedef struct ssd0303_state ssd0303_state;
#define SSD0303(obj) OBJECT_CHECK(ssd0303_state, (obj), TYPE_SSD0303)
-typedef struct {
+struct ssd0303_state {
I2CSlave parent_obj;
QemuConsole *con;
@@ -63,7 +65,7 @@ typedef struct {
enum ssd0303_mode mode;
enum ssd0303_cmd cmd_state;
uint8_t framebuffer[132*8];
-} ssd0303_state;
+};
static uint8_t ssd0303_recv(I2CSlave *i2c)
{
diff --git a/hw/display/ssd0323.c b/hw/display/ssd0323.c
index 32d27f008a..c9d79cfcd3 100644
--- a/hw/display/ssd0323.c
+++ b/hw/display/ssd0323.c
@@ -16,6 +16,7 @@
#include "migration/vmstate.h"
#include "qemu/module.h"
#include "ui/console.h"
+#include "qom/object.h"
//#define DEBUG_SSD0323 1
@@ -47,7 +48,7 @@ enum ssd0323_mode
SSD0323_DATA
};
-typedef struct {
+struct ssd0323_state {
SSISlave ssidev;
QemuConsole *con;
@@ -64,7 +65,8 @@ typedef struct {
int32_t remap;
uint32_t mode;
uint8_t framebuffer[128 * 80 / 2];
-} ssd0323_state;
+};
+typedef struct ssd0323_state ssd0323_state;
#define TYPE_SSD0323 "ssd0323"
#define SSD0323(obj) OBJECT_CHECK(ssd0323_state, (obj), TYPE_SSD0323)
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 1fb45b1aab..5c75589919 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -33,6 +33,7 @@
#include "migration/vmstate.h"
#include "qemu/error-report.h"
#include "qemu/module.h"
+#include "qom/object.h"
#define TCX_ROM_FILE "QEMU,tcx.bin"
#define FCODE_MAX_ROM_SIZE 0x10000
@@ -55,9 +56,10 @@
#define TCX_THC_CURSBITS 0x980
#define TYPE_TCX "SUNW,tcx"
+typedef struct TCXState TCXState;
#define TCX(obj) OBJECT_CHECK(TCXState, (obj), TYPE_TCX)
-typedef struct TCXState {
+struct TCXState {
SysBusDevice parent_obj;
QemuConsole *con;
@@ -93,7 +95,7 @@ typedef struct TCXState {
uint32_t cursbits[32];
uint16_t cursx;
uint16_t cursy;
-} TCXState;
+};
static void tcx_set_dirty(TCXState *s, ram_addr_t addr, int len)
{
diff --git a/hw/display/vga-isa.c b/hw/display/vga-isa.c
index 3aaeeeca1e..50efc3760a 100644
--- a/hw/display/vga-isa.c
+++ b/hw/display/vga-isa.c
@@ -32,17 +32,19 @@
#include "qemu/timer.h"
#include "hw/loader.h"
#include "hw/qdev-properties.h"
+#include "qom/object.h"
#define TYPE_ISA_VGA "isa-vga"
+typedef struct ISAVGAState ISAVGAState;
#define ISA_VGA(obj) OBJECT_CHECK(ISAVGAState, (obj), TYPE_ISA_VGA)
-typedef struct ISAVGAState {
+struct ISAVGAState {
ISADevice parent_obj;
struct VGACommonState state;
PortioList portio_vga;
PortioList portio_vbe;
-} ISAVGAState;
+};
static void vga_isa_reset(DeviceState *dev)
{
diff --git a/hw/display/vga-pci.c b/hw/display/vga-pci.c
index a640fd866d..852cbf36e9 100644
--- a/hw/display/vga-pci.c
+++ b/hw/display/vga-pci.c
@@ -34,6 +34,7 @@
#include "qemu/timer.h"
#include "hw/loader.h"
#include "hw/display/edid.h"
+#include "qom/object.h"
enum vga_pci_flags {
PCI_VGA_FLAG_ENABLE_MMIO = 1,
@@ -41,7 +42,7 @@ enum vga_pci_flags {
PCI_VGA_FLAG_ENABLE_EDID = 3,
};
-typedef struct PCIVGAState {
+struct PCIVGAState {
PCIDevice dev;
VGACommonState vga;
uint32_t flags;
@@ -49,7 +50,8 @@ typedef struct PCIVGAState {
MemoryRegion mmio;
MemoryRegion mrs[4];
uint8_t edid[256];
-} PCIVGAState;
+};
+typedef struct PCIVGAState PCIVGAState;
#define TYPE_PCI_VGA "pci-vga"
#define PCI_VGA(obj) OBJECT_CHECK(PCIVGAState, (obj), TYPE_PCI_VGA)
diff --git a/hw/display/vhost-user-gpu-pci.c b/hw/display/vhost-user-gpu-pci.c
index 23ce655e0f..678b762bbb 100644
--- a/hw/display/vhost-user-gpu-pci.c
+++ b/hw/display/vhost-user-gpu-pci.c
@@ -11,16 +11,18 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "hw/virtio/virtio-gpu-pci.h"
+#include "qom/object.h"
#define TYPE_VHOST_USER_GPU_PCI "vhost-user-gpu-pci"
+typedef struct VhostUserGPUPCI VhostUserGPUPCI;
#define VHOST_USER_GPU_PCI(obj) \
OBJECT_CHECK(VhostUserGPUPCI, (obj), TYPE_VHOST_USER_GPU_PCI)
-typedef struct VhostUserGPUPCI {
+struct VhostUserGPUPCI {
VirtIOGPUPCIBase parent_obj;
VhostUserGPU vdev;
-} VhostUserGPUPCI;
+};
static void vhost_user_gpu_pci_initfn(Object *obj)
{
diff --git a/hw/display/vhost-user-vga.c b/hw/display/vhost-user-vga.c
index 1690f6b610..2cc9616bea 100644
--- a/hw/display/vhost-user-vga.c
+++ b/hw/display/vhost-user-vga.c
@@ -11,17 +11,19 @@
#include "qemu/osdep.h"
#include "qapi/error.h"
#include "virtio-vga.h"
+#include "qom/object.h"
#define TYPE_VHOST_USER_VGA "vhost-user-vga"
+typedef struct VhostUserVGA VhostUserVGA;
#define VHOST_USER_VGA(obj) \
OBJECT_CHECK(VhostUserVGA, (obj), TYPE_VHOST_USER_VGA)
-typedef struct VhostUserVGA {
+struct VhostUserVGA {
VirtIOVGABase parent_obj;
VhostUserGPU vdev;
-} VhostUserVGA;
+};
static void vhost_user_vga_inst_initfn(Object *obj)
{
diff --git a/hw/display/virtio-gpu-pci.c b/hw/display/virtio-gpu-pci.c
index 34d8e93f28..7248ec30c7 100644
--- a/hw/display/virtio-gpu-pci.c
+++ b/hw/display/virtio-gpu-pci.c
@@ -19,6 +19,7 @@
#include "hw/virtio/virtio.h"
#include "hw/virtio/virtio-bus.h"
#include "hw/virtio/virtio-gpu-pci.h"
+#include "qom/object.h"
static Property virtio_gpu_pci_base_properties[] = {
DEFINE_VIRTIO_GPU_PCI_PROPERTIES(VirtIOPCIProxy),
@@ -65,13 +66,14 @@ static const TypeInfo virtio_gpu_pci_base_info = {
};
#define TYPE_VIRTIO_GPU_PCI "virtio-gpu-pci"
+typedef struct VirtIOGPUPCI VirtIOGPUPCI;
#define VIRTIO_GPU_PCI(obj) \
OBJECT_CHECK(VirtIOGPUPCI, (obj), TYPE_VIRTIO_GPU_PCI)
-typedef struct VirtIOGPUPCI {
+struct VirtIOGPUPCI {
VirtIOGPUPCIBase parent_obj;
VirtIOGPU vdev;
-} VirtIOGPUPCI;
+};
static void virtio_gpu_initfn(Object *obj)
{
diff --git a/hw/display/virtio-vga.c b/hw/display/virtio-vga.c
index f533d7d1b4..0bb98ede75 100644
--- a/hw/display/virtio-vga.c
+++ b/hw/display/virtio-vga.c
@@ -5,6 +5,7 @@
#include "qapi/error.h"
#include "qemu/module.h"
#include "virtio-vga.h"
+#include "qom/object.h"
static void virtio_vga_base_invalidate_display(void *opaque)
{
@@ -202,14 +203,15 @@ static TypeInfo virtio_vga_base_info = {
#define TYPE_VIRTIO_VGA "virtio-vga"
+typedef struct VirtIOVGA VirtIOVGA;
#define VIRTIO_VGA(obj) \
OBJECT_CHECK(VirtIOVGA, (obj), TYPE_VIRTIO_VGA)
-typedef struct VirtIOVGA {
+struct VirtIOVGA {
VirtIOVGABase parent_obj;
VirtIOGPU vdev;
-} VirtIOVGA;
+};
static void virtio_vga_inst_initfn(Object *obj)
{
diff --git a/hw/display/virtio-vga.h b/hw/display/virtio-vga.h
index c41281a010..2d3b765bf9 100644
--- a/hw/display/virtio-vga.h
+++ b/hw/display/virtio-vga.h
@@ -3,11 +3,14 @@
#include "hw/virtio/virtio-gpu-pci.h"
#include "vga_int.h"
+#include "qom/object.h"
/*
* virtio-vga-base: This extends VirtioPCIProxy.
*/
#define TYPE_VIRTIO_VGA_BASE "virtio-vga-base"
+typedef struct VirtIOVGABase VirtIOVGABase;
+typedef struct VirtIOVGABaseClass VirtIOVGABaseClass;
#define VIRTIO_VGA_BASE(obj) \
OBJECT_CHECK(VirtIOVGABase, (obj), TYPE_VIRTIO_VGA_BASE)
#define VIRTIO_VGA_BASE_GET_CLASS(obj) \
@@ -15,18 +18,18 @@
#define VIRTIO_VGA_BASE_CLASS(klass) \
OBJECT_CLASS_CHECK(VirtIOVGABaseClass, klass, TYPE_VIRTIO_VGA_BASE)
-typedef struct VirtIOVGABase {
+struct VirtIOVGABase {
VirtIOPCIProxy parent_obj;
VirtIOGPUBase *vgpu;
VGACommonState vga;
MemoryRegion vga_mrs[3];
-} VirtIOVGABase;
+};
-typedef struct VirtIOVGABaseClass {
+struct VirtIOVGABaseClass {
VirtioPCIClass parent_class;
DeviceReset parent_reset;
-} VirtIOVGABaseClass;
+};
#endif /* VIRTIO_VGA_H */
diff --git a/hw/display/vmware_vga.c b/hw/display/vmware_vga.c
index 2579f6b218..076dfcedd7 100644
--- a/hw/display/vmware_vga.c
+++ b/hw/display/vmware_vga.c
@@ -33,6 +33,7 @@
#include "hw/pci/pci.h"
#include "hw/qdev-properties.h"
#include "migration/vmstate.h"
+#include "qom/object.h"
#undef VERBOSE
#define HW_RECT_ACCEL