summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@gmail.com>2013-10-03 21:18:38 +0200
committerChristophe Fergeau <cfergeau@redhat.com>2014-02-13 17:38:02 +0100
commitaf320c872684bac921e50a0f956c0c7e0fba4575 (patch)
treed6934ef72af4957386edfbf19791432b21da2d59
parent32ad64c8e23d67a3e647113402f06f17aa3a20b6 (diff)
worker: move red_record_command
-rw-r--r--server/red_record_qxl.c21
-rw-r--r--server/red_record_qxl.h18
-rw-r--r--server/red_worker.c32
3 files changed, 29 insertions, 42 deletions
diff --git a/server/red_record_qxl.c b/server/red_record_qxl.c
index 73d46791..e1da44cc 100644
--- a/server/red_record_qxl.c
+++ b/server/red_record_qxl.c
@@ -804,3 +804,24 @@ void red_record_event(FILE *fd, int what, uint32_t type, unsigned long ts)
// (that can be up to VGA_FRAMEBUFFER large)
fprintf(fd, "event %d %d %u %lu\n", counter++, what, type, ts);
}
+
+void red_record_qxl_command(FILE *fd, RedMemSlotInfo *slots,
+ QXLCommandExt ext_cmd, unsigned long ts)
+{
+ red_record_event(fd, 0, ext_cmd.cmd.type, ts);
+
+ switch (ext_cmd.cmd.type) {
+ case QXL_CMD_DRAW:
+ red_record_drawable(fd, slots, ext_cmd.group_id, ext_cmd.cmd.data, ext_cmd.flags);
+ break;
+ case QXL_CMD_UPDATE:
+ red_record_update_cmd(fd, slots, ext_cmd.group_id, ext_cmd.cmd.data);
+ break;
+ case QXL_CMD_MESSAGE:
+ red_record_message(fd, slots, ext_cmd.group_id, ext_cmd.cmd.data);
+ break;
+ case QXL_CMD_SURFACE:
+ red_record_surface_cmd(fd, slots, ext_cmd.group_id, ext_cmd.cmd.data);
+ break;
+ }
+}
diff --git a/server/red_record_qxl.h b/server/red_record_qxl.h
index ae679a9e..50f0c62a 100644
--- a/server/red_record_qxl.h
+++ b/server/red_record_qxl.h
@@ -23,24 +23,12 @@
#include "common.h"
#include "memslot.h"
-void red_record_drawable(FILE *fd, RedMemSlotInfo *slots, int group_id,
- QXLPHYSICAL addr, uint32_t flags);
-
-void red_record_update_cmd(FILE *fd, RedMemSlotInfo *slots, int group_id,
- QXLPHYSICAL addr);
-
-void red_record_message(FILE *fd, RedMemSlotInfo *slots, int group_id,
- QXLPHYSICAL addr);
-
-void red_record_surface_cmd(FILE *fd, RedMemSlotInfo *slots, int group_id,
- QXLPHYSICAL addr);
-
-void red_record_cursor_cmd(FILE *fd, RedMemSlotInfo *slots, int group_id,
- QXLPHYSICAL addr);
-
void red_record_dev_input_primary_surface_create(
FILE *fd, QXLDevSurfaceCreate *surface, uint8_t *line_0);
void red_record_event(FILE *fd, int what, uint32_t type, unsigned long ts);
+void red_record_qxl_command(FILE *fd, RedMemSlotInfo *slots,
+ QXLCommandExt ext_cmd, unsigned long ts);
+
#endif
diff --git a/server/red_worker.c b/server/red_worker.c
index 8e846708..041f8a51 100644
--- a/server/red_worker.c
+++ b/server/red_worker.c
@@ -304,30 +304,6 @@ static int red_process_cursor(RedWorker *worker, uint32_t max_pipe_size, int *ri
return n;
}
-static void red_record_command(RedWorker *worker, QXLCommandExt ext_cmd)
-{
- red_record_event(worker->record_fd, 0, ext_cmd.cmd.type, stat_now(worker->clockid));
-
- switch (ext_cmd.cmd.type) {
- case QXL_CMD_DRAW:
- red_record_drawable(worker->record_fd, &worker->mem_slots, ext_cmd.group_id,
- ext_cmd.cmd.data, ext_cmd.flags);
- break;
- case QXL_CMD_UPDATE:
- red_record_update_cmd(worker->record_fd, &worker->mem_slots, ext_cmd.group_id,
- ext_cmd.cmd.data);
- break;
- case QXL_CMD_MESSAGE:
- red_record_message(worker->record_fd, &worker->mem_slots, ext_cmd.group_id,
- ext_cmd.cmd.data);
- break;
- case QXL_CMD_SURFACE:
- red_record_surface_cmd(worker->record_fd, &worker->mem_slots, ext_cmd.group_id,
- ext_cmd.cmd.data);
- break;
- }
-}
-
static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int *ring_is_empty)
{
QXLCommandExt ext_cmd;
@@ -373,9 +349,11 @@ static int red_process_commands(RedWorker *worker, uint32_t max_pipe_size, int *
}
continue;
}
- if (worker->record_fd) {
- red_record_command(worker, ext_cmd);
- }
+
+ if (worker->record_fd)
+ red_record_qxl_command(worker->record_fd, &worker->mem_slots, ext_cmd,
+ stat_now(worker->clockid));
+
stat_inc_counter(worker->command_counter, 1);
worker->display_poll_tries = 0;
switch (ext_cmd.cmd.type) {