[Spice-commits] 2 commits - server/red-qxl.c server/red-worker.c server/red-worker.h
Frediano Ziglio
fziglio at kemper.freedesktop.org
Tue Oct 17 20:57:05 UTC 2017
server/red-qxl.c | 13 ++++---------
server/red-worker.c | 2 +-
server/red-worker.h | 2 +-
3 files changed, 6 insertions(+), 11 deletions(-)
New commits:
commit 63f44a61bfebd88da6733b1b1395f2ffd7a5f195
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Oct 13 09:35:42 2017 +0100
red-qxl: Enforce boolean for QXLDevSurfaceCreate::mouse_mode
In some cases mouse_mode is a bit field.
However for this structure is used always as a boolean
value.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/red-qxl.c b/server/red-qxl.c
index e386ba62..8cf09d9a 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -349,7 +349,8 @@ void red_qxl_create_primary_surface_complete(QXLState *qxl_state, const QXLDevSu
{
qxl_state->x_res = surface->width;
qxl_state->y_res = surface->height;
- qxl_state->use_hardware_cursor = surface->mouse_mode;
+ // mouse_mode is a boolean value, enforce it
+ qxl_state->use_hardware_cursor = !!surface->mouse_mode;
qxl_state->primary_active = TRUE;
reds_update_client_mouse_allowed(qxl_state->reds);
commit b83eb77c309e88ed961057e0f9e64c7cd43e1684
Author: Frediano Ziglio <fziglio at redhat.com>
Date: Fri Oct 13 09:02:29 2017 +0100
red-qxl: Remove surface_create field
This field was used just to store a value and retrieve again
while we can just pass it instead.
Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
Acked-by: Jonathon Jongsma <jjongsma at redhat.com>
diff --git a/server/red-qxl.c b/server/red-qxl.c
index 336bb2e6..e386ba62 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -50,7 +50,6 @@ struct QXLState {
int x_res;
int y_res;
int use_hardware_cursor;
- QXLDevSurfaceCreate surface_create;
unsigned int max_monitors;
RedsState *reds;
RedWorker *worker;
@@ -346,17 +345,14 @@ static void qxl_worker_destroy_primary_surface(QXLWorker *qxl_worker, uint32_t s
}
/* used by RedWorker */
-void red_qxl_create_primary_surface_complete(QXLState *qxl_state)
+void red_qxl_create_primary_surface_complete(QXLState *qxl_state, const QXLDevSurfaceCreate *surface)
{
- QXLDevSurfaceCreate *surface = &qxl_state->surface_create;
-
qxl_state->x_res = surface->width;
qxl_state->y_res = surface->height;
qxl_state->use_hardware_cursor = surface->mouse_mode;
qxl_state->primary_active = TRUE;
reds_update_client_mouse_allowed(qxl_state->reds);
- memset(&qxl_state->surface_create, 0, sizeof(QXLDevSurfaceCreate));
}
static void
@@ -366,7 +362,6 @@ red_qxl_create_primary_surface_async(QXLState *qxl_state, uint32_t surface_id,
RedWorkerMessageCreatePrimarySurfaceAsync payload;
RedWorkerMessage message = RED_WORKER_MESSAGE_CREATE_PRIMARY_SURFACE_ASYNC;
- qxl_state->surface_create = *surface;
payload.base.cookie = cookie;
payload.surface_id = surface_id;
payload.surface = *surface;
@@ -379,13 +374,12 @@ red_qxl_create_primary_surface_sync(QXLState *qxl_state, uint32_t surface_id,
{
RedWorkerMessageCreatePrimarySurface payload = {0,};
- qxl_state->surface_create = *surface;
payload.surface_id = surface_id;
payload.surface = *surface;
dispatcher_send_message(qxl_state->dispatcher,
RED_WORKER_MESSAGE_CREATE_PRIMARY_SURFACE,
&payload);
- red_qxl_create_primary_surface_complete(qxl_state);
+ red_qxl_create_primary_surface_complete(qxl_state, surface);
}
static void
diff --git a/server/red-worker.c b/server/red-worker.c
index 466a3474..fa57235d 100644
--- a/server/red-worker.c
+++ b/server/red-worker.c
@@ -707,7 +707,7 @@ static void handle_dev_create_primary_surface_async(void *opaque, void *payload)
RedWorker *worker = opaque;
dev_create_primary_surface(worker, msg->surface_id, msg->surface);
- red_qxl_create_primary_surface_complete(worker->qxl->st);
+ red_qxl_create_primary_surface_complete(worker->qxl->st, &msg->surface);
red_qxl_async_complete(worker->qxl, msg->base.cookie);
}
diff --git a/server/red-worker.h b/server/red-worker.h
index f29840c4..d8a34b33 100644
--- a/server/red-worker.h
+++ b/server/red-worker.h
@@ -38,7 +38,7 @@ void red_worker_free(RedWorker *worker);
struct Dispatcher *red_qxl_get_dispatcher(QXLInstance *qxl);
void red_qxl_destroy_primary_surface_complete(QXLState *qxl_state);
-void red_qxl_create_primary_surface_complete(QXLState *qxl_state);
+void red_qxl_create_primary_surface_complete(QXLState *qxl_state, const QXLDevSurfaceCreate* surface);
typedef uint32_t RedWorkerMessage;
More information about the Spice-commits
mailing list