From: Alon Levy <alevy@redhat.com>
To: qemu-devel@nongnu.org, kraxel@redhat.com, lcapitulino@redhat.com,
aliguori@us.ibm.com
Subject: [Qemu-devel] [PATCH 3/4] console: pass Monitor to vga_hw_screen_dump/hw_vga_dump
Date: Sun, 11 Mar 2012 18:39:36 +0200 [thread overview]
Message-ID: <1331483977-18910-4-git-send-email-alevy@redhat.com> (raw)
In-Reply-To: <1331483977-18910-1-git-send-email-alevy@redhat.com>
Passes the Monitor ptr to the screendump implementation to all for
monitor suspend and resume for qxl to fix screendump regression.
graphics_console_init signature change required touching every
implemented of screen_dump. There is no change other then an added
parameter. qxl will make use of it in the next patch.
compiles with ./configure
Signed-off-by: Alon Levy <alevy@redhat.com>
---
console.c | 4 ++--
console.h | 5 +++--
hw/blizzard.c | 2 +-
hw/g364fb.c | 3 ++-
hw/omap_dss.c | 4 +++-
hw/omap_lcdc.c | 3 ++-
hw/qxl.c | 5 +++--
hw/sm501.c | 4 ++--
hw/tcx.c | 12 ++++++++----
hw/vga.c | 6 ++++--
hw/vmware_vga.c | 5 +++--
monitor.c | 2 +-
12 files changed, 34 insertions(+), 21 deletions(-)
diff --git a/console.c b/console.c
index 6a463f5..3e386fc 100644
--- a/console.c
+++ b/console.c
@@ -173,7 +173,7 @@ void vga_hw_invalidate(void)
active_console->hw_invalidate(active_console->hw);
}
-void vga_hw_screen_dump(const char *filename)
+void vga_hw_screen_dump(const char *filename, Monitor *mon)
{
TextConsole *previous_active_console;
bool cswitch;
@@ -187,7 +187,7 @@ void vga_hw_screen_dump(const char *filename)
console_select(0);
}
if (consoles[0] && consoles[0]->hw_screen_dump) {
- consoles[0]->hw_screen_dump(consoles[0]->hw, filename, cswitch);
+ consoles[0]->hw_screen_dump(consoles[0]->hw, filename, cswitch, mon);
} else {
error_report("screen dump not implemented");
}
diff --git a/console.h b/console.h
index 4334db5..0d2cf30 100644
--- a/console.h
+++ b/console.h
@@ -343,7 +343,8 @@ static inline void console_write_ch(console_ch_t *dest, uint32_t 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 (*vga_hw_screen_dump_ptr)(void *, const char *, bool cswitch,
+ Monitor *mon);
typedef void (*vga_hw_text_update_ptr)(void *, console_ch_t *);
DisplayState *graphic_console_init(vga_hw_update_ptr update,
@@ -354,7 +355,7 @@ DisplayState *graphic_console_init(vga_hw_update_ptr update,
void vga_hw_update(void);
void vga_hw_invalidate(void);
-void vga_hw_screen_dump(const char *filename);
+void vga_hw_screen_dump(const char *filename, Monitor *mon);
void vga_hw_text_update(console_ch_t *chardata);
int is_graphic_console(void);
diff --git a/hw/blizzard.c b/hw/blizzard.c
index c7d844d..8ccea7f 100644
--- a/hw/blizzard.c
+++ b/hw/blizzard.c
@@ -933,7 +933,7 @@ static void blizzard_update_display(void *opaque)
}
static void blizzard_screen_dump(void *opaque, const char *filename,
- bool cswitch)
+ bool cswitch, Monitor *mon)
{
BlizzardState *s = (BlizzardState *) opaque;
diff --git a/hw/g364fb.c b/hw/g364fb.c
index 3a0b68f..f89000c 100644
--- a/hw/g364fb.c
+++ b/hw/g364fb.c
@@ -289,7 +289,8 @@ static void g364fb_reset(G364State *s)
g364fb_invalidate_display(s);
}
-static void g364fb_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void g364fb_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon)
{
G364State *s = opaque;
int y, x;
diff --git a/hw/omap_dss.c b/hw/omap_dss.c
index 86ed6ea..b4a1a93 100644
--- a/hw/omap_dss.c
+++ b/hw/omap_dss.c
@@ -1072,7 +1072,9 @@ struct omap_dss_s *omap_dss_init(struct omap_target_agent_s *ta,
#if 0
s->state = graphic_console_init(omap_update_display,
- omap_invalidate_display, omap_screen_dump, s);
+ omap_invalidate_display,
+ omap_screen_dump,
+ NULL, s);
#endif
return s;
diff --git a/hw/omap_lcdc.c b/hw/omap_lcdc.c
index f172093..ed2325d 100644
--- a/hw/omap_lcdc.c
+++ b/hw/omap_lcdc.c
@@ -264,7 +264,8 @@ static int ppm_save(const char *filename, uint8_t *data,
return 0;
}
-static void omap_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void omap_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon)
{
struct omap_lcd_panel_s *omap_lcd = opaque;
if (cswitch) {
diff --git a/hw/qxl.c b/hw/qxl.c
index 7857731..cabea3b 100644
--- a/hw/qxl.c
+++ b/hw/qxl.c
@@ -1486,7 +1486,8 @@ static void qxl_hw_invalidate(void *opaque)
vga->invalidate(vga);
}
-static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon)
{
PCIQXLDevice *qxl = opaque;
VGACommonState *vga = &qxl->vga;
@@ -1498,7 +1499,7 @@ static void qxl_hw_screen_dump(void *opaque, const char *filename, bool cswitch)
ppm_save(filename, qxl->ssd.ds->surface);
break;
case QXL_MODE_VGA:
- vga->screen_dump(vga, filename, cswitch);
+ vga->screen_dump(vga, filename, cswitch, mon);
break;
default:
break;
diff --git a/hw/sm501.c b/hw/sm501.c
index 786e076..eedcb8e 100644
--- a/hw/sm501.c
+++ b/hw/sm501.c
@@ -1442,6 +1442,6 @@ void sm501_init(MemoryRegion *address_space_mem, uint32_t base,
}
/* create qemu graphic console */
- s->ds = graphic_console_init(sm501_update_display, NULL,
- NULL, NULL, s);
+ s->ds = graphic_console_init(sm501_update_display, NULL, NULL,
+ NULL, s);
}
diff --git a/hw/tcx.c b/hw/tcx.c
index ac7dcb4..e800cb5 100644
--- a/hw/tcx.c
+++ b/hw/tcx.c
@@ -56,8 +56,10 @@ typedef struct TCXState {
uint8_t dac_index, dac_state;
} TCXState;
-static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch);
-static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch);
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon);
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon);
static void tcx_set_dirty(TCXState *s)
{
@@ -574,7 +576,8 @@ static int tcx_init1(SysBusDevice *dev)
return 0;
}
-static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon)
{
TCXState *s = opaque;
FILE *f;
@@ -601,7 +604,8 @@ static void tcx_screen_dump(void *opaque, const char *filename, bool cswitch)
return;
}
-static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void tcx24_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon)
{
TCXState *s = opaque;
FILE *f;
diff --git a/hw/vga.c b/hw/vga.c
index 6dc98f6..9af231e 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -163,7 +163,8 @@ static uint32_t expand4[256];
static uint16_t expand2[256];
static uint8_t expand4to8[16];
-static void vga_screen_dump(void *opaque, const char *filename, bool cswitch);
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon);
static void vga_update_memory_access(VGACommonState *s)
{
@@ -2409,7 +2410,8 @@ int ppm_save(const char *filename, struct DisplaySurface *ds)
/* save the vga display in a PPM image even if no display is
available */
-static void vga_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void vga_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon)
{
VGACommonState *s = opaque;
diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index 142d9f4..803118c 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -1003,11 +1003,12 @@ static void vmsvga_invalidate_display(void *opaque)
/* save the vga display in a PPM image even if no display is
available */
-static void vmsvga_screen_dump(void *opaque, const char *filename, bool cswitch)
+static void vmsvga_screen_dump(void *opaque, const char *filename, bool cswitch,
+ Monitor *mon)
{
struct vmsvga_state_s *s = opaque;
if (!s->enable) {
- s->vga.screen_dump(&s->vga, filename, cswitch);
+ s->vga.screen_dump(&s->vga, filename, cswitch, mon);
return;
}
diff --git a/monitor.c b/monitor.c
index cbdfbad..cdae23f 100644
--- a/monitor.c
+++ b/monitor.c
@@ -895,7 +895,7 @@ static int client_migrate_info(Monitor *mon, const QDict *qdict,
static int do_screen_dump(Monitor *mon, const QDict *qdict, QObject **ret_data)
{
- vga_hw_screen_dump(qdict_get_str(qdict, "filename"));
+ vga_hw_screen_dump(qdict_get_str(qdict, "filename"), mon);
return 0;
}
--
1.7.9.1
next prev parent reply other threads:[~2012-03-11 18:08 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-03-11 16:39 [Qemu-devel] [PATCH 0/4] fix qxl screendump using monitor_suspend Alon Levy
2012-03-11 16:39 ` [Qemu-devel] [PATCH 1/4] qxl: switch qxl.c to trace-events Alon Levy
2012-03-11 16:39 ` [Qemu-devel] [PATCH 2/4] qxl/qxl_render.c: add trace events Alon Levy
2012-03-11 16:39 ` Alon Levy [this message]
2012-03-11 16:39 ` [Qemu-devel] [PATCH 4/4] qxl-render: call ppm_save on bh Alon Levy
2012-03-11 19:26 ` [Qemu-devel] [PATCH v2 0/5] fix qxl screendump using monitor_suspend Alon Levy
2012-03-11 19:26 ` [Qemu-devel] [PATCH v2 1/5] qxl: switch qxl.c to trace-events Alon Levy
2012-03-12 10:20 ` Gerd Hoffmann
2012-03-12 11:43 ` Alon Levy
2012-03-12 15:50 ` Alon Levy
2012-03-13 6:42 ` Gerd Hoffmann
2012-03-13 9:35 ` Alon Levy
2012-03-13 9:47 ` Gerd Hoffmann
2012-03-13 10:18 ` Alon Levy
2012-03-13 10:26 ` Alon Levy
2012-03-11 19:26 ` [Qemu-devel] [PATCH v2 2/5] qxl/qxl_render.c: add trace events Alon Levy
2012-03-11 19:26 ` [Qemu-devel] [PATCH v2 3/5] qxl-render: call ppm_save on bh Alon Levy
2012-03-13 13:22 ` Luiz Capitulino
2012-03-11 19:26 ` [Qemu-devel] [PATCH v2 4/5] console: pass Monitor to vga_hw_screen_dump/hw_vga_dump Alon Levy
2012-03-13 13:35 ` Luiz Capitulino
2012-03-13 14:46 ` Alon Levy
2012-03-13 15:59 ` Luiz Capitulino
2012-03-13 17:35 ` Alon Levy
2012-03-13 18:07 ` Luiz Capitulino
2012-03-14 8:25 ` Gerd Hoffmann
2012-03-14 8:32 ` Alon Levy
2012-03-14 8:14 ` Gerd Hoffmann
2012-03-14 8:37 ` Daniel P. Berrange
2012-03-14 12:32 ` Luiz Capitulino
2012-03-14 13:14 ` Alon Levy
2012-03-14 13:17 ` Daniel P. Berrange
2012-03-14 13:18 ` Luiz Capitulino
2012-03-14 13:43 ` Alon Levy
2012-03-11 19:26 ` [Qemu-devel] [PATCH v2 5/5] qxl: screendump: use provided Monitor Alon Levy
2012-03-11 19:33 ` [Qemu-devel] [PATCH 0/4] fix qxl screendump using monitor_suspend Alon Levy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1331483977-18910-4-git-send-email-alevy@redhat.com \
--to=alevy@redhat.com \
--cc=aliguori@us.ibm.com \
--cc=kraxel@redhat.com \
--cc=lcapitulino@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).