virtio-gpu: skip update cursor in post_load if we don't have one
PATCH 1/1 virtio-gpu: skip update cursor in post_load if we don't have one
If the cursor resource id isn't set the guest didn't define a cursor. Skip the cursor update in post_load in that that case.
--- hw/display/virtio-gpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
hw/display/virtio-gpu.c +3 -1
@@ -1092,7 +1092,9 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,dpy_gfx_replace_surface (scanout->con, scanout->ds);dpy_gfx_update (scanout->con,0 ,0 , scanout->width, scanout->height); -update_cursor (g, &scanout->cursor); +if (scanout->cursor.resource_id) { +update_cursor (g, &scanout->cursor); + } res->scanout_bitmask |= (1 << i); }
Signature · 1 line
2.9.3
Quoted 3 lines · Gerd Hoffmann
If the cursor resource id isn't set the guest didn't define a cursor. Skip the cursor update in
post_loadin that that case.
update_cursor() deals with resource_id == 0 already, but it also update the cursor position. What's the issue calling update_cursor() here?
Quoted 23 lines
Reported-by wanghaibin <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>--- hw/display/virtio-gpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/display/virtio-gpu.c +3
-1@@ -1092,7 +1092,9 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,dpy_gfx_replace_surface (scanout->con, scanout->ds);dpy_gfx_update (scanout->con,0 ,0 , scanout->width, scanout->height); -update_cursor (g, &scanout->cursor); +if (scanout->cursor.resource_id) { +update_cursor (g, &scanout->cursor); + } res->scanout_bitmask |= (1 << i);}
Quoted 5 lines
--
2.9.3--
Marc-André Lureau
Quoted 11 lines · Marc-André Lureau
Quoted 3 lines · Gerd Hoffmann
If the cursor resource id isn't set the guest didn't define a cursor.
Skip the cursor update inpost_loadin that that case.
update_cursor()deals withresource_id== 0 already, but it also update the cursor position. What's the issue callingupdate_cursor()here?
Calling set_cursor(), then vnc client being confused by rich cursor.
Quoted 32 lines
Quoted 24 lines
Reported-by wanghaibin <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>---
hw/display/virtio-gpu.c | 4 +++-1 file changed, 3 insertions(+), 1 deletion(-)hw/display/virtio-gpu.c +3
-1@@ -1092,7 +1092,9 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size, dpy_gfx_replace_surface(scanout->con, scanout->ds); dpy_gfx_update(scanout->con, 0, 0, scanout->width, scanout->height); - update_cursor(g, &scanout->cursor); + if (scanout->cursor.resource_id) { + update_cursor(g, &scanout->cursor); + } res->scanout_bitmask |= (1 << i);}
Quoted 5 lines
--
2.9.3--
Marc-André Lureau
Quoted 5 lines · Gerd Hoffmann
If the cursor resource id isn't set the guest didn't define a cursor. Skip the cursor update in
post_loadin that that case.Reported-by wanghaibin <[email protected]>Signed-off-by Gerd Hoffmann <[email protected]>
It's work!!
Thanks.
Quoted 19 lines
--- hw/display/virtio-gpu.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)hw/display/virtio-gpu.c +3
-1@@ -1092,7 +1092,9 @@ static int virtio_gpu_load(QEMUFile *f, void *opaque, size_t size,dpy_gfx_replace_surface (scanout->con, scanout->ds);dpy_gfx_update (scanout->con,0 ,0 , scanout->width, scanout->height); -update_cursor (g, &scanout->cursor); +if (scanout->cursor.resource_id) { +update_cursor (g, &scanout->cursor); + } res->scanout_bitmask |= (1 << i); }