[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 07/12] spice-display: access ptr_x/ptr_y under Mutex
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PULL 07/12] spice-display: access ptr_x/ptr_y under Mutex |
Date: |
Thu, 23 Aug 2018 11:56:48 +0200 |
From: Paolo Bonzini <address@hidden>
The OpenGL-enabled SPICE code was not accessing the cursor position
under the SimpleSpiceDisplay lock. Fix this.
Signed-off-by: Paolo Bonzini <address@hidden>
Reviewed-by: Marc-André Lureau <address@hidden>
Message-id: address@hidden
Signed-off-by: Gerd Hoffmann <address@hidden>
---
ui/spice-display.c | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/ui/spice-display.c b/ui/spice-display.c
index fe734821dd..46df673cd7 100644
--- a/ui/spice-display.c
+++ b/ui/spice-display.c
@@ -976,8 +976,10 @@ static void
qemu_spice_gl_cursor_position(DisplayChangeListener *dcl,
{
SimpleSpiceDisplay *ssd = container_of(dcl, SimpleSpiceDisplay, dcl);
+ qemu_mutex_lock(&ssd->lock);
ssd->ptr_x = pos_x;
ssd->ptr_y = pos_y;
+ qemu_mutex_unlock(&ssd->lock);
}
static void qemu_spice_gl_release_dmabuf(DisplayChangeListener *dcl,
@@ -1055,10 +1057,15 @@ static void qemu_spice_gl_update(DisplayChangeListener
*dcl,
}
if (render_cursor) {
+ int x, y;
+ qemu_mutex_lock(&ssd->lock);
+ x = ssd->ptr_x;
+ y = ssd->ptr_y;
+ qemu_mutex_unlock(&ssd->lock);
egl_texture_blit(ssd->gls, &ssd->blit_fb, &ssd->guest_fb,
!y_0_top);
egl_texture_blend(ssd->gls, &ssd->blit_fb, &ssd->cursor_fb,
- !y_0_top, ssd->ptr_x, ssd->ptr_y);
+ !y_0_top, x, y);
glFlush();
}
--
2.9.3
- [Qemu-devel] [PULL 00/12] Ui 20180823 v3 patches, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 01/12] ui/sdl2: Remove the obsolete SDL_INIT_NOPARACHUTE flag, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 04/12] sdl2: redraw correctly when scanout_mode enabled., Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 03/12] ui: use enum to string helpers, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 02/12] vnc: fix memleak of the "vnc-worker-output" name, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 09/12] ui/sdl2: Fix broken -full-screen CLI option, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 06/12] vnc: remove support for deprecated tls, x509, x509verify options, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 11/12] dmabuf: add y0_top, pass it to spice, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 07/12] spice-display: access ptr_x/ptr_y under Mutex,
Gerd Hoffmann <=
- [Qemu-devel] [PULL 05/12] doc: switch to modern syntax for VNC TLS setup, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 08/12] spice-display: fix qemu_spice_cursor_refresh_bh locking, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 10/12] ui/vnc: Remove useless parenthesis around DIV_ROUND_UP macro, Gerd Hoffmann, 2018/08/23
- [Qemu-devel] [PULL 12/12] util: promote qemu_egl_rendernode_open() to libqemuutil, Gerd Hoffmann, 2018/08/23
- Re: [Qemu-devel] [PULL 00/12] Ui 20180823 v3 patches, Peter Maydell, 2018/08/24