From patchwork Fri Mar 13 12:58:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gerd Hoffmann X-Patchwork-Id: 449938 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id A4C59140119 for ; Fri, 13 Mar 2015 23:59:10 +1100 (AEDT) Received: from localhost ([::1]:36833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWPBE-0007Y2-UF for incoming@patchwork.ozlabs.org; Fri, 13 Mar 2015 08:59:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:37593) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWPAg-0006Tx-N9 for qemu-devel@nongnu.org; Fri, 13 Mar 2015 08:58:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YWPAf-0003QX-9N for qemu-devel@nongnu.org; Fri, 13 Mar 2015 08:58:34 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43154) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YWPAf-0003QM-1L for qemu-devel@nongnu.org; Fri, 13 Mar 2015 08:58:33 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t2DCwSBt025255 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 13 Mar 2015 08:58:29 -0400 Received: from nilsson.home.kraxel.org (ovpn-116-42.ams2.redhat.com [10.36.116.42]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t2DCwSFu024849; Fri, 13 Mar 2015 08:58:28 -0400 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 64EBB805FA; Fri, 13 Mar 2015 13:58:27 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Fri, 13 Mar 2015 13:58:19 +0100 Message-Id: <1426251503-14034-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1426251503-14034-1-git-send-email-kraxel@redhat.com> References: <1426251503-14034-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.24 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 209.132.183.28 Cc: Gerd Hoffmann , Anthony Liguori Subject: [Qemu-devel] [PULL v3 1/5] sdl: Refresh debug statements X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Benjamin Herrenschmidt Put them under a #define similar to the VGA model and make them actually compile. Add a couple too. Signed-off-by: Benjamin Herrenschmidt Signed-off-by: Gerd Hoffmann --- ui/sdl.c | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/ui/sdl.c b/ui/sdl.c index 138ca73..b89182a 100644 --- a/ui/sdl.c +++ b/ui/sdl.c @@ -61,16 +61,24 @@ static SDL_PixelFormat host_format; static int scaling_active = 0; static Notifier mouse_mode_notifier; +#if 0 +#define DEBUG_SDL +#endif + static void sdl_update(DisplayChangeListener *dcl, int x, int y, int w, int h) { - // printf("updating x=%d y=%d w=%d h=%d\n", x, y, w, h); SDL_Rect rec; rec.x = x; rec.y = y; rec.w = w; rec.h = h; +#ifdef DEBUG_SDL + printf("SDL: Updating x=%d y=%d w=%d h=%d (scaling: %d)\n", + x, y, w, h, scaling_active); +#endif + if (guest_screen) { if (!scaling_active) { SDL_BlitSurface(guest_screen, &rec, real_screen, &rec); @@ -89,7 +97,9 @@ 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); +#ifdef DEBUG_SDL + printf("SDL: Resizing to %dx%d bpp %d\n", width, height, bpp); +#endif flags = SDL_HWSURFACE | SDL_ASYNCBLIT | SDL_HWACCEL; if (gui_fullscreen) { @@ -143,6 +153,12 @@ static void sdl_switch(DisplayChangeListener *dcl, if (guest_screen != NULL) { SDL_FreeSurface(guest_screen); } + +#ifdef DEBUG_SDL + printf("SDL: Creating surface with masks: %08x %08x %08x %08x\n", + pf.rmask, pf.gmask, pf.bmask, pf.amask); +#endif + guest_screen = SDL_CreateRGBSurfaceFrom (surface_data(surface), surface_width(surface), surface_height(surface), @@ -486,6 +502,10 @@ static void sdl_scale(int width, int height) { int bpp = real_screen->format->BitsPerPixel; +#ifdef DEBUG_SDL + printf("SDL: Scaling to %dx%d bpp %d\n", width, height, bpp); +#endif + if (bpp != 16 && bpp != 32) { bpp = 32; }