Re: [Spice-devel] [spice] Consistently check if drm_dma_buf_fd is greater or lower than zero

2019-03-21 Thread Frediano Ziglio
> 
> Based on a patch by Frediano Ziglio.
> 

I don't remember

> Signed-off-by: Francois Gouget 

Acked

> ---
>  server/red-qxl.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/server/red-qxl.c b/server/red-qxl.c
> index 0dd26b22c..789817f69 100644
> --- a/server/red-qxl.c
> +++ b/server/red-qxl.c
> @@ -791,7 +791,7 @@ void spice_qxl_gl_scanout(QXLInstance *qxl,
>  
>  pthread_mutex_lock(_state->scanout_mutex);
>  
> -if (qxl_state->scanout.drm_dma_buf_fd != -1) {
> +if (qxl_state->scanout.drm_dma_buf_fd >= 0) {
>  close(qxl_state->scanout.drm_dma_buf_fd);
>  }
>  
> @@ -832,7 +832,7 @@ void spice_qxl_gl_draw_async(QXLInstance *qxl,
>  
>  spice_return_if_fail(qxl != NULL);
>  qxl_state = qxl->st;
> -if (qxl_state->scanout.drm_dma_buf_fd == -1) {
> +if (qxl_state->scanout.drm_dma_buf_fd < 0) {
>  spice_warning("called spice_qxl_gl_draw_async without a buffer");
>  red_qxl_async_complete(qxl, cookie);
>  return;

Frediano
___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel

[Spice-devel] [spice] Consistently check if drm_dma_buf_fd is greater or lower than zero

2019-03-21 Thread Francois Gouget
Based on a patch by Frediano Ziglio.

Signed-off-by: Francois Gouget 
---
 server/red-qxl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/server/red-qxl.c b/server/red-qxl.c
index 0dd26b22c..789817f69 100644
--- a/server/red-qxl.c
+++ b/server/red-qxl.c
@@ -791,7 +791,7 @@ void spice_qxl_gl_scanout(QXLInstance *qxl,
 
 pthread_mutex_lock(_state->scanout_mutex);
 
-if (qxl_state->scanout.drm_dma_buf_fd != -1) {
+if (qxl_state->scanout.drm_dma_buf_fd >= 0) {
 close(qxl_state->scanout.drm_dma_buf_fd);
 }
 
@@ -832,7 +832,7 @@ void spice_qxl_gl_draw_async(QXLInstance *qxl,
 
 spice_return_if_fail(qxl != NULL);
 qxl_state = qxl->st;
-if (qxl_state->scanout.drm_dma_buf_fd == -1) {
+if (qxl_state->scanout.drm_dma_buf_fd < 0) {
 spice_warning("called spice_qxl_gl_draw_async without a buffer");
 red_qxl_async_complete(qxl, cookie);
 return;
-- 
2.20.1

___
Spice-devel mailing list
Spice-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/spice-devel