[Spice-devel] [PATCH] declare and use message for RED_WORKER_MESSAGE_GL_SCANOUT

Christophe Fergeau cfergeau at redhat.com
Wed Mar 23 13:49:14 UTC 2016


On Wed, Mar 23, 2016 at 01:06:26PM +0000, Frediano Ziglio wrote:
> All other messages (even empty ones) have a structure defined.

This is purely for consistency? Or was this causing issues?

> 
> Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
> ---
>  server/red-qxl.c    | 3 ++-
>  server/red-qxl.h    | 3 +++
>  server/red-worker.c | 2 +-
>  3 files changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/server/red-qxl.c b/server/red-qxl.c
> index 7ef9fe1..4c1c3e6 100644
> --- a/server/red-qxl.c
> +++ b/server/red-qxl.c
> @@ -853,6 +853,7 @@ void spice_qxl_gl_scanout(QXLInstance *qxl,
>                            uint32_t stride, uint32_t format,
>                            int y_0_top)
>  {
> +    RedWorkerMessageGlScanout payload;
>      spice_return_if_fail(qxl != NULL);
>  
>      QXLState *qxl_state = qxl->st;
> @@ -877,7 +878,7 @@ void spice_qxl_gl_scanout(QXLInstance *qxl,
>  
>      /* FIXME: find a way to coallesce all pending SCANOUTs */
>      dispatcher_send_message(&qxl_state->dispatcher,
> -                            RED_WORKER_MESSAGE_GL_SCANOUT, NULL);
> +                            RED_WORKER_MESSAGE_GL_SCANOUT, &payload);

I'd set payload to 0 with
RedWorkerMessageGlScanout payload = { 0, };
or something like that if that's possible. Or add a comment that payload
is a dummy empty struct. Otherwise it looks like we are sending
uninitialized data.

Acked-by: Christophe Fergeau <cfergeau at redhat.com>

Christophe
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <https://lists.freedesktop.org/archives/spice-devel/attachments/20160323/a5c80bef/attachment-0001.sig>


More information about the Spice-devel mailing list