From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42299) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve3uG-0001KN-M8 for qemu-devel@nongnu.org; Wed, 06 Nov 2013 09:16:33 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ve3u9-0001YS-An for qemu-devel@nongnu.org; Wed, 06 Nov 2013 09:16:28 -0500 Received: from mail-qe0-x235.google.com ([2607:f8b0:400d:c02::235]:33886) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ve3u9-0001YH-6Q for qemu-devel@nongnu.org; Wed, 06 Nov 2013 09:16:21 -0500 Received: by mail-qe0-f53.google.com with SMTP id cy11so6159301qeb.40 for ; Wed, 06 Nov 2013 06:16:20 -0800 (PST) Sender: Paolo Bonzini Message-ID: <527A4F2F.8010406@redhat.com> Date: Wed, 06 Nov 2013 15:16:15 +0100 From: Paolo Bonzini MIME-Version: 1.0 References: <1378285636-7091-1-git-send-email-lilei@linux.vnet.ibm.com> <526910B3.6010402@linux.vnet.ibm.com> <527A44AB.7040607@linux.vnet.ibm.com> In-Reply-To: <527A44AB.7040607@linux.vnet.ibm.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH resend 1.7] sdl: Reverse support for video mode setting List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Lei Li Cc: qemu-devel , Anthony Liguori , sascha@srlabs.de Il 06/11/2013 14:31, Lei Li ha scritto: > Ping^2 > > On 10/24/2013 08:21 PM, Lei Li wrote: >> This patch has been confirmed by the reporter himself as >> link below, >> >> https://bugs.launchpad.net/qemu/+bug/1216368 >> >> It has been on the mailing list for a while, could it be merged? PING... >> >> On 09/04/2013 05:07 PM, Lei Li wrote: >>> Currently, If the setting of video mode failed, qemu will exit. It >>> should go back to the previous setting if the new screen resolution >>> failed. This patch fixes LP#1216368, add support to revert to existing >>> surface for the failure of video mode setting. >>> >>> Reported-by: Sascha Krissler >>> Signed-off-by: Lei Li >>> --- >>> ui/sdl.c | 23 +++++++++++++++++++---- >>> 1 files changed, 19 insertions(+), 4 deletions(-) >>> >>> diff --git a/ui/sdl.c b/ui/sdl.c >>> index 39a42d6..9d8583c 100644 >>> --- a/ui/sdl.c >>> +++ b/ui/sdl.c >>> @@ -86,6 +86,7 @@ static void sdl_update(DisplayChangeListener *dcl, >>> static void do_sdl_resize(int width, int height, int bpp) >>> { >>> int flags; >>> + SDL_Surface *tmp_screen; >>> >>> // printf("resizing to %d %d\n", w, h); >>> >>> @@ -98,12 +99,26 @@ static void do_sdl_resize(int width, int height, >>> int bpp) >>> if (gui_noframe) >>> flags |= SDL_NOFRAME; >>> >>> - real_screen = SDL_SetVideoMode(width, height, bpp, flags); >>> + tmp_screen = SDL_SetVideoMode(width, height, bpp, flags); >>> if (!real_screen) { >>> - fprintf(stderr, "Could not open SDL display (%dx%dx%d): %s\n", >>> width, >>> - height, bpp, SDL_GetError()); >>> - exit(1); >>> + if (!tmp_screen) { >>> + fprintf(stderr, "Could not open SDL display (%dx%dx%d): >>> %s\n", >>> + width, height, bpp, SDL_GetError()); >>> + exit(1); >>> + } >>> + } else { >>> + /* >>> + * Revert to the previous video mode if the change of >>> resizing or >>> + * resolution failed. >>> + */ >>> + if (!tmp_screen) { >>> + fprintf(stderr, "Failed to set SDL display (%dx%dx%d): >>> %s\n", >>> + width, height, bpp, SDL_GetError()); >>> + return; >>> + } >>> } >>> + >>> + real_screen = tmp_screen; >>> } >>> >>> static void sdl_switch(DisplayChangeListener *dcl, >> >> > > Reviewed-by: Paolo Bonzini