All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] virtio-gpu: skip update cursor in post_load if we don't have one
@ 2017-07-10  7:04 Gerd Hoffmann
  2017-07-10  9:05 ` Marc-André Lureau
  2017-07-13  2:18 ` wanghaibin
  0 siblings, 2 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2017-07-10  7:04 UTC (permalink / raw)
  To: qemu-devel; +Cc: wanghaibin.wang, Gerd Hoffmann, Michael S. Tsirkin

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.

Reported-by: wanghaibin <wanghaibin.wang@huawei.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
---
 hw/display/virtio-gpu.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
index 58dc0b2737..eef11083d7 100644
--- a/hw/display/virtio-gpu.c
+++ b/hw/display/virtio-gpu.c
@@ -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);
     }
 
-- 
2.9.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-gpu: skip update cursor in post_load if we don't have one
  2017-07-10  7:04 [Qemu-devel] [PATCH] virtio-gpu: skip update cursor in post_load if we don't have one Gerd Hoffmann
@ 2017-07-10  9:05 ` Marc-André Lureau
  2017-07-10 11:50   ` Gerd Hoffmann
  2017-07-13  2:18 ` wanghaibin
  1 sibling, 1 reply; 4+ messages in thread
From: Marc-André Lureau @ 2017-07-10  9:05 UTC (permalink / raw)
  To: Gerd Hoffmann, qemu-devel; +Cc: wanghaibin.wang, Michael S. Tsirkin

On Mon, Jul 10, 2017 at 9:06 AM Gerd Hoffmann <kraxel@redhat.com> wrote:

> 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.
>

update_cursor() deals with resource_id == 0 already, but it also update the
cursor position. What's the issue calling update_cursor() here?


> Reported-by: wanghaibin <wanghaibin.wang@huawei.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> ---
>  hw/display/virtio-gpu.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> index 58dc0b2737..eef11083d7 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -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);
>      }
>
> --
> 2.9.3
>
>
> --
Marc-André Lureau

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-gpu: skip update cursor in post_load if we don't have one
  2017-07-10  9:05 ` Marc-André Lureau
@ 2017-07-10 11:50   ` Gerd Hoffmann
  0 siblings, 0 replies; 4+ messages in thread
From: Gerd Hoffmann @ 2017-07-10 11:50 UTC (permalink / raw)
  To: Marc-André Lureau, qemu-devel; +Cc: wanghaibin.wang, Michael S. Tsirkin

On Mon, 2017-07-10 at 09:05 +0000, Marc-André Lureau wrote:
> 
> 
> On Mon, Jul 10, 2017 at 9:06 AM Gerd Hoffmann <kraxel@redhat.com>
> wrote:
> > 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.
> 
> update_cursor() deals with resource_id == 0 already, but it also
> update the cursor position. What's the issue calling update_cursor()
> here?

Calling set_cursor(), then vnc client being confused by rich cursor.

> 
> > Reported-by: wanghaibin <wanghaibin.wang@huawei.com>
> > Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
> > ---
> >  hw/display/virtio-gpu.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> > 
> > diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> > index 58dc0b2737..eef11083d7 100644
> > --- a/hw/display/virtio-gpu.c
> > +++ b/hw/display/virtio-gpu.c
> > @@ -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);
> >      }
> > 
> > --
> > 2.9.3
> > 
> > 
> > 
> 
> -- 
> Marc-André Lureau

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH] virtio-gpu: skip update cursor in post_load if we don't have one
  2017-07-10  7:04 [Qemu-devel] [PATCH] virtio-gpu: skip update cursor in post_load if we don't have one Gerd Hoffmann
  2017-07-10  9:05 ` Marc-André Lureau
@ 2017-07-13  2:18 ` wanghaibin
  1 sibling, 0 replies; 4+ messages in thread
From: wanghaibin @ 2017-07-13  2:18 UTC (permalink / raw)
  To: Gerd Hoffmann; +Cc: qemu-devel, Michael S. Tsirkin

On 2017/7/10 15:04, Gerd Hoffmann wrote:

> 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.
> 
> Reported-by: wanghaibin <wanghaibin.wang@huawei.com>
> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>


It's work!!

Tested-by: wanghaibin <wanghaibin.wang@huawei.com>

Thanks.

> ---
>  hw/display/virtio-gpu.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/display/virtio-gpu.c b/hw/display/virtio-gpu.c
> index 58dc0b2737..eef11083d7 100644
> --- a/hw/display/virtio-gpu.c
> +++ b/hw/display/virtio-gpu.c
> @@ -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);
>      }
>  

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-07-13  2:18 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-07-10  7:04 [Qemu-devel] [PATCH] virtio-gpu: skip update cursor in post_load if we don't have one Gerd Hoffmann
2017-07-10  9:05 ` Marc-André Lureau
2017-07-10 11:50   ` Gerd Hoffmann
2017-07-13  2:18 ` wanghaibin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.