From patchwork Thu Apr 28 09:50:04 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: 8970621 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 F1E29BF29F for ; Thu, 28 Apr 2016 13:27:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 43330202EB for ; Thu, 28 Apr 2016 13:27:35 +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 50269202EC for ; Thu, 28 Apr 2016 13:27:33 +0000 (UTC) Received: from localhost ([::1]:49129 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1avlye-0002fH-J5 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 28 Apr 2016 09:27:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56542) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aviaL-0006Ma-QC for qemu-devel@nongnu.org; Thu, 28 Apr 2016 05:50:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aviaI-00088x-Io for qemu-devel@nongnu.org; Thu, 28 Apr 2016 05:50:13 -0400 Received: from mail-pf0-x242.google.com ([2607:f8b0:400e:c00::242]:34855) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aviaI-00088i-9V for qemu-devel@nongnu.org; Thu, 28 Apr 2016 05:50:10 -0400 Received: by mail-pf0-x242.google.com with SMTP id r187so9848247pfr.2 for ; Thu, 28 Apr 2016 02:50:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id; bh=MueLoWypsqw522qk/2//Iyp1IPrschSoRH3dDDVbiug=; b=VN7BmitpZE53ZEEPy3+fClzJsws3voTHbbWT7Al2cI5sx6wItxEV+i3B4zs6xeOkDu zUqJXG28rGAwIodx7CwJRhuUmUaOur2EVr4Z8lUFcp9VzI+9JtILv8rDdifAEuyUOglo qtzx0r0HnAunO0rIbbD5jgJ6a1XI6c3kePdkHAatuBNFZbNc4frmu6lAcrcp/J/op0u5 BVa+ZCmzCUNybCAvfgAgMqVRZO071Ym88qNrOQFOt/Eup4DH7lmoeUYS/xPPuXWQcAUv fFdkJY6vX5oBtPGFgQ8rEDPSeg5ffJlLX+XTiL60mSX7U8Aywxc+8+njgFRmafbAViKz ZcgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:subject:date:message-id; bh=MueLoWypsqw522qk/2//Iyp1IPrschSoRH3dDDVbiug=; b=VIA0eSRXYFFcJvXzoGdwgTdAGe4dQKot5phT1meBtafIW3YQrxoonkvxrbre6YWBrL fk6pPVLgPfOe1kaI/HMXmaHxbOoNKn2IykkRZLvMzA5R8DNPVuNb3jv3Y9TM7FWlACLy XGY231P0B3F4PQV8+iVzfkAwp6tkeT7SvoSyOftdO81KHgeDHwHRQo6acOOeTOgfGrEK c4KtjuobE6gp3djTrEEWJLRRJDySzazEnTUUZJ9hxS03vOB1VuXxF9yW6U90fBZt+DK4 66uBUonf37LWca/PJMxp1pTUgiy8874BjD6wKXsYpixO4hW75oPLGrRwGL2uSNbPxDMU 3/BQ== X-Gm-Message-State: AOPr4FVuqMyXMPcZCdQG694wj0DVjpHsi7sSlqefAkx0imD/HR/jWDTqJY/YnOEQ3sNGYQ== X-Received: by 10.98.1.197 with SMTP id 188mr19082762pfb.8.1461837008793; Thu, 28 Apr 2016 02:50:08 -0700 (PDT) Received: from sagarg2.talentica-all.com ([114.143.194.102]) by smtp.googlemail.com with ESMTPSA id w20sm13407633pfi.31.2016.04.28.02.50.07 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 28 Apr 2016 02:50:08 -0700 (PDT) From: Sagar Ghuge To: qemu-devel@nongnu.org Date: Thu, 28 Apr 2016 15:20:04 +0530 Message-Id: <1461837004-29348-1-git-send-email-ghugesss@gmail.com> X-Mailer: git-send-email 2.5.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:400e:c00::242 X-Mailman-Approved-At: Thu, 28 Apr 2016 09:23:18 -0400 Subject: [Qemu-devel] [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: , 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, 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 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(-) 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