aboutsummaryrefslogtreecommitdiff
path: root/hw/display
diff options
context:
space:
mode:
authorPeter Maydell <peter.maydell@linaro.org>2014-02-20 13:05:47 +0000
committerPeter Maydell <peter.maydell@linaro.org>2014-02-20 13:05:48 +0000
commit61e8a923646903d76a6d952019716b417d42eedc (patch)
tree038e4c1921d45b2fe5d650a8fb476bb8169a1544 /hw/display
parent4c0c9bbe78901a706497a8fa1a27935bafc20cf7 (diff)
parent91f32b0c92fb18a403e48d3c8ffc14422a0c1ca5 (diff)
downloadqemu-61e8a923646903d76a6d952019716b417d42eedc.zip
qemu-61e8a923646903d76a6d952019716b417d42eedc.tar.gz
qemu-61e8a923646903d76a6d952019716b417d42eedc.tar.bz2
Merge remote-tracking branch 'remotes/afaerber/tags/qom-devices-for-peter' into staging
QOM infrastructure fixes and device conversions * QTest cleanups and test cases for PCI NICs * NAND fix for "info qtree" * Cleanup and extension of QOM machine tests * IndustryPack test cases and conversion to QOM realize * I2C cleanups * Cleanups of legacy qdev properties # gpg: Signature made Mon 17 Feb 2014 22:15:37 GMT using RSA key ID 3E7E013F # gpg: Good signature from "Andreas Färber <afaerber@suse.de>" # gpg: aka "Andreas Färber <afaerber@suse.com>" * remotes/afaerber/tags/qom-devices-for-peter: (49 commits) qtest: Include system headers before user headers qapi: Refine human printing of sizes qdev: Use QAPI type names for properties qdev: Add enum property types to QAPI schema block: Handle "rechs" and "large" translation options qdev: Remove hex8/32/64 property types qdev: Remove most legacy printers qdev: Use human mode in "info qtree" qapi: Add human mode to StringOutputVisitor qdev: Inline qdev_prop_parse() qdev: Legacy properties are just strings qdev: Legacy properties are now read-only qdev: Remove legacy parsers for hex8/32/64 qdev: Sizes are now parsed by StringInputVisitor qapi: Add size parser to StringInputVisitor qtest: Don't segfault with invalid -qtest option ipack: Move IndustryPack out of hw/char/ ipoctal232: QOM parent field cleanup ipack: QOM parent field cleanup for IPackDevice ipack: QOM parent field cleanup for IPackBus ... Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Diffstat (limited to 'hw/display')
-rw-r--r--hw/display/g364fb.c2
-rw-r--r--hw/display/ssd0303.c18
-rw-r--r--hw/display/tcx.c4
3 files changed, 15 insertions, 9 deletions
diff --git a/hw/display/g364fb.c b/hw/display/g364fb.c
index 7082171..bc909bb 100644
--- a/hw/display/g364fb.c
+++ b/hw/display/g364fb.c
@@ -524,7 +524,7 @@ static void g364fb_sysbus_reset(DeviceState *d)
}
static Property g364fb_sysbus_properties[] = {
- DEFINE_PROP_HEX32("vram_size", G364SysBusState, g364.vram_size,
+ DEFINE_PROP_UINT32("vram_size", G364SysBusState, g364.vram_size,
8 * 1024 * 1024),
DEFINE_PROP_END_OF_LIST(),
};
diff --git a/hw/display/ssd0303.c b/hw/display/ssd0303.c
index beea5bf..89804e1 100644
--- a/hw/display/ssd0303.c
+++ b/hw/display/ssd0303.c
@@ -41,8 +41,12 @@ enum ssd0303_cmd {
SSD0303_CMD_SKIP1
};
+#define TYPE_SSD0303 "ssd0303"
+#define SSD0303(obj) OBJECT_CHECK(ssd0303_state, (obj), TYPE_SSD0303)
+
typedef struct {
- I2CSlave i2c;
+ I2CSlave parent_obj;
+
QemuConsole *con;
int row;
int col;
@@ -65,8 +69,9 @@ static int ssd0303_recv(I2CSlave *i2c)
static int ssd0303_send(I2CSlave *i2c, uint8_t data)
{
- ssd0303_state *s = (ssd0303_state *)i2c;
+ ssd0303_state *s = SSD0303(i2c);
enum ssd0303_cmd old_cmd_state;
+
switch (s->mode) {
case SSD0303_IDLE:
DPRINTF("byte 0x%02x\n", data);
@@ -175,7 +180,8 @@ static int ssd0303_send(I2CSlave *i2c, uint8_t data)
static void ssd0303_event(I2CSlave *i2c, enum i2c_event event)
{
- ssd0303_state *s = (ssd0303_state *)i2c;
+ ssd0303_state *s = SSD0303(i2c);
+
switch (event) {
case I2C_FINISH:
s->mode = SSD0303_IDLE;
@@ -279,7 +285,7 @@ static const VMStateDescription vmstate_ssd0303 = {
VMSTATE_UINT32(mode, ssd0303_state),
VMSTATE_UINT32(cmd_state, ssd0303_state),
VMSTATE_BUFFER(framebuffer, ssd0303_state),
- VMSTATE_I2C_SLAVE(i2c, ssd0303_state),
+ VMSTATE_I2C_SLAVE(parent_obj, ssd0303_state),
VMSTATE_END_OF_LIST()
}
};
@@ -291,7 +297,7 @@ static const GraphicHwOps ssd0303_ops = {
static int ssd0303_init(I2CSlave *i2c)
{
- ssd0303_state *s = FROM_I2C_SLAVE(ssd0303_state, i2c);
+ ssd0303_state *s = SSD0303(i2c);
s->con = graphic_console_init(DEVICE(i2c), &ssd0303_ops, s);
qemu_console_resize(s->con, 96 * MAGNIFY, 16 * MAGNIFY);
@@ -311,7 +317,7 @@ static void ssd0303_class_init(ObjectClass *klass, void *data)
}
static const TypeInfo ssd0303_info = {
- .name = "ssd0303",
+ .name = TYPE_SSD0303,
.parent = TYPE_I2C_SLAVE,
.instance_size = sizeof(ssd0303_state),
.class_init = ssd0303_class_init,
diff --git a/hw/display/tcx.c b/hw/display/tcx.c
index 873b82c..e60769c 100644
--- a/hw/display/tcx.c
+++ b/hw/display/tcx.c
@@ -617,11 +617,11 @@ static int tcx_init1(SysBusDevice *dev)
}
static Property tcx_properties[] = {
- DEFINE_PROP_HEX32("vram_size", TCXState, vram_size, -1),
+ DEFINE_PROP_UINT32("vram_size", TCXState, vram_size, -1),
DEFINE_PROP_UINT16("width", TCXState, width, -1),
DEFINE_PROP_UINT16("height", TCXState, height, -1),
DEFINE_PROP_UINT16("depth", TCXState, depth, -1),
- DEFINE_PROP_HEX64("prom_addr", TCXState, prom_addr, -1),
+ DEFINE_PROP_UINT64("prom_addr", TCXState, prom_addr, -1),
DEFINE_PROP_END_OF_LIST(),
};