@@ -102,6 +102,7 @@ static void update_cursor(VirtIOGPU *g, struct virtio_gpu_update_cursor *cursor)
if (cursor->resource_id > 0) {
vgc->update_cursor_data(g, s, cursor->resource_id);
+ cursor_dump_hex(s->current_cursor, "", 24, 24);
cursor_unmultiply_alpha(s->current_cursor);
cursor_swap_rgb(s->current_cursor);
}
@@ -169,6 +169,7 @@ void cursor_unref(QEMUCursor *c);
QEMUCursor *cursor_builtin_hidden(void);
QEMUCursor *cursor_builtin_left_ptr(void);
void cursor_print_ascii_art(QEMUCursor *c, const char *prefix);
+void cursor_dump_hex(QEMUCursor *c, const char *prefix, int maxw, int maxh);
int cursor_get_mono_bpl(QEMUCursor *c);
void cursor_set_mono(QEMUCursor *c,
uint32_t foreground, uint32_t background, uint8_t *image,
@@ -80,6 +80,27 @@ void cursor_print_ascii_art(QEMUCursor *c, const char *prefix)
}
}
+void cursor_dump_hex(QEMUCursor *c, const char *prefix, int maxw, int maxh)
+{
+ uint8_t *data = (uint8_t *) c->data;
+ int x,y,v;
+
+ maxw = MIN(maxw, c->width);
+ maxh = MIN(maxh, c->height);
+
+ for (y = 0; y < maxh; y++) {
+ fprintf(stderr, "%s: %2d: |", prefix, y);
+ for (x = 0; x < maxw; x++) {
+ for (v = 0; v < 4 ; v++, data++) {
+ fprintf(stderr, "%02x", *data);
+ }
+ fprintf(stderr, " ");
+ }
+ data += (c->width - maxw) * 4;
+ fprintf(stderr, "|\n");
+ }
+}
+
QEMUCursor *cursor_builtin_hidden(void)
{
return cursor_parse_xpm(cursor_hidden_xpm);
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com> --- hw/display/virtio-gpu.c | 1 + include/ui/console.h | 1 + ui/cursor.c | 21 +++++++++++++++++++++ 3 files changed, 23 insertions(+)