From patchwork Thu Apr 28 09:54:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ghugesss@gmail.com X-Patchwork-Id: 8967551 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 3D525BF29F for ; Thu, 28 Apr 2016 09:54:39 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4FD14201CE for ; Thu, 28 Apr 2016 09:54:38 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 10FC720138 for ; Thu, 28 Apr 2016 09:54:37 +0000 (UTC) Received: from localhost ([::1]:47695 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avieZ-0003X8-Af for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Apr 2016 05:54:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57770) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avieM-0003OV-SC for qemu-devel@nongnu.org; Thu, 28 Apr 2016 05:54:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1avieL-00019K-F7 for qemu-devel@nongnu.org; Thu, 28 Apr 2016 05:54:22 -0400 Received: from mail-ig0-x22d.google.com ([2607:f8b0:4001:c05::22d]:33143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avieL-000194-7C for qemu-devel@nongnu.org; Thu, 28 Apr 2016 05:54:21 -0400 Received: by mail-ig0-x22d.google.com with SMTP id c3so2860249igl.0 for ; Thu, 28 Apr 2016 02:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc; bh=ZA5h1uuuyHbNnYM9LUWX3VAZIAEC5cwyiKpxhw6FbGI=; b=Kk2DTzzBOuaVoCpa9OrKqZ+iyLHIGhqKT8t9zgG8lM2Gwi9Gu0fYVEQhFGL8p5nbWJ VS+Dn7iDk+d/rIT07hKRQxHDnMwAxI1KOlN7HpR49XNboBd9somV4/ceRQ+ugO3py257 OuUY86VWrhcc6KTCpkDXap2zNDI3Vk00cTMEZoDxjGaA+c5Fsm/nUP+9OT+9GcO4CFrw VInGVFp6jmJ16oAS+UyEyavBs0Dnh9udO+yJserbmhWJVyz0et3HDzPngY53HUtApxoR 6Jre70te42bPavQtf+Hnvrmw0hEK6+WQAwB3rBHzlTXw3uXbgiVB5UIjBzkqBX2f/q2L yEGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc; bh=ZA5h1uuuyHbNnYM9LUWX3VAZIAEC5cwyiKpxhw6FbGI=; b=EbTYlIF/ixWWePA8p78giARNVVmJDK+DprVtPhGyv6KXGaBsXGacfGROndvXV2RF0M 8UPNgQZQf9ytvCNEXqEEbdA5Jo+XtvujMRseFHsrU/167IQtj9XLSJVcavuKFBM1lkhs z3CzMtMtR59UJlgj1Emj0UpaVNu6nLS3LIVrH0QKEoMOYG5NRJaXF6rCvcomKE3wQ/Pf crZ6svOYxRfcR7a47YSANYlGulTDZngTSQcOBcA8c9AdapFa85XcgmYbWFOdIzZL/Fak DbcsQmjhm2wGI1Gp7cevMuzSgquBvEIkCce3WYbBUVzPbqVSPNLoS43dCYaSlkHO7Lj/ xt7Q== X-Gm-Message-State: AOPr4FX9NsidAZ5npkKp0n4l+YDrBh0gYJKyN78jPnQRmI3dQInZ6/GAVFpLBaTCU+nT7RM7Y1fJzqGwM11AkQ== MIME-Version: 1.0 X-Received: by 10.50.114.135 with SMTP id jg7mr34324184igb.53.1461837260011; Thu, 28 Apr 2016 02:54:20 -0700 (PDT) Received: by 10.107.34.79 with HTTP; Thu, 28 Apr 2016 02:54:19 -0700 (PDT) In-Reply-To: <1461837004-29348-1-git-send-email-ghugesss@gmail.com> References: <1461837004-29348-1-git-send-email-ghugesss@gmail.com> Date: Thu, 28 Apr 2016 15:24:19 +0530 Message-ID: From: Sagar Ghuge To: qemu-devel@nongnu.org X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c05::22d Subject: [Qemu-devel] Fwd: [PATCH] sm501: Remove support for DEPTH != 32 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: pbonzini@redhat.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Forgot to CCing Paolo Bonzini. Added. ---------- Forwarded message ---------- From: Sagar Ghuge Date: Thu, Apr 28, 2016 at 3:20 PM Subject: [PATCH] sm501: Remove support for DEPTH != 32 To: qemu-devel@nongnu.org Removing support for DEPTH != 32 from sm501 template header and file that includes it, as macro DEPTH == 32 only used. Signed-off-by: Sagar Ghuge --- hw/display/sm501.c | 55 +++++---------------------------------------- hw/display/sm501_template.h | 8 +------ 2 files changed, 6 insertions(+), 57 deletions(-) -- 2.5.0 diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 5f71012..b165280 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1173,23 +1173,6 @@ 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); -#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" @@ -1198,61 +1181,33 @@ typedef void draw_hwc_line_func(SM501State * s, int crt, uint8_t * palette, #include "sm501_template.h" static draw_line_func * draw_line8_funcs[] = { - 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[] = { - 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[] = { - 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[] = { - 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: + assert(surface_bits_per_pixel(surface) == 32); + + if (is_surface_bgr(surface)) { return 1; - case 16: - return 2; - case 32: - if (is_surface_bgr(surface)) { - return 4; - } else { - return 3; - } + } else { + return 0; } } diff --git a/hw/display/sm501_template.h b/hw/display/sm501_template.h index f33e499..4e5801e 100644 --- a/hw/display/sm501_template.h +++ b/hw/display/sm501_template.h @@ -22,13 +22,7 @@ * THE SOFTWARE. */ -#if DEPTH == 8 -#define BPP 1 -#define PIXEL_TYPE uint8_t -#elif DEPTH == 15 || DEPTH == 16 -#define BPP 2 -#define PIXEL_TYPE uint16_t -#elif DEPTH == 32 +#if DEPTH == 32 #define BPP 4 #define PIXEL_TYPE uint32_t #else