All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefan Weil <sw@weilnetz.de>
To: Anthony Liguori <aliguori@us.ibm.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] sdl: Avoid unnecessary resizing of the display surface
Date: Fri, 04 May 2012 21:49:47 +0200	[thread overview]
Message-ID: <4FA432DB.9030508@weilnetz.de> (raw)
In-Reply-To: <1335851588-21011-1-git-send-email-sw@weilnetz.de>

Am 01.05.2012 07:53, schrieb Stefan Weil:
> If neither width nor height changes, nothing has to be done.
>
> Cc: Anthony Liguori<aliguori@us.ibm.com>
> Signed-off-by: Stefan Weil<sw@weilnetz.de>
> ---
>
> This patch improves SDL for any host (for example with remote X displays),
> but the main reason why I wrote it was another problem:
>
> On w32 / w64 hosts, qemu-system-arm has a deadlock when it calls
> sdl_resize_displaysurface during Linux boot. One thread waits for
> a critical region, another thread waits inside SDL_SetVideoMode.
>
> The patch avoids this problem. Paolo, maybe you have an idea what
> could cause the deadlock. Debugging on wxx is terrible - up to now,
> I did not succeed in analysing the lock situation with gdb.
>
> Regards,
> Stefan W.
>
>   ui/sdl.c |    7 +++++--
>   1 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/ui/sdl.c b/ui/sdl.c
> index 8700b7a..8c1c71c 100644
> --- a/ui/sdl.c
> +++ b/ui/sdl.c
> @@ -224,8 +224,11 @@ static void sdl_free_displaysurface(DisplaySurface *surface)
>
>   static DisplaySurface* sdl_resize_displaysurface(DisplaySurface *surface, int width, int height)
>   {
> -    sdl_free_displaysurface(surface);
> -    return sdl_create_displaysurface(width, height);
> +    if (surface->width != width || surface->height != height) {
> +        sdl_free_displaysurface(surface);
> +        surface = sdl_create_displaysurface(width, height);
> +    }
> +    return surface;
>   }
>
>   /* generic keyboard conversion */
>    

Please don't apply this patch. It is not complete and can cause a
crash (seen on w32 when resizing the SDL window).

I'll send an update.

Regards,
Stefan W.

      parent reply	other threads:[~2012-05-04 19:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-05-01  5:53 [Qemu-devel] [PATCH] sdl: Avoid unnecessary resizing of the display surface Stefan Weil
2012-05-01 14:00 ` Paolo Bonzini
2012-05-04 19:49 ` Stefan Weil [this message]

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=4FA432DB.9030508@weilnetz.de \
    --to=sw@weilnetz.de \
    --cc=aliguori@us.ibm.com \
    --cc=qemu-devel@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.