qemu-trivial
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-trivial] [PATCH][TRIVIAL] spice: fix checking for surface bpp


From: Léo Grange
Subject: Re: [Qemu-trivial] [PATCH][TRIVIAL] spice: fix checking for surface bpp match
Date: Thu, 17 Sep 2015 18:18:48 +0200

Ping, as I had no feedback about this small patch.
Please tell me if I need to do anything else.


2015-08-06 17:36 GMT+02:00 Leo Grange <address@hidden>:
> Spice surface_switch fast-path was checking only width/height matching,
> which leads to a crash when surface bpp has been increased but size
> didn't change (and probably other issues if bpp has been decreased).
>
> Signed-off-by: Leo Grange <address@hidden>
> ---
>  ui/spice-display.c | 7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/ui/spice-display.c b/ui/spice-display.c
> index 0360abf..d1e0972 100644
> --- a/ui/spice-display.c
> +++ b/ui/spice-display.c
> @@ -406,10 +406,11 @@ void qemu_spice_display_switch(SimpleSpiceDisplay *ssd,
>      SimpleSpiceUpdate *update;
>      bool need_destroy;
>
> -    if (surface && ssd->surface &&
> +    if (surface && ssd->surface && ssd->ds &&
>          surface_width(surface) == pixman_image_get_width(ssd->surface) &&
> -        surface_height(surface) == pixman_image_get_height(ssd->surface)) {
> -        /* no-resize fast path: just swap backing store */
> +        surface_height(surface) == pixman_image_get_height(ssd->surface) &&
> +               surface_bits_per_pixel(surface) == 
> surface_bits_per_pixel(ssd->ds)) {
> +        /* no-resize and no bpp change fast path: just swap backing store */
>          dprint(1, "%s/%d: fast (%dx%d)\n", __func__, ssd->qxl.id,
>                 surface_width(surface), surface_height(surface));
>          qemu_mutex_lock(&ssd->lock);
> --
> 2.5.0
>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]