All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michael Tokarev <mjt@tls.msk.ru>
To: "Léo Grange" <grangeleo@gmail.com>, qemu-trivial@nongnu.org
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-trivial] [PATCH][TRIVIAL] spice: fix checking for surface bpp match
Date: Tue, 22 Sep 2015 10:41:29 +0300	[thread overview]
Message-ID: <56010629.3080307@msgid.tls.msk.ru> (raw)
In-Reply-To: <CAAOQwLqXeshTGTYxc+Hq62t+mvi=0nbHDg3Z+=87mCGXwYPFTQ@mail.gmail.com>

17.09.2015 19:18, Léo Grange wrote:
> Ping, as I had no feedback about this small patch.
> Please tell me if I need to do anything else.

Hello!

I've seen initial version of your patch, thought it isn't exactly trivial ;),
and hoped someone will comment.  Only now I realized you sent it to -trivial
but not to -devel, so there's no one to comment on it.  Please don't do this,
always include qemu-devel when sending patches, so a patch will have a
chance to be reviewed.  I've added qemu-devel to Cc now.

Here, I _think_ the patch is okay, but it'd be better for it to have some
review still.

Thanks,

/mjt

> 2015-08-06 17:36 GMT+02:00 Leo Grange <grangeleo@gmail.com>:
>> 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 <grangeleo@gmail.com>
>> ---
>>  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
>>
> 



WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: "Léo Grange" <grangeleo@gmail.com>, qemu-trivial@nongnu.org
Cc: qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] [PATCH][TRIVIAL] spice: fix checking for surface bpp match
Date: Tue, 22 Sep 2015 10:41:29 +0300	[thread overview]
Message-ID: <56010629.3080307@msgid.tls.msk.ru> (raw)
In-Reply-To: <CAAOQwLqXeshTGTYxc+Hq62t+mvi=0nbHDg3Z+=87mCGXwYPFTQ@mail.gmail.com>

17.09.2015 19:18, Léo Grange wrote:
> Ping, as I had no feedback about this small patch.
> Please tell me if I need to do anything else.

Hello!

I've seen initial version of your patch, thought it isn't exactly trivial ;),
and hoped someone will comment.  Only now I realized you sent it to -trivial
but not to -devel, so there's no one to comment on it.  Please don't do this,
always include qemu-devel when sending patches, so a patch will have a
chance to be reviewed.  I've added qemu-devel to Cc now.

Here, I _think_ the patch is okay, but it'd be better for it to have some
review still.

Thanks,

/mjt

> 2015-08-06 17:36 GMT+02:00 Leo Grange <grangeleo@gmail.com>:
>> 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 <grangeleo@gmail.com>
>> ---
>>  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	other threads:[~2015-09-22  7:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-06 15:36 [Qemu-trivial] [PATCH][TRIVIAL] spice: fix checking for surface bpp match Leo Grange
2015-09-17 16:18 ` Léo Grange
2015-09-22  7:41   ` Michael Tokarev [this message]
2015-09-22  7:41     ` [Qemu-devel] " Michael Tokarev
2015-10-29  8:10     ` [Qemu-trivial] " Michael Tokarev
2015-10-29  8:10       ` [Qemu-devel] " Michael Tokarev
2015-10-29  9:27       ` [Qemu-trivial] " Gerd Hoffmann
2015-10-29  9:27         ` [Qemu-devel] " Gerd Hoffmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56010629.3080307@msgid.tls.msk.ru \
    --to=mjt@tls.msk.ru \
    --cc=grangeleo@gmail.com \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.