Skip to content

Commit

Permalink
console: zap ds arg from register_displaychangelistener
Browse files Browse the repository at this point in the history
We don't have multiple DisplayStates any more,
so passing it in as argument is not needed.

Signed-off-by: Gerd Hoffmann <[email protected]>
  • Loading branch information
kraxel authored and Anthony Liguori committed Apr 25, 2013
1 parent cdd5b93 commit 5209089
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 16 deletions.
4 changes: 1 addition & 3 deletions hw/display/qxl.c
Original file line number Diff line number Diff line change
Expand Up @@ -2058,7 +2058,6 @@ static int qxl_init_primary(PCIDevice *dev)
PCIQXLDevice *qxl = DO_UPCAST(PCIQXLDevice, pci, dev);
VGACommonState *vga = &qxl->vga;
PortioList *qxl_vga_port_list = g_new(PortioList, 1);
DisplayState *ds;
int rc;

qxl->id = 0;
Expand All @@ -2079,8 +2078,7 @@ static int qxl_init_primary(PCIDevice *dev)

qxl->ssd.dcl.ops = &display_listener_ops;
qxl->ssd.dcl.con = vga->con;
ds = qemu_console_displaystate(vga->con);
register_displaychangelistener(ds, &qxl->ssd.dcl);
register_displaychangelistener(&qxl->ssd.dcl);
return rc;
}

Expand Down
3 changes: 1 addition & 2 deletions include/ui/console.h
Original file line number Diff line number Diff line change
Expand Up @@ -208,8 +208,7 @@ static inline int is_buffer_shared(DisplaySurface *surface)
return !(surface->flags & QEMU_ALLOCATED_FLAG);
}

void register_displaychangelistener(DisplayState *ds,
DisplayChangeListener *dcl);
void register_displaychangelistener(DisplayChangeListener *dcl);
void update_displaychangelistener(DisplayChangeListener *dcl,
uint64_t interval);
void unregister_displaychangelistener(DisplayChangeListener *dcl);
Expand Down
2 changes: 1 addition & 1 deletion ui/cocoa.m
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ void cocoa_display_init(DisplayState *ds, int full_screen)

// register vga output callbacks
dcl->ops = &dcl_ops;
register_displaychangelistener(ds, dcl);
register_displaychangelistener(dcl);

// register cleanup function
atexit(cocoa_cleanup);
Expand Down
10 changes: 5 additions & 5 deletions ui/console.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ static int nb_consoles = 0;

static void text_console_do_init(CharDriverState *chr, DisplayState *ds);
static void dpy_refresh(DisplayState *s);
static DisplayState *get_alloc_displaystate(void);

static void gui_update(void *opaque)
{
Expand Down Expand Up @@ -1309,15 +1310,14 @@ void qemu_free_displaysurface(DisplaySurface *surface)
g_free(surface);
}

void register_displaychangelistener(DisplayState *ds,
DisplayChangeListener *dcl)
void register_displaychangelistener(DisplayChangeListener *dcl)
{
QemuConsole *con;

trace_displaychangelistener_register(dcl, dcl->ops->dpy_name);
dcl->ds = ds;
QLIST_INSERT_HEAD(&ds->listeners, dcl, next);
gui_setup_refresh(ds);
dcl->ds = get_alloc_displaystate();
QLIST_INSERT_HEAD(&dcl->ds->listeners, dcl, next);
gui_setup_refresh(dcl->ds);
if (dcl->con) {
dcl->con->dcls++;
con = dcl->con;
Expand Down
2 changes: 1 addition & 1 deletion ui/curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ void curses_display_init(DisplayState *ds, int full_screen)

dcl = (DisplayChangeListener *) g_malloc0(sizeof(DisplayChangeListener));
dcl->ops = &dcl_ops;
register_displaychangelistener(ds, dcl);
register_displaychangelistener(dcl);

invalidate = 1;
}
2 changes: 1 addition & 1 deletion ui/gtk.c
Original file line number Diff line number Diff line change
Expand Up @@ -1470,7 +1470,7 @@ void gtk_display_init(DisplayState *ds)

gtk_widget_show_all(s->window);

register_displaychangelistener(ds, &s->dcl);
register_displaychangelistener(&s->dcl);

global_state = s;
}
2 changes: 1 addition & 1 deletion ui/sdl.c
Original file line number Diff line number Diff line change
Expand Up @@ -937,7 +937,7 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)

dcl = g_malloc0(sizeof(DisplayChangeListener));
dcl->ops = &dcl_ops;
register_displaychangelistener(ds, dcl);
register_displaychangelistener(dcl);

mouse_mode_notifier.notify = sdl_mouse_mode_change;
qemu_add_mouse_mode_change_notifier(&mouse_mode_notifier);
Expand Down
2 changes: 1 addition & 1 deletion ui/spice-display.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ void qemu_spice_display_init(DisplayState *ds)

ssd->dcl.ops = &display_listener_ops;
ssd->dcl.con = qemu_console_lookup_by_index(0);
register_displaychangelistener(ds, &ssd->dcl);
register_displaychangelistener(&ssd->dcl);

qemu_spice_create_host_primary(ssd);
}
2 changes: 1 addition & 1 deletion ui/vnc.c
Original file line number Diff line number Diff line change
Expand Up @@ -2832,7 +2832,7 @@ void vnc_display_init(DisplayState *ds)
vnc_start_worker_thread();

vs->dcl.ops = &dcl_ops;
register_displaychangelistener(ds, &vs->dcl);
register_displaychangelistener(&vs->dcl);
}


Expand Down

0 comments on commit 5209089

Please sign in to comment.