From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39953) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fsmMT-00022v-Fk for qemu-devel@nongnu.org; Thu, 23 Aug 2018 05:57:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fsmMS-00072T-Ix for qemu-devel@nongnu.org; Thu, 23 Aug 2018 05:57:05 -0400 Received: from mx3-rdu2.redhat.com ([66.187.233.73]:50868 helo=mx1.redhat.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fsmMS-000729-Aq for qemu-devel@nongnu.org; Thu, 23 Aug 2018 05:57:04 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id DF6A987A78 for ; Thu, 23 Aug 2018 09:57:03 +0000 (UTC) From: Gerd Hoffmann Date: Thu, 23 Aug 2018 11:56:48 +0200 Message-Id: <20180823095653.14556-8-kraxel@redhat.com> In-Reply-To: <20180823095653.14556-1-kraxel@redhat.com> References: <20180823095653.14556-1-kraxel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PULL 07/12] spice-display: access ptr_x/ptr_y under Mutex List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: libvir-list@redhat.com, Gerd Hoffmann , Paolo Bonzini From: Paolo Bonzini The OpenGL-enabled SPICE code was not accessing the cursor position under the SimpleSpiceDisplay lock. Fix this. Signed-off-by: Paolo Bonzini Reviewed-by: Marc-Andr=C3=A9 Lureau Message-id: 20180720063109.4631-2-pbonzini@redhat.com Signed-off-by: Gerd Hoffmann --- 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(DisplayCha= ngeListener *dcl, { SimpleSpiceDisplay *ssd =3D container_of(dcl, SimpleSpiceDisplay, dc= l); =20 + qemu_mutex_lock(&ssd->lock); ssd->ptr_x =3D pos_x; ssd->ptr_y =3D pos_y; + qemu_mutex_unlock(&ssd->lock); } =20 static void qemu_spice_gl_release_dmabuf(DisplayChangeListener *dcl, @@ -1055,10 +1057,15 @@ static void qemu_spice_gl_update(DisplayChangeLis= tener *dcl, } =20 if (render_cursor) { + int x, y; + qemu_mutex_lock(&ssd->lock); + x =3D ssd->ptr_x; + y =3D 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(); } =20 --=20 2.9.3