aboutsummaryrefslogtreecommitdiff
path: root/hw/qxl.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2013-02-28 12:15:00 +0100
committerGerd Hoffmann <kraxel@redhat.com>2013-03-18 10:21:58 +0100
commitc6c06853d99127c03778fc1bf9bc2d96a05c108e (patch)
tree6c968ef0b6b1856f7951bc0201b590b20b9c952e /hw/qxl.c
parent9c80a315b47a64043f6b91bd6f14352a455b323e (diff)
qxl: zap qxl0 global
DisplayChangeListener is passed now to all DisplayChangeListenerOps callbacks, so we can use that to access the qxl state and kill the qxl0 global variable. Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'hw/qxl.c')
-rw-r--r--hw/qxl.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/hw/qxl.c b/hw/qxl.c
index fe1c4f1a35..54a8d91b89 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -118,8 +118,6 @@ static QXLMode qxl_modes[] = {
QXL_MODE_EX(3200, 2400),
};
-static PCIQXLDevice *qxl0;
-
static void qxl_send_events(PCIQXLDevice *d, uint32_t events);
static int qxl_destroy_primary(PCIQXLDevice *d, qxl_async_io async);
static void qxl_reset_memslots(PCIQXLDevice *d);
@@ -1870,28 +1868,34 @@ static void display_update(DisplayChangeListener *dcl,
struct DisplayState *ds,
int x, int y, int w, int h)
{
- if (qxl0->mode == QXL_MODE_VGA) {
- qemu_spice_display_update(&qxl0->ssd, x, y, w, h);
+ PCIQXLDevice *qxl = container_of(dcl, PCIQXLDevice, ssd.dcl);
+
+ if (qxl->mode == QXL_MODE_VGA) {
+ qemu_spice_display_update(&qxl->ssd, x, y, w, h);
}
}
static void display_resize(DisplayChangeListener *dcl,
struct DisplayState *ds)
{
- if (qxl0->mode == QXL_MODE_VGA) {
- qemu_spice_display_resize(&qxl0->ssd);
+ PCIQXLDevice *qxl = container_of(dcl, PCIQXLDevice, ssd.dcl);
+
+ if (qxl->mode == QXL_MODE_VGA) {
+ qemu_spice_display_resize(&qxl->ssd);
}
}
static void display_refresh(DisplayChangeListener *dcl,
struct DisplayState *ds)
{
- if (qxl0->mode == QXL_MODE_VGA) {
- qemu_spice_display_refresh(&qxl0->ssd);
+ PCIQXLDevice *qxl = container_of(dcl, PCIQXLDevice, ssd.dcl);
+
+ if (qxl->mode == QXL_MODE_VGA) {
+ qemu_spice_display_refresh(&qxl->ssd);
} else {
- qemu_mutex_lock(&qxl0->ssd.lock);
- qemu_spice_cursor_refresh_unlocked(&qxl0->ssd);
- qemu_mutex_unlock(&qxl0->ssd.lock);
+ qemu_mutex_lock(&qxl->ssd.lock);
+ qemu_spice_cursor_refresh_unlocked(&qxl->ssd);
+ qemu_mutex_unlock(&qxl->ssd.lock);
}
}
@@ -2074,8 +2078,6 @@ static int qxl_init_primary(PCIDevice *dev)
qxl_hw_screen_dump, qxl_hw_text_update, qxl);
qemu_spice_display_init_common(&qxl->ssd, vga->ds);
- qxl0 = qxl;
-
rc = qxl_init_common(qxl);
if (rc != 0) {
return rc;