[PATCH 3/4] replay: fill entire screen with a single color at the end

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This fake command allows to free current drawing in red worker to
allow to see possible memory leaks in red worker.

Signed-off-by: Frediano Ziglio <fziglio@xxxxxxxxxx>
---
 server/tests/replay.c | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/server/tests/replay.c b/server/tests/replay.c
index c35cb52..088b565 100644
--- a/server/tests/replay.c
+++ b/server/tests/replay.c
@@ -83,6 +83,30 @@ static void get_init_info(QXLInstance *qin, QXLDevInitInfo *info)
     info->n_surfaces = MAX_SURFACE_NUM;
 }
 
+static QXLCommandExt *create_fill_command(void)
+{
+    int i;
+    QXLCommandExt* cmd = g_malloc0(sizeof(QXLCommandExt));
+    QXLDrawable *qxl = g_malloc0(sizeof(QXLDrawable));
+
+    cmd->cmd.type = QXL_CMD_DRAW;
+    cmd->cmd.data = (QXLPHYSICAL)qxl;
+    cmd->group_id = 0;
+    cmd->flags = 0;
+
+    qxl->type = QXL_DRAW_FILL;
+    qxl->bbox.bottom = 8192;
+    qxl->bbox.right  = 8192;
+    for (i = 0; i < 3; i++)
+        qxl->surfaces_dest[i] = -1;
+    qxl->u.fill.brush.type = SPICE_BRUSH_TYPE_SOLID;
+    qxl->u.fill.brush.u.color = 0xff0000;
+    qxl->u.fill.rop_descriptor = SPICE_ROPD_OP_PUT;
+    qxl->release_info.id = (uint64_t) cmd;
+
+    return cmd;
+}
+
 static gboolean fill_queue_idle(gpointer user_data)
 {
     gboolean keep = FALSE;
@@ -90,6 +114,7 @@ static gboolean fill_queue_idle(gpointer user_data)
     while (g_async_queue_length(aqueue) < 50) {
         QXLCommandExt *cmd = spice_replay_next_cmd(replay, qxl_worker);
         if (!cmd) {
+            g_async_queue_push(aqueue, create_fill_command());
             g_async_queue_push(aqueue, GINT_TO_POINTER(-1));
             goto end;
         }
-- 
2.4.3

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]