From nobody Mon Feb 9 08:11:29 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1488810401572276.14907735350164; Mon, 6 Mar 2017 06:26:41 -0800 (PST) Received: from localhost ([::1]:44168 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cktav-0005uL-4E for importer@patchew.org; Mon, 06 Mar 2017 09:26:37 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42033) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cktYP-0004NA-4x for qemu-devel@nongnu.org; Mon, 06 Mar 2017 09:24:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cktYL-0007Wj-1f for qemu-devel@nongnu.org; Mon, 06 Mar 2017 09:24:01 -0500 Received: from mx1.redhat.com ([209.132.183.28]:52046) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1cktYK-0007WO-Pb for qemu-devel@nongnu.org; Mon, 06 Mar 2017 09:23:56 -0500 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EE13E64DA3; Mon, 6 Mar 2017 14:23:56 +0000 (UTC) Received: from nilsson.home.kraxel.org (ovpn-116-95.ams2.redhat.com [10.36.116.95]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id v26ENtYw019177; Mon, 6 Mar 2017 09:23:55 -0500 Received: by nilsson.home.kraxel.org (Postfix, from userid 500) id 4B97580BBE; Mon, 6 Mar 2017 15:23:53 +0100 (CET) From: Gerd Hoffmann To: qemu-devel@nongnu.org Date: Mon, 6 Mar 2017 15:23:49 +0100 Message-Id: <1488810230-31945-2-git-send-email-kraxel@redhat.com> In-Reply-To: <1488810230-31945-1-git-send-email-kraxel@redhat.com> References: <1488810230-31945-1-git-send-email-kraxel@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Mon, 06 Mar 2017 14:23:57 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH 1/2] sm501: drop support for anything but 32bpp X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Peter Maydell , Gerd Hoffmann Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The qemu console code hands out 32bpp display surfaces only, when using qemu_console_resize or qemu_create_displaysurface (which sm501 does). So there is no need to ever generate other output. Drop the code. Signed-off-by: Gerd Hoffmann --- hw/display/sm501.c | 89 +++-----------------------------------------------= ---- 1 file changed, 4 insertions(+), 85 deletions(-) diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 040a0b9..6c7717c 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1173,89 +1173,9 @@ typedef void draw_line_func(uint8_t *d, const uint8_= t *s, typedef void draw_hwc_line_func(SM501State * s, int crt, uint8_t * palette, int c_y, uint8_t *d, int width); =20 -#define DEPTH 8 -#include "sm501_template.h" - -#define DEPTH 15 -#include "sm501_template.h" - -#define BGR_FORMAT -#define DEPTH 15 -#include "sm501_template.h" - -#define DEPTH 16 -#include "sm501_template.h" - -#define BGR_FORMAT -#define DEPTH 16 -#include "sm501_template.h" - -#define DEPTH 32 -#include "sm501_template.h" - -#define BGR_FORMAT #define DEPTH 32 #include "sm501_template.h" =20 -static draw_line_func * draw_line8_funcs[] =3D { - draw_line8_8, - draw_line8_15, - draw_line8_16, - draw_line8_32, - draw_line8_32bgr, - draw_line8_15bgr, - draw_line8_16bgr, -}; - -static draw_line_func * draw_line16_funcs[] =3D { - draw_line16_8, - draw_line16_15, - draw_line16_16, - draw_line16_32, - draw_line16_32bgr, - draw_line16_15bgr, - draw_line16_16bgr, -}; - -static draw_line_func * draw_line32_funcs[] =3D { - draw_line32_8, - draw_line32_15, - draw_line32_16, - draw_line32_32, - draw_line32_32bgr, - draw_line32_15bgr, - draw_line32_16bgr, -}; - -static draw_hwc_line_func * draw_hwc_line_funcs[] =3D { - draw_hwc_line_8, - draw_hwc_line_15, - draw_hwc_line_16, - draw_hwc_line_32, - draw_hwc_line_32bgr, - draw_hwc_line_15bgr, - draw_hwc_line_16bgr, -}; - -static inline int get_depth_index(DisplaySurface *surface) -{ - switch (surface_bits_per_pixel(surface)) { - default: - case 8: - return 0; - case 15: - return 1; - case 16: - return 2; - case 32: - if (is_surface_bgr(surface)) { - return 4; - } else { - return 3; - } - } -} - static void sm501_draw_crt(SM501State * s) { DisplaySurface *surface =3D qemu_console_surface(s->con); @@ -1269,7 +1189,6 @@ static void sm501_draw_crt(SM501State * s) uint32_t * palette =3D (uint32_t *)&s->dc_palette[SM501_DC_CRT_PALETTE - SM501_DC_PANEL_PALETTE]; uint8_t hwc_palette[3 * 3]; - int ds_depth_index =3D get_depth_index(surface); draw_line_func * draw_line =3D NULL; draw_hwc_line_func * draw_hwc_line =3D NULL; int full_update =3D 0; @@ -1282,15 +1201,15 @@ static void sm501_draw_crt(SM501State * s) switch (s->dc_crt_control & 3) { case SM501_DC_CRT_CONTROL_8BPP: src_bpp =3D 1; - draw_line =3D draw_line8_funcs[ds_depth_index]; + draw_line =3D draw_line8_32; break; case SM501_DC_CRT_CONTROL_16BPP: src_bpp =3D 2; - draw_line =3D draw_line16_funcs[ds_depth_index]; + draw_line =3D draw_line16_32; break; case SM501_DC_CRT_CONTROL_32BPP: src_bpp =3D 4; - draw_line =3D draw_line32_funcs[ds_depth_index]; + draw_line =3D draw_line32_32; break; default: printf("sm501 draw crt : invalid DC_CRT_CONTROL=3D%x.\n", @@ -1312,7 +1231,7 @@ static void sm501_draw_crt(SM501State * s) } =20 /* choose cursor draw line function */ - draw_hwc_line =3D draw_hwc_line_funcs[ds_depth_index]; + draw_hwc_line =3D draw_hwc_line_32; } =20 /* adjust console size */ --=20 1.8.3.1