From patchwork Tue Mar 22 06:34:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nutan Shinde X-Patchwork-Id: 8638201 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 A7190C0553 for ; Tue, 22 Mar 2016 06:34:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DBB892038F for ; Tue, 22 Mar 2016 06:34:53 +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 DD0E42034E for ; Tue, 22 Mar 2016 06:34:52 +0000 (UTC) Received: from localhost ([::1]:34045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiFu0-0004Zj-3m for patchwork-qemu-devel@patchwork.kernel.org; Tue, 22 Mar 2016 02:34:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38389) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiFts-0004ZY-Ji for qemu-devel@nongnu.org; Tue, 22 Mar 2016 02:34:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aiFto-0005PD-Ls for qemu-devel@nongnu.org; Tue, 22 Mar 2016 02:34:44 -0400 Received: from mail-pf0-x243.google.com ([2607:f8b0:400e:c00::243]:35204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aiFto-0005Ot-AZ for qemu-devel@nongnu.org; Tue, 22 Mar 2016 02:34:40 -0400 Received: by mail-pf0-x243.google.com with SMTP id u190so34115130pfb.2 for ; Mon, 21 Mar 2016 23:34:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=iq9LDfslJs4sUX2IX8Am9KEOaLhWxFPXKA/qKBjOsqA=; b=u1VEvrPcHP8H5Pc73uiRZw8TkON8D0msWi5bJoCo2WhctAvK5cIas1tVRvwCkHEp7f aYx6959pwF1Zh5o+aBkfzAhOZW2DqshSfay2DPSgxG3KwDllwSIMErm/LjJG+S3CkpRy T8mNHfWvel81SLYtnZfBT9V71oKo/qe59O829MLjHmh04qdLZ4uBePuT1ljWziZZlhdY WboXGVl2R0u2ca55pTY9lJ5OxEbosZqHq5WeHvkYJs6g77MS5+bo2QwCuxTGoU2KsDof 6J/du6N7XvQM/D/Fe36aQjmO0w+f4kcg2RmoEFNbHyNGYlrKPbcGNVcF1UECJWZCYy3A sHEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=iq9LDfslJs4sUX2IX8Am9KEOaLhWxFPXKA/qKBjOsqA=; b=BUNJP5ZyPo8Y/FZINn9h6zH/ZuoRqpnST0u/YBLaA8rgLZaBclZo3QXUtl+zi90/kf THomTqR7elDsFv+T+kWHUhrmBnPZ+aU7yVaxcjRlGBfFzeRqZm8BmNHqLoOrv1VLsZKE kI2UvAEXgBsM/ywjAsn/JAFjFZKnPoIpagdqSQcsIyF1AmS7GFSwa/JZKUWgK7FykF8x oXVpoAcOGQHLPxEThlMXqPugD8Sjk5SDGspYJmTzO6mOLEi6JutCfQaR3pI5aSS1ibfR MNqibnCRJ/vbRWYdbHymGpJmpUfLjg2Kx0vSB0FYTs4o/aARwZEqf9TmcO4LzHZrEaDB vilw== X-Gm-Message-State: AD7BkJKYrrzT+XVgXygTVJ7z5nzYGFnRGZz4vWiKfTom2EqZx2e/8bqboSbjjL6Z/7a8FA== X-Received: by 10.66.141.11 with SMTP id rk11mr52033754pab.75.1458628478934; Mon, 21 Mar 2016 23:34:38 -0700 (PDT) Received: from localhost.localdomain ([103.51.94.59]) by smtp.gmail.com with ESMTPSA id to9sm45273692pab.27.2016.03.21.23.34.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 21 Mar 2016 23:34:38 -0700 (PDT) From: Nutan Shinde To: qemu-devel@nongnu.org Date: Tue, 22 Mar 2016 12:04:17 +0530 Message-Id: <1458628457-1352-1-git-send-email-nutanshinde1992@gmail.com> X-Mailer: git-send-email 2.7.4.windows.1 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::243 Cc: Nutan Shinde Subject: [Qemu-devel] [PATCH] hw/display contains files named *_template.h. These are included many times with different values of the DEPTH macro. However, only the DEPTH == 32 case is used. Removed support for DEPTH != 32 in the template headers and in the file that include them. 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+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 Signed-off-by: Nutan Shinde --- hw/display/blizzard.c | 8 -------- hw/display/blizzard_template.h | 26 +------------------------- hw/display/omap_lcd_template.h | 8 +------- hw/display/omap_lcdc.c | 6 ------ hw/display/sm501.c | 17 ----------------- hw/display/sm501_template.h | 8 +------- 6 files changed, 3 insertions(+), 70 deletions(-) diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c index c231960..da5e133 100644 --- a/hw/display/blizzard.c +++ b/hw/display/blizzard.c @@ -925,14 +925,6 @@ static void blizzard_update_display(void *opaque) s->my[1] = 0; } -#define DEPTH 8 -#include "blizzard_template.h" -#define DEPTH 15 -#include "blizzard_template.h" -#define DEPTH 16 -#include "blizzard_template.h" -#define DEPTH 24 -#include "blizzard_template.h" #define DEPTH 32 #include "blizzard_template.h" diff --git a/hw/display/blizzard_template.h b/hw/display/blizzard_template.h index b7ef27c..a4c733d 100644 --- a/hw/display/blizzard_template.h +++ b/hw/display/blizzard_template.h @@ -19,31 +19,7 @@ */ #define SKIP_PIXEL(to) (to += deststep) -#if DEPTH == 8 -# define PIXEL_TYPE uint8_t -# define COPY_PIXEL(to, from) do { *to = from; SKIP_PIXEL(to); } while (0) -# define COPY_PIXEL1(to, from) (*to++ = from) -#elif DEPTH == 15 || DEPTH == 16 -# define PIXEL_TYPE uint16_t -# define COPY_PIXEL(to, from) do { *to = from; SKIP_PIXEL(to); } while (0) -# define COPY_PIXEL1(to, from) (*to++ = from) -#elif DEPTH == 24 -# define PIXEL_TYPE uint8_t -# define COPY_PIXEL(to, from) \ - do { \ - to[0] = from; \ - to[1] = (from) >> 8; \ - to[2] = (from) >> 16; \ - SKIP_PIXEL(to); \ - } while (0) - -# define COPY_PIXEL1(to, from) \ - do { \ - *to++ = from; \ - *to++ = (from) >> 8; \ - *to++ = (from) >> 16; \ - } while (0) -#elif DEPTH == 32 +#if DEPTH == 32 # define PIXEL_TYPE uint32_t # define COPY_PIXEL(to, from) do { *to = from; SKIP_PIXEL(to); } while (0) # define COPY_PIXEL1(to, from) (*to++ = from) diff --git a/hw/display/omap_lcd_template.h b/hw/display/omap_lcd_template.h index f0ce71f..c1714ce 100644 --- a/hw/display/omap_lcd_template.h +++ b/hw/display/omap_lcd_template.h @@ -27,13 +27,7 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#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 diff --git a/hw/display/omap_lcdc.c b/hw/display/omap_lcdc.c index ce1058b..84b5f79 100644 --- a/hw/display/omap_lcdc.c +++ b/hw/display/omap_lcdc.c @@ -71,12 +71,6 @@ static void omap_lcd_interrupts(struct omap_lcd_panel_s *s) #define draw_line_func drawfn -#define DEPTH 8 -#include "omap_lcd_template.h" -#define DEPTH 15 -#include "omap_lcd_template.h" -#define DEPTH 16 -#include "omap_lcd_template.h" #define DEPTH 32 #include "omap_lcd_template.h" diff --git a/hw/display/sm501.c b/hw/display/sm501.c index 2957243..3fb64b5 100644 --- a/hw/display/sm501.c +++ b/hw/display/sm501.c @@ -1170,23 +1170,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" 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