|
Hans de Goede |
56753f |
From 29304ce6b6863b544f1ad8535a927dfc8864354c Mon Sep 17 00:00:00 2001
|
|
Hans de Goede |
56753f |
From: Alon Levy <alevy@redhat.com>
|
|
Hans de Goede |
56753f |
Date: Sun, 18 Mar 2012 13:46:14 +0100
|
|
Hans de Goede |
56753f |
Subject: [PATCH 425/434] qxl: switch qxl.c to trace-events
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
dprint is still used for qxl_init_common one time prints.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
also switched parts of spice-display.c over, mainly all the callbacks to
|
|
Hans de Goede |
56753f |
spice server.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
All qxl device trace events start with the qxl device id.
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Signed-off-by: Alon Levy <alevy@redhat.com>
|
|
Hans de Goede |
56753f |
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
|
|
Hans de Goede |
56753f |
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
Conflicts:
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
trace-events
|
|
Hans de Goede |
56753f |
---
|
|
Hans de Goede |
56753f |
hw/qxl.c | 141 +++++++++++++++++++++++++---------------------------
|
|
Hans de Goede |
56753f |
trace-events | 59 ++++++++++++++++++++++
|
|
Hans de Goede |
56753f |
ui/spice-display.c | 14 +++++-
|
|
Hans de Goede |
56753f |
3 files changed, 140 insertions(+), 74 deletions(-)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
diff --git a/hw/qxl.c b/hw/qxl.c
|
|
Hans de Goede |
56753f |
index 9ad5807..813873a 100644
|
|
Hans de Goede |
56753f |
--- a/hw/qxl.c
|
|
Hans de Goede |
56753f |
+++ b/hw/qxl.c
|
|
Hans de Goede |
56753f |
@@ -23,6 +23,7 @@
|
|
Hans de Goede |
56753f |
#include "qemu-queue.h"
|
|
Hans de Goede |
56753f |
#include "monitor.h"
|
|
Hans de Goede |
56753f |
#include "sysemu.h"
|
|
Hans de Goede |
56753f |
+#include "trace.h"
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
#include "qxl.h"
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -143,6 +144,10 @@ void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id,
|
|
Hans de Goede |
56753f |
uint32_t clear_dirty_region,
|
|
Hans de Goede |
56753f |
qxl_async_io async, struct QXLCookie *cookie)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_update_area(qxl->id, surface_id, area->left, area->right,
|
|
Hans de Goede |
56753f |
+ area->top, area->bottom);
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_update_area_rest(qxl->id, num_dirty_rects,
|
|
Hans de Goede |
56753f |
+ clear_dirty_region);
|
|
Hans de Goede |
56753f |
if (async == QXL_SYNC) {
|
|
Hans de Goede |
56753f |
qxl->ssd.worker->update_area(qxl->ssd.worker, surface_id, area,
|
|
Hans de Goede |
56753f |
dirty_rects, num_dirty_rects, clear_dirty_region);
|
|
Hans de Goede |
56753f |
@@ -156,6 +161,7 @@ void qxl_spice_update_area(PCIQXLDevice *qxl, uint32_t surface_id,
|
|
Hans de Goede |
56753f |
static void qxl_spice_destroy_surface_wait_complete(PCIQXLDevice *qxl,
|
|
Hans de Goede |
56753f |
uint32_t id)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_destroy_surface_wait_complete(qxl->id, id);
|
|
Hans de Goede |
56753f |
qemu_mutex_lock(&qxl->track_lock);
|
|
Hans de Goede |
56753f |
qxl->guest_surfaces.cmds[id] = 0;
|
|
Hans de Goede |
56753f |
qxl->guest_surfaces.count--;
|
|
Hans de Goede |
56753f |
@@ -167,6 +173,7 @@ static void qxl_spice_destroy_surface_wait(PCIQXLDevice *qxl, uint32_t id,
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
QXLCookie *cookie;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_destroy_surface_wait(qxl->id, id, async);
|
|
Hans de Goede |
56753f |
if (async) {
|
|
Hans de Goede |
56753f |
cookie = qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
56753f |
QXL_IO_DESTROY_SURFACE_ASYNC);
|
|
Hans de Goede |
56753f |
@@ -174,12 +181,13 @@ static void qxl_spice_destroy_surface_wait(PCIQXLDevice *qxl, uint32_t id,
|
|
Hans de Goede |
56753f |
spice_qxl_destroy_surface_async(&qxl->ssd.qxl, id, (uint64_t)cookie);
|
|
Hans de Goede |
56753f |
} else {
|
|
Hans de Goede |
56753f |
qxl->ssd.worker->destroy_surface_wait(qxl->ssd.worker, id);
|
|
Hans de Goede |
56753f |
- qxl_spice_destroy_surface_wait_complete(qxl, id);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_spice_flush_surfaces_async(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_flush_surfaces_async(qxl->id, qxl->guest_surfaces.count,
|
|
Hans de Goede |
56753f |
+ qxl->num_free_res);
|
|
Hans de Goede |
56753f |
spice_qxl_flush_surfaces_async(&qxl->ssd.qxl,
|
|
Hans de Goede |
56753f |
(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
56753f |
QXL_IO_FLUSH_SURFACES_ASYNC));
|
|
Hans de Goede |
56753f |
@@ -188,21 +196,25 @@ static void qxl_spice_flush_surfaces_async(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
void qxl_spice_loadvm_commands(PCIQXLDevice *qxl, struct QXLCommandExt *ext,
|
|
Hans de Goede |
56753f |
uint32_t count)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_loadvm_commands(qxl->id, ext, count);
|
|
Hans de Goede |
56753f |
qxl->ssd.worker->loadvm_commands(qxl->ssd.worker, ext, count);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qxl_spice_oom(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_oom(qxl->id);
|
|
Hans de Goede |
56753f |
qxl->ssd.worker->oom(qxl->ssd.worker);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qxl_spice_reset_memslots(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_reset_memslots(qxl->id);
|
|
Hans de Goede |
56753f |
qxl->ssd.worker->reset_memslots(qxl->ssd.worker);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_spice_destroy_surfaces_complete(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_destroy_surfaces_complete(qxl->id);
|
|
Hans de Goede |
56753f |
qemu_mutex_lock(&qxl->track_lock);
|
|
Hans de Goede |
56753f |
memset(&qxl->guest_surfaces.cmds, 0, sizeof(qxl->guest_surfaces.cmds));
|
|
Hans de Goede |
56753f |
qxl->guest_surfaces.count = 0;
|
|
Hans de Goede |
56753f |
@@ -211,6 +223,7 @@ static void qxl_spice_destroy_surfaces_complete(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_destroy_surfaces(qxl->id, async);
|
|
Hans de Goede |
56753f |
if (async) {
|
|
Hans de Goede |
56753f |
spice_qxl_destroy_surfaces_async(&qxl->ssd.qxl,
|
|
Hans de Goede |
56753f |
(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
56753f |
@@ -223,11 +236,13 @@ static void qxl_spice_destroy_surfaces(PCIQXLDevice *qxl, qxl_async_io async)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qxl_spice_reset_image_cache(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_reset_image_cache(qxl->id);
|
|
Hans de Goede |
56753f |
qxl->ssd.worker->reset_image_cache(qxl->ssd.worker);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qxl_spice_reset_cursor(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qxl_spice_reset_cursor(qxl->id);
|
|
Hans de Goede |
56753f |
qxl->ssd.worker->reset_cursor(qxl->ssd.worker);
|
|
Hans de Goede |
56753f |
qemu_mutex_lock(&qxl->track_lock);
|
|
Hans de Goede |
56753f |
qxl->guest_cursor = 0;
|
|
Hans de Goede |
56753f |
@@ -412,7 +427,7 @@ static void interface_attach_worker(QXLInstance *sin, QXLWorker *qxl_worker)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "%s:\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_attach_worker(qxl->id);
|
|
Hans de Goede |
56753f |
qxl->ssd.worker = qxl_worker;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -420,7 +435,7 @@ static void interface_set_compression_level(QXLInstance *sin, int level)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "%s: %d\n", __FUNCTION__, level);
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_set_compression_level(qxl->id, level);
|
|
Hans de Goede |
56753f |
qxl->shadow_rom.compression_level = cpu_to_le32(level);
|
|
Hans de Goede |
56753f |
qxl->rom->compression_level = cpu_to_le32(level);
|
|
Hans de Goede |
56753f |
qxl_rom_set_dirty(qxl);
|
|
Hans de Goede |
56753f |
@@ -430,6 +445,7 @@ static void interface_set_mm_time(QXLInstance *sin, uint32_t mm_time)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_set_mm_time(qxl->id, mm_time);
|
|
Hans de Goede |
56753f |
qxl->shadow_rom.mm_clock = cpu_to_le32(mm_time);
|
|
Hans de Goede |
56753f |
qxl->rom->mm_clock = cpu_to_le32(mm_time);
|
|
Hans de Goede |
56753f |
qxl_rom_set_dirty(qxl);
|
|
Hans de Goede |
56753f |
@@ -439,7 +455,7 @@ static void interface_get_init_info(QXLInstance *sin, QXLDevInitInfo *info)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "%s:\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_get_init_info(qxl->id);
|
|
Hans de Goede |
56753f |
info->memslot_gen_bits = MEMSLOT_GENERATION_BITS;
|
|
Hans de Goede |
56753f |
info->memslot_id_bits = MEMSLOT_SLOT_BITS;
|
|
Hans de Goede |
56753f |
info->num_memslots = NUM_MEMSLOTS;
|
|
Hans de Goede |
56753f |
@@ -508,9 +524,10 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
|
|
Hans de Goede |
56753f |
QXLCommand *cmd;
|
|
Hans de Goede |
56753f |
int notify, ret;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_command_check(qxl->id, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
+
|
|
Hans de Goede |
56753f |
switch (qxl->mode) {
|
|
Hans de Goede |
56753f |
case QXL_MODE_VGA:
|
|
Hans de Goede |
56753f |
- dprint(qxl, 2, "%s: vga\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
ret = false;
|
|
Hans de Goede |
56753f |
qemu_mutex_lock(&qxl->ssd.lock);
|
|
Hans de Goede |
56753f |
if (qxl->ssd.update != NULL) {
|
|
Hans de Goede |
56753f |
@@ -521,19 +538,18 @@ static int interface_get_command(QXLInstance *sin, struct QXLCommandExt *ext)
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
qemu_mutex_unlock(&qxl->ssd.lock);
|
|
Hans de Goede |
56753f |
if (ret) {
|
|
Hans de Goede |
56753f |
- dprint(qxl, 2, "%s %s\n", __FUNCTION__, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_command_get(qxl->id, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
qxl_log_command(qxl, "vga", ext);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
return ret;
|
|
Hans de Goede |
56753f |
case QXL_MODE_COMPAT:
|
|
Hans de Goede |
56753f |
case QXL_MODE_NATIVE:
|
|
Hans de Goede |
56753f |
case QXL_MODE_UNDEFINED:
|
|
Hans de Goede |
56753f |
- dprint(qxl, 4, "%s: %s\n", __FUNCTION__, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
ring = &qxl->ram->cmd_ring;
|
|
Hans de Goede |
56753f |
if (SPICE_RING_IS_EMPTY(ring)) {
|
|
Hans de Goede |
56753f |
return false;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(qxl, 2, "%s: %s\n", __FUNCTION__, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_command_get(qxl->id, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
SPICE_RING_CONS_ITEM(ring, cmd);
|
|
Hans de Goede |
56753f |
ext->cmd = *cmd;
|
|
Hans de Goede |
56753f |
ext->group_id = MEMSLOT_GROUP_GUEST;
|
|
Hans de Goede |
56753f |
@@ -558,6 +574,7 @@ static int interface_req_cmd_notification(QXLInstance *sin)
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
|
Hans de Goede |
56753f |
int wait = 1;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_command_req_notification(qxl->id);
|
|
Hans de Goede |
56753f |
switch (qxl->mode) {
|
|
Hans de Goede |
56753f |
case QXL_MODE_COMPAT:
|
|
Hans de Goede |
56753f |
case QXL_MODE_NATIVE:
|
|
Hans de Goede |
56753f |
@@ -595,10 +612,11 @@ static inline void qxl_push_free_res(PCIQXLDevice *d, int flush)
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
SPICE_RING_PUSH(ring, notify);
|
|
Hans de Goede |
56753f |
- dprint(d, 2, "free: push %d items, notify %s, ring %d/%d [%d,%d]\n",
|
|
Hans de Goede |
56753f |
- d->num_free_res, notify ? "yes" : "no",
|
|
Hans de Goede |
56753f |
- ring->prod - ring->cons, ring->num_items,
|
|
Hans de Goede |
56753f |
- ring->prod, ring->cons);
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_res_push(d->id, qxl_mode_to_string(d->mode),
|
|
Hans de Goede |
56753f |
+ d->guest_surfaces.count, d->num_free_res,
|
|
Hans de Goede |
56753f |
+ d->last_release, notify ? "yes" : "no");
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_res_push_rest(d->id, ring->prod - ring->cons,
|
|
Hans de Goede |
56753f |
+ ring->num_items, ring->prod, ring->cons);
|
|
Hans de Goede |
56753f |
if (notify) {
|
|
Hans de Goede |
56753f |
qxl_send_events(d, QXL_INTERRUPT_DISPLAY);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -645,7 +663,7 @@ static void interface_release_resource(QXLInstance *sin,
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
qxl->last_release = ext.info;
|
|
Hans de Goede |
56753f |
qxl->num_free_res++;
|
|
Hans de Goede |
56753f |
- dprint(qxl, 3, "%4d\r", qxl->num_free_res);
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_res_put(qxl->id, qxl->num_free_res);
|
|
Hans de Goede |
56753f |
qxl_push_free_res(qxl, 0);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -657,6 +675,8 @@ static int interface_get_cursor_command(QXLInstance *sin, struct QXLCommandExt *
|
|
Hans de Goede |
56753f |
QXLCommand *cmd;
|
|
Hans de Goede |
56753f |
int notify;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_cursor_check(qxl->id, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
+
|
|
Hans de Goede |
56753f |
switch (qxl->mode) {
|
|
Hans de Goede |
56753f |
case QXL_MODE_COMPAT:
|
|
Hans de Goede |
56753f |
case QXL_MODE_NATIVE:
|
|
Hans de Goede |
56753f |
@@ -680,6 +700,7 @@ static int interface_get_cursor_command(QXLInstance *sin, struct QXLCommandExt *
|
|
Hans de Goede |
56753f |
if (qxl->id == 0) {
|
|
Hans de Goede |
56753f |
qxl_render_cursor(qxl, ext);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_cursor_get(qxl->id, qxl_mode_to_string(qxl->mode));
|
|
Hans de Goede |
56753f |
return true;
|
|
Hans de Goede |
56753f |
default:
|
|
Hans de Goede |
56753f |
return false;
|
|
Hans de Goede |
56753f |
@@ -692,6 +713,7 @@ static int interface_req_cursor_notification(QXLInstance *sin)
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
|
Hans de Goede |
56753f |
int wait = 1;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ trace_qxl_ring_cursor_req_notification(qxl->id);
|
|
Hans de Goede |
56753f |
switch (qxl->mode) {
|
|
Hans de Goede |
56753f |
case QXL_MODE_COMPAT:
|
|
Hans de Goede |
56753f |
case QXL_MODE_NATIVE:
|
|
Hans de Goede |
56753f |
@@ -719,7 +741,6 @@ static int interface_flush_resources(QXLInstance *sin)
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(sin, PCIQXLDevice, ssd.qxl);
|
|
Hans de Goede |
56753f |
int ret;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "free: guest flush (have %d)\n", qxl->num_free_res);
|
|
Hans de Goede |
56753f |
ret = qxl->num_free_res;
|
|
Hans de Goede |
56753f |
if (ret) {
|
|
Hans de Goede |
56753f |
qxl_push_free_res(qxl, 1);
|
|
Hans de Goede |
56753f |
@@ -739,7 +760,7 @@ static void interface_async_complete_io(PCIQXLDevice *qxl, QXLCookie *cookie)
|
|
Hans de Goede |
56753f |
qxl->current_async = QXL_UNDEFINED_IO;
|
|
Hans de Goede |
56753f |
qemu_mutex_unlock(&qxl->async_lock);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(qxl, 2, "async_complete: %d (%p) done\n", current_async, cookie);
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_async_complete_io(qxl->id, current_async, cookie);
|
|
Hans de Goede |
56753f |
if (!cookie) {
|
|
Hans de Goede |
56753f |
fprintf(stderr, "qxl: %s: error, cookie is NULL\n", __func__);
|
|
Hans de Goede |
56753f |
return;
|
|
Hans de Goede |
56753f |
@@ -785,11 +806,15 @@ static void interface_update_area_complete(QXLInstance *sin,
|
|
Hans de Goede |
56753f |
qemu_mutex_unlock(&qxl->ssd.lock);
|
|
Hans de Goede |
56753f |
return;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_update_area_complete(qxl->id, surface_id, dirty->left,
|
|
Hans de Goede |
56753f |
+ dirty->right, dirty->top, dirty->bottom);
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_update_area_complete_rest(qxl->id, num_updated_rects);
|
|
Hans de Goede |
56753f |
if (qxl->num_dirty_rects + num_updated_rects > QXL_NUM_DIRTY_RECTS) {
|
|
Hans de Goede |
56753f |
/*
|
|
Hans de Goede |
56753f |
* overflow - treat this as a full update. Not expected to be common.
|
|
Hans de Goede |
56753f |
*/
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "%s: overflow of dirty rects\n", __func__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_update_area_complete_overflow(qxl->id,
|
|
Hans de Goede |
56753f |
+ QXL_NUM_DIRTY_RECTS);
|
|
Hans de Goede |
56753f |
qxl->guest_primary.resized = 1;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
if (qxl->guest_primary.resized) {
|
|
Hans de Goede |
56753f |
@@ -805,8 +830,8 @@ static void interface_update_area_complete(QXLInstance *sin,
|
|
Hans de Goede |
56753f |
qxl->dirty[qxl_i++] = dirty[i];
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
qxl->num_dirty_rects += num_updated_rects;
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "%s: scheduling update_area_bh, #dirty %d\n",
|
|
Hans de Goede |
56753f |
- __func__, qxl->num_dirty_rects);
|
|
Hans de Goede |
56753f |
+ trace_qxl_interface_update_area_complete_schedule_bh(qxl->id,
|
|
Hans de Goede |
56753f |
+ qxl->num_dirty_rects);
|
|
Hans de Goede |
56753f |
qemu_bh_schedule(qxl->update_area_bh);
|
|
Hans de Goede |
56753f |
qemu_mutex_unlock(&qxl->ssd.lock);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -860,7 +885,7 @@ static void qxl_enter_vga_mode(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
if (d->mode == QXL_MODE_VGA) {
|
|
Hans de Goede |
56753f |
return;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_enter_vga_mode(d->id);
|
|
Hans de Goede |
56753f |
qemu_spice_create_host_primary(&d->ssd);
|
|
Hans de Goede |
56753f |
d->mode = QXL_MODE_VGA;
|
|
Hans de Goede |
56753f |
memset(&d->ssd.dirty, 0, sizeof(d->ssd.dirty));
|
|
Hans de Goede |
56753f |
@@ -871,7 +896,7 @@ static void qxl_exit_vga_mode(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
if (d->mode != QXL_MODE_VGA) {
|
|
Hans de Goede |
56753f |
return;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_exit_vga_mode(d->id);
|
|
Hans de Goede |
56753f |
qxl_destroy_primary(d, QXL_SYNC);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -908,7 +933,7 @@ static void qxl_reset_state(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_soft_reset(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s:\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_soft_reset(d->id);
|
|
Hans de Goede |
56753f |
qxl_check_state(d);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
if (d->id == 0) {
|
|
Hans de Goede |
56753f |
@@ -920,8 +945,7 @@ static void qxl_soft_reset(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_hard_reset(PCIQXLDevice *d, int loadvm)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: start%s\n", __FUNCTION__,
|
|
Hans de Goede |
56753f |
- loadvm ? " (loadvm)" : "");
|
|
Hans de Goede |
56753f |
+ trace_qxl_hard_reset(d->id, loadvm);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
qxl_spice_reset_cursor(d);
|
|
Hans de Goede |
56753f |
qxl_spice_reset_image_cache(d);
|
|
Hans de Goede |
56753f |
@@ -936,13 +960,12 @@ static void qxl_hard_reset(PCIQXLDevice *d, int loadvm)
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
qemu_spice_create_host_memslot(&d->ssd);
|
|
Hans de Goede |
56753f |
qxl_soft_reset(d);
|
|
Hans de Goede |
56753f |
-
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: done\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_reset_handler(DeviceState *dev)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
PCIQXLDevice *d = DO_UPCAST(PCIQXLDevice, pci.qdev, dev);
|
|
Hans de Goede |
56753f |
+
|
|
Hans de Goede |
56753f |
qxl_hard_reset(d, 0);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -951,8 +974,8 @@ static void qxl_vga_ioport_write(void *opaque, uint32_t addr, uint32_t val)
|
|
Hans de Goede |
56753f |
VGACommonState *vga = opaque;
|
|
Hans de Goede |
56753f |
PCIQXLDevice *qxl = container_of(vga, PCIQXLDevice, vga);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
+ trace_qxl_io_write_vga(qxl->id, qxl_mode_to_string(qxl->mode), addr, val);
|
|
Hans de Goede |
56753f |
if (qxl->mode != QXL_MODE_VGA) {
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "%s\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
qxl_destroy_primary(qxl, QXL_SYNC);
|
|
Hans de Goede |
56753f |
qxl_soft_reset(qxl);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -992,9 +1015,7 @@ static void qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
|
|
Hans de Goede |
56753f |
guest_start = le64_to_cpu(d->guest_slots[slot_id].slot.mem_start);
|
|
Hans de Goede |
56753f |
guest_end = le64_to_cpu(d->guest_slots[slot_id].slot.mem_end);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: slot %d: guest phys 0x%" PRIx64 " - 0x%" PRIx64 "\n",
|
|
Hans de Goede |
56753f |
- __FUNCTION__, slot_id,
|
|
Hans de Goede |
56753f |
- guest_start, guest_end);
|
|
Hans de Goede |
56753f |
+ trace_qxl_memslot_add_guest(d->id, slot_id, guest_start, guest_end);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
PANIC_ON(slot_id >= NUM_MEMSLOTS);
|
|
Hans de Goede |
56753f |
PANIC_ON(guest_start > guest_end);
|
|
Hans de Goede |
56753f |
@@ -1040,10 +1061,6 @@ static void qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
|
|
Hans de Goede |
56753f |
memslot.generation = d->rom->slot_generation = 0;
|
|
Hans de Goede |
56753f |
qxl_rom_set_dirty(d);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: slot %d: host virt 0x%lx - 0x%lx\n",
|
|
Hans de Goede |
56753f |
- __FUNCTION__, memslot.slot_id,
|
|
Hans de Goede |
56753f |
- memslot.virt_start, memslot.virt_end);
|
|
Hans de Goede |
56753f |
-
|
|
Hans de Goede |
56753f |
qemu_spice_add_memslot(&d->ssd, &memslot, async);
|
|
Hans de Goede |
56753f |
d->guest_slots[slot_id].ptr = (void*)memslot.virt_start;
|
|
Hans de Goede |
56753f |
d->guest_slots[slot_id].size = memslot.virt_end - memslot.virt_start;
|
|
Hans de Goede |
56753f |
@@ -1053,21 +1070,19 @@ static void qxl_add_memslot(PCIQXLDevice *d, uint32_t slot_id, uint64_t delta,
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_del_memslot(PCIQXLDevice *d, uint32_t slot_id)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: slot %d\n", __FUNCTION__, slot_id);
|
|
Hans de Goede |
56753f |
qemu_spice_del_memslot(&d->ssd, MEMSLOT_GROUP_HOST, slot_id);
|
|
Hans de Goede |
56753f |
d->guest_slots[slot_id].active = 0;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_reset_memslots(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s:\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
qxl_spice_reset_memslots(d);
|
|
Hans de Goede |
56753f |
memset(&d->guest_slots, 0, sizeof(d->guest_slots));
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
static void qxl_reset_surfaces(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s:\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_reset_surfaces(d->id);
|
|
Hans de Goede |
56753f |
d->mode = QXL_MODE_UNDEFINED;
|
|
Hans de Goede |
56753f |
qxl_spice_destroy_surfaces(d, QXL_SYNC);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -1109,9 +1124,6 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm,
|
|
Hans de Goede |
56753f |
assert(qxl->mode != QXL_MODE_NATIVE);
|
|
Hans de Goede |
56753f |
qxl_exit_vga_mode(qxl);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(qxl, 1, "%s: %dx%d\n", __FUNCTION__,
|
|
Hans de Goede |
56753f |
- le32_to_cpu(sc->width), le32_to_cpu(sc->height));
|
|
Hans de Goede |
56753f |
-
|
|
Hans de Goede |
56753f |
surface.format = le32_to_cpu(sc->format);
|
|
Hans de Goede |
56753f |
surface.height = le32_to_cpu(sc->height);
|
|
Hans de Goede |
56753f |
surface.mem = le64_to_cpu(sc->mem);
|
|
Hans de Goede |
56753f |
@@ -1120,6 +1132,10 @@ static void qxl_create_guest_primary(PCIQXLDevice *qxl, int loadvm,
|
|
Hans de Goede |
56753f |
surface.width = le32_to_cpu(sc->width);
|
|
Hans de Goede |
56753f |
surface.type = le32_to_cpu(sc->type);
|
|
Hans de Goede |
56753f |
surface.flags = le32_to_cpu(sc->flags);
|
|
Hans de Goede |
56753f |
+ trace_qxl_create_guest_primary(qxl->id, sc->width, sc->height, sc->mem,
|
|
Hans de Goede |
56753f |
+ sc->format, sc->position);
|
|
Hans de Goede |
56753f |
+ trace_qxl_create_guest_primary_rest(qxl->id, sc->stride, sc->type,
|
|
Hans de Goede |
56753f |
+ sc->flags);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
surface.mouse_mode = true;
|
|
Hans de Goede |
56753f |
surface.group_id = MEMSLOT_GROUP_GUEST;
|
|
Hans de Goede |
56753f |
@@ -1143,7 +1159,7 @@ static int qxl_destroy_primary(PCIQXLDevice *d, qxl_async_io async)
|
|
Hans de Goede |
56753f |
if (d->mode == QXL_MODE_UNDEFINED) {
|
|
Hans de Goede |
56753f |
return 0;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_destroy_primary(d->id);
|
|
Hans de Goede |
56753f |
d->mode = QXL_MODE_UNDEFINED;
|
|
Hans de Goede |
56753f |
qemu_spice_destroy_primary_surface(&d->ssd, 0, async);
|
|
Hans de Goede |
56753f |
qxl_spice_reset_cursor(d);
|
|
Hans de Goede |
56753f |
@@ -1170,8 +1186,8 @@ static void qxl_set_mode(PCIQXLDevice *d, int modenr, int loadvm)
|
|
Hans de Goede |
56753f |
.mem = devmem + d->shadow_rom.draw_area_offset,
|
|
Hans de Goede |
56753f |
};
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: mode %d [ %d x %d @ %d bpp devmem 0x%" PRIx64 " ]\n",
|
|
Hans de Goede |
56753f |
- __func__, modenr, mode->x_res, mode->y_res, mode->bits, devmem);
|
|
Hans de Goede |
56753f |
+ trace_qxl_set_mode(d->id, modenr, mode->x_res, mode->y_res, mode->bits,
|
|
Hans de Goede |
56753f |
+ devmem);
|
|
Hans de Goede |
56753f |
if (!loadvm) {
|
|
Hans de Goede |
56753f |
qxl_hard_reset(d, 0);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -1217,8 +1233,8 @@ static void ioport_write(void *opaque, target_phys_addr_t addr,
|
|
Hans de Goede |
56753f |
if (d->mode != QXL_MODE_VGA) {
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: unexpected port 0x%x (%s) in vga mode\n",
|
|
Hans de Goede |
56753f |
- __func__, io_port, io_port_to_string(io_port));
|
|
Hans de Goede |
56753f |
+ trace_qxl_io_unexpected_vga_mode(d->id,
|
|
Hans de Goede |
56753f |
+ io_port, io_port_to_string(io_port));
|
|
Hans de Goede |
56753f |
/* be nice to buggy guest drivers */
|
|
Hans de Goede |
56753f |
if (io_port >= QXL_IO_UPDATE_AREA_ASYNC &&
|
|
Hans de Goede |
56753f |
io_port <= QXL_IO_DESTROY_ALL_SURFACES_ASYNC) {
|
|
Hans de Goede |
56753f |
@@ -1260,11 +1276,12 @@ async_common:
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
d->current_async = orig_io_port;
|
|
Hans de Goede |
56753f |
qemu_mutex_unlock(&d->async_lock);
|
|
Hans de Goede |
56753f |
- dprint(d, 2, "start async %d (%"PRId64")\n", io_port, val);
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
default:
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
+ trace_qxl_io_write(d->id, qxl_mode_to_string(d->mode), addr, val, size,
|
|
Hans de Goede |
56753f |
+ async);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
switch (io_port) {
|
|
Hans de Goede |
56753f |
case QXL_IO_UPDATE_AREA:
|
|
Hans de Goede |
56753f |
@@ -1300,7 +1317,6 @@ async_common:
|
|
Hans de Goede |
56753f |
d->oom_running = 0;
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
case QXL_IO_SET_MODE:
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "QXL_SET_MODE %d\n", (int)val);
|
|
Hans de Goede |
56753f |
qxl_set_mode(d, val, 0);
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
case QXL_IO_LOG:
|
|
Hans de Goede |
56753f |
@@ -1310,7 +1326,6 @@ async_common:
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
case QXL_IO_RESET:
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "QXL_IO_RESET\n");
|
|
Hans de Goede |
56753f |
qxl_hard_reset(d, 0);
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
case QXL_IO_MEMSLOT_ADD:
|
|
Hans de Goede |
56753f |
@@ -1338,7 +1353,6 @@ async_common:
|
|
Hans de Goede |
56753f |
async);
|
|
Hans de Goede |
56753f |
goto cancel_async;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "QXL_IO_CREATE_PRIMARY async=%d\n", async);
|
|
Hans de Goede |
56753f |
d->guest_primary.surface = d->ram->create_surface;
|
|
Hans de Goede |
56753f |
qxl_create_guest_primary(d, 0, async);
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
@@ -1348,11 +1362,9 @@ async_common:
|
|
Hans de Goede |
56753f |
async);
|
|
Hans de Goede |
56753f |
goto cancel_async;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "QXL_IO_DESTROY_PRIMARY (async=%d) (%s)\n", async,
|
|
Hans de Goede |
56753f |
- qxl_mode_to_string(d->mode));
|
|
Hans de Goede |
56753f |
if (!qxl_destroy_primary(d, async)) {
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "QXL_IO_DESTROY_PRIMARY_ASYNC in %s, ignored\n",
|
|
Hans de Goede |
56753f |
- qxl_mode_to_string(d->mode));
|
|
Hans de Goede |
56753f |
+ trace_qxl_io_destroy_primary_ignored(d->id,
|
|
Hans de Goede |
56753f |
+ qxl_mode_to_string(d->mode));
|
|
Hans de Goede |
56753f |
goto cancel_async;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
@@ -1372,16 +1384,9 @@ async_common:
|
|
Hans de Goede |
56753f |
ring->prod, ring->cons);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
qxl_push_free_res(d, 1 /* flush */);
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "QXL_IO_FLUSH_RELEASE exit (%s, s#=%d, res#=%d,%p)\n",
|
|
Hans de Goede |
56753f |
- qxl_mode_to_string(d->mode), d->guest_surfaces.count,
|
|
Hans de Goede |
56753f |
- d->num_free_res, d->last_release);
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
case QXL_IO_FLUSH_SURFACES_ASYNC:
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "QXL_IO_FLUSH_SURFACES_ASYNC"
|
|
Hans de Goede |
56753f |
- " (%"PRId64") (%s, s#=%d, res#=%d)\n",
|
|
Hans de Goede |
56753f |
- val, qxl_mode_to_string(d->mode), d->guest_surfaces.count,
|
|
Hans de Goede |
56753f |
- d->num_free_res);
|
|
Hans de Goede |
56753f |
qxl_spice_flush_surfaces_async(d);
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
case QXL_IO_DESTROY_ALL_SURFACES:
|
|
Hans de Goede |
56753f |
@@ -1407,7 +1412,7 @@ static uint64_t ioport_read(void *opaque, target_phys_addr_t addr,
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
PCIQXLDevice *d = opaque;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: unexpected\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_io_read_unexpected(d->id);
|
|
Hans de Goede |
56753f |
return 0xff;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -1558,8 +1563,7 @@ static void qxl_dirty_surfaces(PCIQXLDevice *qxl)
|
|
Hans de Goede |
56753f |
surface_offset -= vram_start;
|
|
Hans de Goede |
56753f |
surface_size = cmd->u.surface_create.height *
|
|
Hans de Goede |
56753f |
abs(cmd->u.surface_create.stride);
|
|
Hans de Goede |
56753f |
- dprint(qxl, 3, "%s: dirty surface %d, offset %d, size %d\n", __func__,
|
|
Hans de Goede |
56753f |
- i, (int)surface_offset, surface_size);
|
|
Hans de Goede |
56753f |
+ trace_qxl_surfaces_dirty(qxl->id, i, (int)surface_offset, surface_size);
|
|
Hans de Goede |
56753f |
qxl_set_dirty(&qxl->vram_bar, surface_offset, surface_size);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -1759,7 +1763,7 @@ static void qxl_pre_save(void *opaque)
|
|
Hans de Goede |
56753f |
PCIQXLDevice* d = opaque;
|
|
Hans de Goede |
56753f |
uint8_t *ram_start = d->vga.vram_ptr;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s:\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_pre_save(d->id);
|
|
Hans de Goede |
56753f |
if (d->last_release == NULL) {
|
|
Hans de Goede |
56753f |
d->last_release_offset = 0;
|
|
Hans de Goede |
56753f |
} else {
|
|
Hans de Goede |
56753f |
@@ -1772,10 +1776,9 @@ static int qxl_pre_load(void *opaque)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
PCIQXLDevice* d = opaque;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: start\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
+ trace_qxl_pre_load(d->id);
|
|
Hans de Goede |
56753f |
qxl_hard_reset(d, 1);
|
|
Hans de Goede |
56753f |
qxl_exit_vga_mode(d);
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: done\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
return 0;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -1787,7 +1790,6 @@ static void qxl_create_memslots(PCIQXLDevice *d)
|
|
Hans de Goede |
56753f |
if (!d->guest_slots[i].active) {
|
|
Hans de Goede |
56753f |
continue;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: restoring guest slot %d\n", __func__, i);
|
|
Hans de Goede |
56753f |
qxl_add_memslot(d, i, 0, QXL_SYNC);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
@@ -1799,8 +1801,6 @@ static int qxl_post_load(void *opaque, int version)
|
|
Hans de Goede |
56753f |
QXLCommandExt *cmds;
|
|
Hans de Goede |
56753f |
int in, out, newmode;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: start\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
-
|
|
Hans de Goede |
56753f |
assert(d->last_release_offset < d->vga.vram_size);
|
|
Hans de Goede |
56753f |
if (d->last_release_offset == 0) {
|
|
Hans de Goede |
56753f |
d->last_release = NULL;
|
|
Hans de Goede |
56753f |
@@ -1810,8 +1810,7 @@ static int qxl_post_load(void *opaque, int version)
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
d->modes = (QXLModes*)((uint8_t*)d->rom + d->rom->modes_offset);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: restore mode (%s)\n", __FUNCTION__,
|
|
Hans de Goede |
56753f |
- qxl_mode_to_string(d->mode));
|
|
Hans de Goede |
56753f |
+ trace_qxl_post_load(d->id, qxl_mode_to_string(d->mode));
|
|
Hans de Goede |
56753f |
newmode = d->mode;
|
|
Hans de Goede |
56753f |
d->mode = QXL_MODE_UNDEFINED;
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -1853,8 +1852,6 @@ static int qxl_post_load(void *opaque, int version)
|
|
Hans de Goede |
56753f |
qxl_set_mode(d, d->shadow_rom.mode, 1);
|
|
Hans de Goede |
56753f |
break;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
- dprint(d, 1, "%s: done\n", __FUNCTION__);
|
|
Hans de Goede |
56753f |
-
|
|
Hans de Goede |
56753f |
return 0;
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
diff --git a/trace-events b/trace-events
|
|
Hans de Goede |
56753f |
index 962caca..0bc290f 100644
|
|
Hans de Goede |
56753f |
--- a/trace-events
|
|
Hans de Goede |
56753f |
+++ b/trace-events
|
|
Hans de Goede |
56753f |
@@ -631,3 +631,62 @@ win_helper_no_switch_pstate(uint32_t new_pstate_regs) "change_pstate: regs new=%
|
|
Hans de Goede |
56753f |
win_helper_wrpil(uint32_t psrpil, uint32_t new_pil) "old=%x new=%x"
|
|
Hans de Goede |
56753f |
win_helper_done(uint32_t tl) "tl=%d"
|
|
Hans de Goede |
56753f |
win_helper_retry(uint32_t tl) "tl=%d"
|
|
Hans de Goede |
56753f |
+
|
|
Hans de Goede |
56753f |
+# hw/qxl.c
|
|
Hans de Goede |
56753f |
+disable qxl_interface_set_mm_time(int qid, uint32_t mm_time) "%d %d"
|
|
Hans de Goede |
56753f |
+disable qxl_io_write_vga(int qid, const char *mode, uint32_t addr, uint32_t val) "%d %s addr=%u val=%u"
|
|
Hans de Goede |
56753f |
+qxl_create_guest_primary(int qid, uint32_t width, uint32_t height, uint64_t mem, uint32_t format, uint32_t position) "%d %dx%d mem=%lx %d,%d"
|
|
Hans de Goede |
56753f |
+qxl_create_guest_primary_rest(int qid, int32_t stride, uint32_t type, uint32_t flags) "%d %d,%d,%d"
|
|
Hans de Goede |
56753f |
+qxl_destroy_primary(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_enter_vga_mode(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_exit_vga_mode(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_hard_reset(int qid, int64_t loadvm) "%d loadvm=%"PRId64""
|
|
Hans de Goede |
56753f |
+qxl_interface_async_complete_io(int qid, uint32_t current_async, void *cookie) "%d current=%d cookie=%p"
|
|
Hans de Goede |
56753f |
+qxl_interface_attach_worker(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_interface_get_init_info(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_interface_set_compression_level(int qid, int64_t level) "%d %"PRId64
|
|
Hans de Goede |
56753f |
+qxl_interface_update_area_complete(int qid, uint32_t surface_id, uint32_t dirty_left, uint32_t dirty_right, uint32_t dirty_top, uint32_t dirty_bottom) "%d surface=%d [%d,%d,%d,%d]"
|
|
Hans de Goede |
56753f |
+qxl_interface_update_area_complete_rest(int qid, uint32_t num_updated_rects) "%d #=%d"
|
|
Hans de Goede |
56753f |
+qxl_interface_update_area_complete_overflow(int qid, int max) "%d max=%d"
|
|
Hans de Goede |
56753f |
+qxl_interface_update_area_complete_schedule_bh(int qid, uint32_t num_dirty) "%d #dirty=%d"
|
|
Hans de Goede |
56753f |
+qxl_io_destroy_primary_ignored(int qid, const char *mode) "%d %s"
|
|
Hans de Goede |
56753f |
+qxl_io_read_unexpected(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_io_unexpected_vga_mode(int qid, uint32_t io_port, const char *desc) "%d 0x%x (%s)"
|
|
Hans de Goede |
56753f |
+qxl_io_write(int qid, const char *mode, uint64_t addr, uint64_t val, unsigned size, int async) "%d %s addr=%"PRIu64 " val=%"PRIu64" size=%u async=%d"
|
|
Hans de Goede |
56753f |
+qxl_memslot_add_guest(int qid, uint32_t slot_id, uint64_t guest_start, uint64_t guest_end) "%d %u: guest phys 0x%"PRIx64 " - 0x%" PRIx64
|
|
Hans de Goede |
56753f |
+qxl_post_load(int qid, const char *mode) "%d %s"
|
|
Hans de Goede |
56753f |
+qxl_pre_load(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_pre_save(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_reset_surfaces(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_ring_command_check(int qid, const char *mode) "%d %s"
|
|
Hans de Goede |
56753f |
+qxl_ring_command_get(int qid, const char *mode) "%d %s"
|
|
Hans de Goede |
56753f |
+qxl_ring_command_req_notification(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_ring_cursor_check(int qid, const char *mode) "%d %s"
|
|
Hans de Goede |
56753f |
+qxl_ring_cursor_get(int qid, const char *mode) "%d %s"
|
|
Hans de Goede |
56753f |
+qxl_ring_cursor_req_notification(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_ring_res_push(int qid, const char *mode, uint32_t surface_count, uint32_t free_res, void *last_release, const char *notify) "%d %s s#=%d res#=%d last=%p notify=%s"
|
|
Hans de Goede |
56753f |
+qxl_ring_res_push_rest(int qid, uint32_t ring_has, uint32_t ring_size, uint32_t prod, uint32_t cons) "%d ring %d/%d [%d,%d]"
|
|
Hans de Goede |
56753f |
+qxl_ring_res_put(int qid, uint32_t free_res) "%d #res=%d"
|
|
Hans de Goede |
56753f |
+qxl_set_mode(int qid, int modenr, uint32_t x_res, uint32_t y_res, uint32_t bits, uint64_t devmem) "%d mode=%d [ x=%d y=%d @ bpp=%d devmem=0x%" PRIx64 " ]"
|
|
Hans de Goede |
56753f |
+qxl_soft_reset(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qemu_spice_add_memslot(int qid, uint32_t slot_id, unsigned long virt_start, unsigned long virt_end, int async) "%d %u: host virt 0x%lx - 0x%lx async=%d"
|
|
Hans de Goede |
56753f |
+qemu_spice_del_memslot(int qid, uint32_t gid, uint32_t slot_id) "%d gid=%u sid=%u"
|
|
Hans de Goede |
56753f |
+qemu_spice_create_primary_surface(int qid, uint32_t sid, void *surface, int async) "%d sid=%u surface=%p async=%d"
|
|
Hans de Goede |
56753f |
+qemu_spice_destroy_primary_surface(int qid, uint32_t sid, int async) "%d sid=%u async=%d"
|
|
Hans de Goede |
56753f |
+qemu_spice_wakeup(uint32_t qid) "%d"
|
|
Hans de Goede |
56753f |
+qemu_spice_start(uint32_t qid) "%d"
|
|
Hans de Goede |
56753f |
+qemu_spice_stop(uint32_t qid) "%d"
|
|
Hans de Goede |
56753f |
+qemu_spice_create_update(uint32_t left, uint32_t right, uint32_t top, uint32_t bottom) "lr %d -> %d, tb -> %d -> %d"
|
|
Hans de Goede |
56753f |
+qxl_spice_destroy_surfaces_complete(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_destroy_surfaces(int qid, int async) "%d async=%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_destroy_surface_wait_complete(int qid, uint32_t id) "%d sid=%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_destroy_surface_wait(int qid, uint32_t id, int async) "%d sid=%d async=%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_flush_surfaces_async(int qid, uint32_t surface_count, uint32_t num_free_res) "%d s#=%d, res#=%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_loadvm_commands(int qid, void *ext, uint32_t count) "%d ext=%p count=%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_oom(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_reset_cursor(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_reset_image_cache(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_reset_memslots(int qid) "%d"
|
|
Hans de Goede |
56753f |
+qxl_spice_update_area(int qid, uint32_t surface_id, uint32_t left, uint32_t right, uint32_t top, uint32_t bottom) "%d sid=%d [%d,%d,%d,%d]"
|
|
Hans de Goede |
56753f |
+qxl_spice_update_area_rest(int qid, uint32_t num_dirty_rects, uint32_t clear_dirty_region) "%d #d=%d clear=%d"
|
|
Hans de Goede |
56753f |
+qxl_surfaces_dirty(int qid, int surface, int offset, int size) "%d surface=%d offset=%d size=%d"
|
|
Hans de Goede |
56753f |
diff --git a/ui/spice-display.c b/ui/spice-display.c
|
|
Hans de Goede |
56753f |
index ab266ae..28d6d4a 100644
|
|
Hans de Goede |
56753f |
--- a/ui/spice-display.c
|
|
Hans de Goede |
56753f |
+++ b/ui/spice-display.c
|
|
Hans de Goede |
56753f |
@@ -22,6 +22,7 @@
|
|
Hans de Goede |
56753f |
#include "monitor.h"
|
|
Hans de Goede |
56753f |
#include "console.h"
|
|
Hans de Goede |
56753f |
#include "sysemu.h"
|
|
Hans de Goede |
56753f |
+#include "trace.h"
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
#include "spice-display.h"
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -73,6 +74,10 @@ QXLCookie *qxl_cookie_new(int type, uint64_t io)
|
|
Hans de Goede |
56753f |
void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot,
|
|
Hans de Goede |
56753f |
qxl_async_io async)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_add_memslot(ssd->qxl.id, memslot->slot_id,
|
|
Hans de Goede |
56753f |
+ memslot->virt_start, memslot->virt_end,
|
|
Hans de Goede |
56753f |
+ async);
|
|
Hans de Goede |
56753f |
+
|
|
Hans de Goede |
56753f |
if (async != QXL_SYNC) {
|
|
Hans de Goede |
56753f |
spice_qxl_add_memslot_async(&ssd->qxl, memslot,
|
|
Hans de Goede |
56753f |
(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
56753f |
@@ -84,6 +89,7 @@ void qemu_spice_add_memslot(SimpleSpiceDisplay *ssd, QXLDevMemSlot *memslot,
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qemu_spice_del_memslot(SimpleSpiceDisplay *ssd, uint32_t gid, uint32_t sid)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_del_memslot(ssd->qxl.id, gid, sid);
|
|
Hans de Goede |
56753f |
ssd->worker->del_memslot(ssd->worker, gid, sid);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -91,6 +97,7 @@ void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id,
|
|
Hans de Goede |
56753f |
QXLDevSurfaceCreate *surface,
|
|
Hans de Goede |
56753f |
qxl_async_io async)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_create_primary_surface(ssd->qxl.id, id, surface, async);
|
|
Hans de Goede |
56753f |
if (async != QXL_SYNC) {
|
|
Hans de Goede |
56753f |
spice_qxl_create_primary_surface_async(&ssd->qxl, id, surface,
|
|
Hans de Goede |
56753f |
(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
56753f |
@@ -100,10 +107,10 @@ void qemu_spice_create_primary_surface(SimpleSpiceDisplay *ssd, uint32_t id,
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
-
|
|
Hans de Goede |
56753f |
void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd,
|
|
Hans de Goede |
56753f |
uint32_t id, qxl_async_io async)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_destroy_primary_surface(ssd->qxl.id, id, async);
|
|
Hans de Goede |
56753f |
if (async != QXL_SYNC) {
|
|
Hans de Goede |
56753f |
spice_qxl_destroy_primary_surface_async(&ssd->qxl, id,
|
|
Hans de Goede |
56753f |
(uint64_t)qxl_cookie_new(QXL_COOKIE_TYPE_IO,
|
|
Hans de Goede |
56753f |
@@ -115,16 +122,19 @@ void qemu_spice_destroy_primary_surface(SimpleSpiceDisplay *ssd,
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qemu_spice_wakeup(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_wakeup(ssd->qxl.id);
|
|
Hans de Goede |
56753f |
ssd->worker->wakeup(ssd->worker);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qemu_spice_start(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_start(ssd->qxl.id);
|
|
Hans de Goede |
56753f |
ssd->worker->start(ssd->worker);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
void qemu_spice_stop(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
56753f |
{
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_stop(ssd->qxl.id);
|
|
Hans de Goede |
56753f |
ssd->worker->stop(ssd->worker);
|
|
Hans de Goede |
56753f |
}
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
@@ -142,7 +152,7 @@ static SimpleSpiceUpdate *qemu_spice_create_update(SimpleSpiceDisplay *ssd)
|
|
Hans de Goede |
56753f |
return NULL;
|
|
Hans de Goede |
56753f |
};
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
- dprint(2, "%s: lr %d -> %d, tb -> %d -> %d\n", __FUNCTION__,
|
|
Hans de Goede |
56753f |
+ trace_qemu_spice_create_update(
|
|
Hans de Goede |
56753f |
ssd->dirty.left, ssd->dirty.right,
|
|
Hans de Goede |
56753f |
ssd->dirty.top, ssd->dirty.bottom);
|
|
Hans de Goede |
56753f |
|
|
Hans de Goede |
56753f |
--
|
|
Hans de Goede |
56753f |
1.7.10
|
|
Hans de Goede |
56753f |
|