Commit 1dbfa005 authored by Gerd Hoffmann's avatar Gerd Hoffmann
Browse files

console: rename vga_hw_*, add QemuConsole param



Add QemuConsole parameter to vga_hw_*, so the interface allows to update
non-active consoles (the actual code can't handle this yet, see next
patch).  Passing NULL is allowed and updates the active console, like
the functions do today.

While touching all vga_hw_* calls anyway rename that to the functions to
hardware-neutral graphics_hw_*

Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
parent 64840c66
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -720,7 +720,7 @@ static void cirrus_do_copy(CirrusVGAState *s, int dst, int src, int w, int h)
    /* we have to flush all pending changes so that the copy
       is generated at the appropriate moment in time */
    if (notify)
	vga_hw_update();
        graphic_hw_update(s->vga.con);

    (*s->cirrus_rop) (s, s->vga.vram_ptr +
		      (s->cirrus_blt_dstaddr & s->cirrus_addr_mask),
+1 −1
Original line number Diff line number Diff line
@@ -1074,7 +1074,7 @@ static void qxl_enter_vga_mode(PCIQXLDevice *d)
    qemu_spice_create_host_primary(&d->ssd);
    d->mode = QXL_MODE_VGA;
    vga_dirty_log_start(&d->vga);
    vga_hw_update();
    graphic_hw_update(d->vga.con);
}

static void qxl_exit_vga_mode(PCIQXLDevice *d)
+1 −1
Original line number Diff line number Diff line
@@ -2452,6 +2452,6 @@ static void vga_screen_dump(void *opaque, const char *filename, bool cswitch,
    if (cswitch) {
        vga_invalidate_display(s);
    }
    vga_hw_update();
    graphic_hw_update(s->con);
    ppm_save(filename, surface, errp);
}
+4 −4
Original line number Diff line number Diff line
@@ -152,10 +152,10 @@ typedef struct VGACommonState {
    uint32_t cursor_offset;
    unsigned int (*rgb_to_pixel)(unsigned int r,
                                 unsigned int g, unsigned b);
    vga_hw_update_ptr update;
    vga_hw_invalidate_ptr invalidate;
    vga_hw_screen_dump_ptr screen_dump;
    vga_hw_text_update_ptr text_update;
    graphic_hw_update_ptr update;
    graphic_hw_invalidate_ptr invalidate;
    graphic_hw_screen_dump_ptr screen_dump;
    graphic_hw_text_update_ptr text_update;
    bool full_update_text;
    bool full_update_gfx;
    /* hardware mouse cursor support */
+11 −11
Original line number Diff line number Diff line
@@ -278,21 +278,21 @@ static inline void console_write_ch(console_ch_t *dest, uint32_t ch)
    *dest = ch;
}

typedef void (*vga_hw_update_ptr)(void *);
typedef void (*vga_hw_invalidate_ptr)(void *);
typedef void (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch,
typedef void (*graphic_hw_update_ptr)(void *);
typedef void (*graphic_hw_invalidate_ptr)(void *);
typedef void (*graphic_hw_screen_dump_ptr)(void *, const char *, bool cswitch,
                                       Error **errp);
typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *);
typedef void (*graphic_hw_text_update_ptr)(void *, console_ch_t *);

QemuConsole *graphic_console_init(vga_hw_update_ptr update,
                                  vga_hw_invalidate_ptr invalidate,
                                  vga_hw_screen_dump_ptr screen_dump,
                                  vga_hw_text_update_ptr text_update,
QemuConsole *graphic_console_init(graphic_hw_update_ptr update,
                                  graphic_hw_invalidate_ptr invalidate,
                                  graphic_hw_screen_dump_ptr screen_dump,
                                  graphic_hw_text_update_ptr text_update,
                                  void *opaque);

void vga_hw_update(void);
void vga_hw_invalidate(void);
void vga_hw_text_update(console_ch_t *chardata);
void graphic_hw_update(QemuConsole *con);
void graphic_hw_invalidate(QemuConsole *con);
void graphic_hw_text_update(QemuConsole *con, console_ch_t *chardata);

int is_graphic_console(void);
int is_fixedsize_console(void);
Loading