From patchwork Thu Mar 24 18:18:09 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pooja Dhannawat X-Patchwork-Id: 8663721 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C5BDD9F44D for ; Thu, 24 Mar 2016 18:18:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0FB1720380 for ; Thu, 24 Mar 2016 18:18:32 +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 5285B2037C for ; Thu, 24 Mar 2016 18:18:31 +0000 (UTC) Received: from localhost ([::1]:52202 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj9q2-00011j-Al for patchwork-qemu-devel@patchwork.kernel.org; Thu, 24 Mar 2016 14:18:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:57070) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj9ps-00011J-SY for qemu-devel@nongnu.org; Thu, 24 Mar 2016 14:18:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aj9po-0000lE-Rb for qemu-devel@nongnu.org; Thu, 24 Mar 2016 14:18:20 -0400 Received: from mail-pf0-x244.google.com ([2607:f8b0:400e:c00::244]:35178) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aj9po-0000lA-Fy for qemu-devel@nongnu.org; Thu, 24 Mar 2016 14:18:16 -0400 Received: by mail-pf0-x244.google.com with SMTP id u190so9111363pfb.2 for ; Thu, 24 Mar 2016 11:18:16 -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=h2pVt5ROu3r3N+ARKMkH2OMW5V7XQ3xoLX+/+FuJJDY=; b=xvX4rvRJtCPfkfFvPIAw8XYd8DT4zHmL9nxtjlRCsOcMvlNRmj9A9FP1dW/XzFv3dl hP3AGWekz+zRV07AkKdzAqLpDcBAWXNf5QigcrBs9I2wL/ZCW0wNcvPUh0gMTzkPhy+w yMFCADf3CbZvNzxJxlpqVcqMysoQYHhQ/zrShoDN4z+JPZB7VdlnZmxbInRR4xwaLzmC WEmCTmxbYT++GLM3fgEYY/lN7h6ZtdHo5ommWW1yRhqo8h2Wcef+cNoV4S4wVseF1Yuv dLnQbtk7/hrB/CydcwOb/bBIofoqxicKK6r7YQnUfzFM6gx23WQc6fiQHfieoyPXaXnY QB6w== 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=h2pVt5ROu3r3N+ARKMkH2OMW5V7XQ3xoLX+/+FuJJDY=; b=ktQDEsJLYWbdhaowd9UzBeVRdEErR86GvcK8YlmnSyW4h4s5Z4kXoALuY9+zo+8I/q VJRRZo5DYJy/D33Fc/iBCRhnL1wGjbsBglq3tQQv9pcMfYpMytSne93bzbioeBxcTDeG sh5nEkarV1sg0sL/mdAl/jCu96qe4stCHA7HT1F5vdtvcR/Vkztznh1pVlxhUy1kua08 E6p5JpzmqTtYcE4l2Ph30RBAuQBQ9218rYDMpfz9Ae+mg8ouURIBnM7EaP4iEWHdMyE9 hfOikx2JWWOk9sUCUpnecRqKpID713XXb89QBBhjpGVErSk9iwgw2WafU881wD2lsVaU wtLg== X-Gm-Message-State: AD7BkJIYGQcblmLW1ur1GW5l6KbW+YEqtJX/nHd56fWodDFBEOBUZaig1NhoMPrdqv9L0g== X-Received: by 10.98.66.75 with SMTP id p72mr15052338pfa.50.1458843495426; Thu, 24 Mar 2016 11:18:15 -0700 (PDT) Received: from Inspiron-N5010.domain.name ([183.87.60.98]) by smtp.gmail.com with ESMTPSA id s197sm11601131pfs.62.2016.03.24.11.18.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 24 Mar 2016 11:18:14 -0700 (PDT) From: Pooja Dhannawat To: qemu-devel@nongnu.org Date: Thu, 24 Mar 2016 23:48:09 +0530 Message-Id: <1458843489-14104-1-git-send-email-dhannawatpooja1@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::244 Cc: kraxel@redhat.com Subject: [Qemu-devel] [PATCH v4] blizzard: Remove support for DEPTH != 32 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=-5.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_BL_SPAMCOP_NET,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 blizzard template header and file that includes it, as macro DEPTH == 32 only used. Signed-off-by: Pooja Dhannawat Reviewed-by: Eric Blake --- hw/display/blizzard.c | 41 ++++------------------------------------- hw/display/blizzard_template.h | 30 +----------------------------- 2 files changed, 5 insertions(+), 66 deletions(-) diff --git a/hw/display/blizzard.c b/hw/display/blizzard.c index c231960..5684e49 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" @@ -951,35 +943,10 @@ void *s1d13745_init(qemu_irq gpio_int) s->con = graphic_console_init(NULL, 0, &blizzard_ops, s); surface = qemu_console_surface(s->con); - switch (surface_bits_per_pixel(surface)) { - case 0: - s->line_fn_tab[0] = s->line_fn_tab[1] = - g_malloc0(sizeof(blizzard_fn_t) * 0x10); - break; - case 8: - s->line_fn_tab[0] = blizzard_draw_fn_8; - s->line_fn_tab[1] = blizzard_draw_fn_r_8; - break; - case 15: - s->line_fn_tab[0] = blizzard_draw_fn_15; - s->line_fn_tab[1] = blizzard_draw_fn_r_15; - break; - case 16: - s->line_fn_tab[0] = blizzard_draw_fn_16; - s->line_fn_tab[1] = blizzard_draw_fn_r_16; - break; - case 24: - s->line_fn_tab[0] = blizzard_draw_fn_24; - s->line_fn_tab[1] = blizzard_draw_fn_r_24; - break; - case 32: - s->line_fn_tab[0] = blizzard_draw_fn_32; - s->line_fn_tab[1] = blizzard_draw_fn_r_32; - break; - default: - fprintf(stderr, "%s: Bad color depth\n", __FUNCTION__); - exit(1); - } + assert(surface_bits_per_pixel(surface) == 32) + + s->line_fn_tab[0] = blizzard_draw_fn_32; + s->line_fn_tab[1] = blizzard_draw_fn_r_32; blizzard_reset(s); diff --git a/hw/display/blizzard_template.h b/hw/display/blizzard_template.h index b7ef27c..bc38d7a 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) @@ -58,9 +34,6 @@ static void glue(blizzard_draw_line16_, DEPTH)(PIXEL_TYPE *dest, const uint16_t *src, unsigned int width) { -#if !defined(SWAP_WORDS) && DEPTH == 16 - memcpy(dest, src, width); -#else uint16_t data; unsigned int r, g, b; const uint16_t *end = (const void *) src + width; @@ -74,7 +47,6 @@ static void glue(blizzard_draw_line16_, DEPTH)(PIXEL_TYPE *dest, data >>= 5; COPY_PIXEL1(dest, glue(rgb_to_pixel, DEPTH)(r, g, b)); } -#endif } static void glue(blizzard_draw_line24mode1_, DEPTH)(PIXEL_TYPE *dest,