From patchwork Sat Mar 26 05:57:53 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pooja Dhannawat X-Patchwork-Id: 8674051 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 4B0B59F326 for ; Sat, 26 Mar 2016 05:58:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3C44F2021A for ; Sat, 26 Mar 2016 05:58:12 +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 56D6F20219 for ; Sat, 26 Mar 2016 05:58:11 +0000 (UTC) Received: from localhost ([::1]:59031 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajhEg-0003rb-IY for patchwork-qemu-devel@patchwork.kernel.org; Sat, 26 Mar 2016 01:58:10 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:43148) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajhEZ-0003rV-Cn for qemu-devel@nongnu.org; Sat, 26 Mar 2016 01:58:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ajhEW-0002lq-6A for qemu-devel@nongnu.org; Sat, 26 Mar 2016 01:58:03 -0400 Received: from mail-pa0-x244.google.com ([2607:f8b0:400e:c03::244]:36793) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ajhEV-0002ll-RB for qemu-devel@nongnu.org; Sat, 26 Mar 2016 01:58:00 -0400 Received: by mail-pa0-x244.google.com with SMTP id 1so8626979pal.3 for ; Fri, 25 Mar 2016 22:57:59 -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=u4u+U7TScbXL8Sm2acXUgZwlrN2+G3M0Uwz4BUXjDf8=; b=aPfj9GE2ROVD9mjn0IaQJ1DNOTHqQuCJglBk3getbAqWP3RBNHdoTQXU23vGaclUT6 siq9ivO4I3kWVKCzWFoRRRTrEWzO2ssnV1YUBbvSWodNvcL7VQ0QsyR91SI7NXfa3zBJ LfcC+t6SZXMaSImUgEJUxWe8kyCEk7i4jTB1sOq9Na77HO6QwibjN/WKWjlYfJp04ZJH rznML3IQXM9eARhfkho1YIGs8nkc/9oGNodQVRwS578Hk4PIJ0u1UjCBESRheTLVdE7b GISXuFkpd9i2zOoqb0MA61pZa1+ZDA4zaWMfQuDDVSUCCItHr35uwrzmEhmLFIaVvCUz nf3w== 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=u4u+U7TScbXL8Sm2acXUgZwlrN2+G3M0Uwz4BUXjDf8=; b=NrlQlczMnJ3VX5AWhaLLwfi4AhWia0KfDITO2iRsY3p6B5Z9ASsDXNeCkdVLer8qxd IVT8BI7mU94RNErOJl8kwVjOlBpPza1N8L0b16fkxMsIruZpgOE1Aq3l7eK5zFPkn7P9 YjSKTzYmPET8EiyPruTPhQ76eW/LELICP00hNjPxvr8hq+3Cben75DBqPME5qvzrE0TZ XJZMx3SR56pKKc2TmZyj2zu/MJ8/I3eLwxVa9ugaPDtg5IaxtLeqjYqlJJqs6cMYfUHr 0pVy5T3Ro8bbRv4x2GskGd6M7xAoJhKjTZQR4EzTFyvLNHDZaFoDvO+P6R2jg0BLl2/t QiUw== X-Gm-Message-State: AD7BkJJhYotcgYcZ6MHaX4G2cFOl3mEcuCbAGOIG+Qam1T3jOMC8bGZa0AIsMN63J0ifHg== X-Received: by 10.67.3.67 with SMTP id bu3mr25989128pad.39.1458971878692; Fri, 25 Mar 2016 22:57:58 -0700 (PDT) Received: from Inspiron-N5010.domain.name ([183.87.60.98]) by smtp.gmail.com with ESMTPSA id wy7sm20204534pab.5.2016.03.25.22.57.57 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 25 Mar 2016 22:57:58 -0700 (PDT) From: Pooja Dhannawat To: qemu-devel@nongnu.org Date: Sat, 26 Mar 2016 11:27:53 +0530 Message-Id: <1458971873-2768-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:c03::244 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=-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 blizzard template header and file that includes it, as macro DEPTH == 32 only used. Reviewed-by: Eric Blake Signed-off-by: Pooja Dhannawat --- 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,