From patchwork Mon Feb 15 10:32:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440448 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=ea4ZvHpo; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfLFY0ByFz9rx6 for ; Mon, 15 Feb 2021 21:39:27 +1100 (AEDT) Received: from localhost ([::1]:46678 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbHo-0003rn-6n for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:39:24 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50102) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbB6-0004LG-Gu for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:28 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:39392) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbAy-0001gY-5Z for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:28 -0500 Received: by mail-wr1-x42d.google.com with SMTP id v1so8243373wrd.6 for ; Mon, 15 Feb 2021 02:32:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=98metf9b+/ml/auWYKtWya5ML6A+NXJr1FzCort0L/8=; b=ea4ZvHpoz4gc32lzGgN86OXAWJ7g7wk3p9H4lRboS1G4n3SlFX1RJi8TCWBFxzCNw4 rih7+HaX/ZR1XYAtXytMLU3yd0FKApPgeD+Wy+paI0VtwKoIQWf68HeuXCcj+lxwRTYc Q0Nso0pPfLxhr0052ltbx54rtGoQBJwALsUa76Q/CYaZdag+stijDeaXIADFisFX3qRv vGJWVi6k6kR/7iTpKCYtwdYcI7PmcR5GrKA4/W7lvdRxfa422gfc24qGsiWs6ZH9KfVS H775EOMMOS1bCvBChtsyEl37+22jdNHu477GsTyyWp1/sDfXW1PsCkvAfyNlunC+aX0Q ChXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=98metf9b+/ml/auWYKtWya5ML6A+NXJr1FzCort0L/8=; b=E9f3hbIZdVtwElbq2wVKKiF61VU21E9VU4FEMRAVZFsthSwPw4VH9y9VS68bjZSSkl 8lg9v2NZ63YI4Q2RnaX8vGNIqw9gBmADlIIiJJD8tDcOG6w2x4PY0NHFV38EZDnU1oro 0nDCX93seae7MgUWNf176KiSBlAcS3V5jvnP363/N/DA1jID1UalG6XRx0vTG+X21fne VAnIF/OnWaEah8TatbABN+uOLmgzOBobhrLtl94oEH7vX0NbIDys1psIlYY7YAOveeNX nyNG6LRPZyqOYtqJh8D5md78drgXKQKAuG2Fg1U1YAGhWr5ZlxMj3Xswlbw8qmCHxxzj raAw== X-Gm-Message-State: AOAM5336W92r1gYR1maQ+6VTXnly+mOu2MKQLhsAp76kN7/qFlfn9DH6 veE78dHU1ja394bMnoqNPO/0dg== X-Google-Smtp-Source: ABdhPJxC7M5p6jb3gAaVRjBavNAOV3DOsen77foj3+wuH0+ndDT9CkZ5xuH7fbMZPtUDHULM2xeyMA== X-Received: by 2002:adf:eb82:: with SMTP id t2mr17997931wrn.231.1613385138620; Mon, 15 Feb 2021 02:32:18 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:18 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 1/9] hw/arm/musicpal: Remove dead code for non-32-bit-RGB surfaces Date: Mon, 15 Feb 2021 10:32:07 +0000 Message-Id: <20210215103215.4944-2-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" For a long time now the UI layer has guaranteed that the console surface is always 32 bits per pixel RGB. Remove the legacy dead code from the milkymist display device which was handling the possibility that the console surface was some other format. Signed-off-by: Peter Maydell --- hw/arm/musicpal.c | 64 ++++++++++++++++++----------------------------- 1 file changed, 24 insertions(+), 40 deletions(-) diff --git a/hw/arm/musicpal.c b/hw/arm/musicpal.c index 6aec84aeed8..9cebece2de0 100644 --- a/hw/arm/musicpal.c +++ b/hw/arm/musicpal.c @@ -512,53 +512,37 @@ static uint8_t scale_lcd_color(musicpal_lcd_state *s, uint8_t col) } } -#define SET_LCD_PIXEL(depth, type) \ -static inline void glue(set_lcd_pixel, depth) \ - (musicpal_lcd_state *s, int x, int y, type col) \ -{ \ - int dx, dy; \ - DisplaySurface *surface = qemu_console_surface(s->con); \ - type *pixel = &((type *) surface_data(surface))[(y * 128 * 3 + x) * 3]; \ -\ - for (dy = 0; dy < 3; dy++, pixel += 127 * 3) \ - for (dx = 0; dx < 3; dx++, pixel++) \ - *pixel = col; \ +static inline void set_lcd_pixel32(musicpal_lcd_state *s, + int x, int y, uint32_t col) +{ + int dx, dy; + DisplaySurface *surface = qemu_console_surface(s->con); + uint32_t *pixel = + &((uint32_t *) surface_data(surface))[(y * 128 * 3 + x) * 3]; + + for (dy = 0; dy < 3; dy++, pixel += 127 * 3) { + for (dx = 0; dx < 3; dx++, pixel++) { + *pixel = col; + } + } } -SET_LCD_PIXEL(8, uint8_t) -SET_LCD_PIXEL(16, uint16_t) -SET_LCD_PIXEL(32, uint32_t) static void lcd_refresh(void *opaque) { musicpal_lcd_state *s = opaque; - DisplaySurface *surface = qemu_console_surface(s->con); int x, y, col; - switch (surface_bits_per_pixel(surface)) { - case 0: - return; -#define LCD_REFRESH(depth, func) \ - case depth: \ - col = func(scale_lcd_color(s, (MP_LCD_TEXTCOLOR >> 16) & 0xff), \ - scale_lcd_color(s, (MP_LCD_TEXTCOLOR >> 8) & 0xff), \ - scale_lcd_color(s, MP_LCD_TEXTCOLOR & 0xff)); \ - for (x = 0; x < 128; x++) { \ - for (y = 0; y < 64; y++) { \ - if (s->video_ram[x + (y/8)*128] & (1 << (y % 8))) { \ - glue(set_lcd_pixel, depth)(s, x, y, col); \ - } else { \ - glue(set_lcd_pixel, depth)(s, x, y, 0); \ - } \ - } \ - } \ - break; - LCD_REFRESH(8, rgb_to_pixel8) - LCD_REFRESH(16, rgb_to_pixel16) - LCD_REFRESH(32, (is_surface_bgr(surface) ? - rgb_to_pixel32bgr : rgb_to_pixel32)) - default: - hw_error("unsupported colour depth %i\n", - surface_bits_per_pixel(surface)); + col = rgb_to_pixel32(scale_lcd_color(s, (MP_LCD_TEXTCOLOR >> 16) & 0xff), + scale_lcd_color(s, (MP_LCD_TEXTCOLOR >> 8) & 0xff), + scale_lcd_color(s, MP_LCD_TEXTCOLOR & 0xff)); + for (x = 0; x < 128; x++) { + for (y = 0; y < 64; y++) { + if (s->video_ram[x + (y / 8) * 128] & (1 << (y % 8))) { + set_lcd_pixel32(s, x, y, col); + } else { + set_lcd_pixel32(s, x, y, 0); + } + } } dpy_gfx_update(s->con, 0, 0, 128*3, 64*3); From patchwork Mon Feb 15 10:32:08 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440446 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=WSxolL9d; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfLBW4H4cz9sBy for ; Mon, 15 Feb 2021 21:36:51 +1100 (AEDT) Received: from localhost ([::1]:38602 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbFJ-0000Ji-GS for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:36:49 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50130) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbB7-0004NS-Ce for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:29 -0500 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]:35694) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbAy-0001gz-Kx for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:29 -0500 Received: by mail-wr1-x430.google.com with SMTP id l12so8287415wry.2 for ; Mon, 15 Feb 2021 02:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=9bceLBdb3iGzpfJ2NpcGXJpz+JJSn554nq+lipt4b8U=; b=WSxolL9dBqJYDnTcboOhCriAiAv+qWe5xEakY2FqT2MDmz7K9m4YOpuUygqbUhEgKM SSoqvKddfiNOcvK+5LdxsasvEWt5v6KeLXWRQWy3+FWtF3pcR3Of4z0H03vnrxf8e5hO s01wPzgQpv4KKBjxep13VJSy4HgsS2ptzuH0JpDt4xnOU+jHGRqH7wqiFcKppFulHHwa zwWs1TNKgLakLfPDXkoIF5zp3czaFvmGQXQR1Ii9OTm9USA9A3XGOrP/HpyEQYgjbzJT CE++Cfh/70/wQML9IfV6uMsRLoC0mj3lgLsO6sueDVdgO6QbYSlkuVyN+OJi27F5d2IC cwvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=9bceLBdb3iGzpfJ2NpcGXJpz+JJSn554nq+lipt4b8U=; b=NIgu9Dbm5Ztf9AG84Q713HYvmq9tAs71PzrCnMsnEnhz+G3XamWnUpwJHhBsOaW/9U 2le2ehX1Y4/yFYTdmkZ1o2X6yykesO6u/f+wLUEEGfbAZ+OV2hTOad5GnH1g5T/Genbr A0vN1Q8UuKOQpOwZIGIsRoX0wEPvl6BiuABPteMlpX5CEHyncoYFhs5gsnKMOlXR0Cxr K4rNuuyHOmc9HrZKiQvuzJ9fBQRbwHfXyk1JcmuThooDujBYeRh676vVr7/DV74p3MlG gYhRTXhJ7b6caoK5po7HAj5x66jReKHBbTMv4y9K5ghbGXUQJMdKHG04C+mozYUAyalt y6kQ== X-Gm-Message-State: AOAM532+1mPtLMiQtw3fT4+ebWyW7Gb5xS6PXHHuTQ2JQVgzfUxlY3Ti iAwD2bepaHKwO/za1uSVEaJ3pw== X-Google-Smtp-Source: ABdhPJwRhAZtrdI+j58sN1SYNelhzFf0+kpiQ3VASYCRwYiHiztpUtIn/G78agRHDPWBWBkvKuhDrA== X-Received: by 2002:a5d:5910:: with SMTP id v16mr7496639wrd.304.1613385139338; Mon, 15 Feb 2021 02:32:19 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:19 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 2/9] hw/display/tc6393xb: Remove dead code for handling non-32bpp surfaces Date: Mon, 15 Feb 2021 10:32:08 +0000 Message-Id: <20210215103215.4944-3-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::430; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x430.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" For a long time now the UI layer has guaranteed that the console surface is always 32 bits per pixel RGB. Remove the legacy dead code from the tc6393xb display device which was handling the possibility that the console surface was some other format. Signed-off-by: Peter Maydell --- include/ui/console.h | 10 ---------- hw/display/tc6393xb.c | 33 +-------------------------------- 2 files changed, 1 insertion(+), 42 deletions(-) diff --git a/include/ui/console.h b/include/ui/console.h index d30e972d0b5..ed086f9f1ad 100644 --- a/include/ui/console.h +++ b/include/ui/console.h @@ -266,16 +266,6 @@ PixelFormat qemu_default_pixelformat(int bpp); DisplaySurface *qemu_create_displaysurface(int width, int height); void qemu_free_displaysurface(DisplaySurface *surface); -static inline int is_surface_bgr(DisplaySurface *surface) -{ - if (PIXMAN_FORMAT_BPP(surface->format) == 32 && - PIXMAN_FORMAT_TYPE(surface->format) == PIXMAN_TYPE_ABGR) { - return 1; - } else { - return 0; - } -} - static inline int is_buffer_shared(DisplaySurface *surface) { return !(surface->flags & QEMU_ALLOCATED_FLAG); diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c index 49a676d1b0e..4cddb1a99ad 100644 --- a/hw/display/tc6393xb.c +++ b/hw/display/tc6393xb.c @@ -410,43 +410,12 @@ static void tc6393xb_nand_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) (uint32_t) addr, value & 0xff); } -#define BITS 8 -#include "tc6393xb_template.h" -#define BITS 15 -#include "tc6393xb_template.h" -#define BITS 16 -#include "tc6393xb_template.h" -#define BITS 24 -#include "tc6393xb_template.h" #define BITS 32 #include "tc6393xb_template.h" static void tc6393xb_draw_graphic(TC6393xbState *s, int full_update) { - DisplaySurface *surface = qemu_console_surface(s->con); - - switch (surface_bits_per_pixel(surface)) { - case 8: - tc6393xb_draw_graphic8(s); - break; - case 15: - tc6393xb_draw_graphic15(s); - break; - case 16: - tc6393xb_draw_graphic16(s); - break; - case 24: - tc6393xb_draw_graphic24(s); - break; - case 32: - tc6393xb_draw_graphic32(s); - break; - default: - printf("tc6393xb: unknown depth %d\n", - surface_bits_per_pixel(surface)); - return; - } - + tc6393xb_draw_graphic32(s); dpy_gfx_update_full(s->con); } From patchwork Mon Feb 15 10:32:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440441 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=r5trOF4x; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfL6v375wz9rx6 for ; Mon, 15 Feb 2021 21:33:43 +1100 (AEDT) Received: from localhost ([::1]:57932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbCH-0004tA-BE for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:33:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50104) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbB6-0004Lm-PE for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:28 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:42507) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbAz-0001i0-G8 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:28 -0500 Received: by mail-wr1-x432.google.com with SMTP id r21so8219134wrr.9 for ; Mon, 15 Feb 2021 02:32:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8Pn0+fUrgN1cOJcpBnEN8VL4IjMtADYNe+/RkpTUxHU=; b=r5trOF4xH7tJBTDZ4+nVU57V0qVY5k0jgPOn+V34UGgaOIWA1ec6z3k4c1Txa9HIIk Yb5s0ANl6Xolqt+A9f8kzTTI/lCVY5OXv9dvawjLxo92YY5LRDcAS3CWEQUygUg60pI1 8PSOkg+bRUqO0T1fgl6N3WXnuRfUCqO3hm8s/l77HnplUkQOVdMIwwE7bwcnStb+oit4 Vj+Uxb2XAQJfN2qp1XeEhc3G990pi8Gz3TnYS27jVg8S4wapUUosVlWF5LCMMt0bO3Qi QtuqO8nk7BbJ00tfmhjIu6rh96uDRiJvwK1eroklgU/ySE9U5UKCtK19HusMytBJ69FP E4tA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=8Pn0+fUrgN1cOJcpBnEN8VL4IjMtADYNe+/RkpTUxHU=; b=nj4QCKaSTu6Pi+8kSS7FB9sbinP5yutx+npgzFQplvOANhh4SjOlIQZJHVh+QIHdCa WEPUXXRNEvd6sj8JbTxNplV0QG34Xiv67IMeJbdW0VbOKw8zBkl1l/rcrJSghS4kPO0W E90xcMhIeM2irZJegsLKK12yotExdxBnFeIL+1jhN4SUVIqVWZ95JnXix018lekEmsZX DGvZu9z/M5NJszlNw/AVZZIozzQWn+fw2VVeuG9uGxdloLq8RTnoW1kmW7eVb7SDYMVi 8cUNAlHmI1UAUsC5UK4NlEEzOfl3jqXw8BI9m/wHcnnkMjTH3FgQNtVm/ymSvZh9rSmz +Y9g== X-Gm-Message-State: AOAM533z6E60+l7vtj09Q4Eg2vF2T837stDDgsjP1MYc2GAepCXeq62X TgmWtMRb7jCTwB2E475QHk3kAZAaEEiRxQ== X-Google-Smtp-Source: ABdhPJzmhcWnFYLRSkUqIeo7H7hE4kJ5Efdn/KTEdPycbCM5GH3Wxfbn10dzr6zozOmVA41DuExnZg== X-Received: by 2002:a5d:5705:: with SMTP id a5mr14769676wrv.333.1613385140064; Mon, 15 Feb 2021 02:32:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:19 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 3/9] hw/display/tc6393xb: Expand out macros in template header Date: Mon, 15 Feb 2021 10:32:09 +0000 Message-Id: <20210215103215.4944-4-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now the template header is included only for BITS==32, expand out all the macros that depended on the BITS setting. Signed-off-by: Peter Maydell --- hw/display/tc6393xb_template.h | 35 ++++------------------------------ 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/hw/display/tc6393xb_template.h b/hw/display/tc6393xb_template.h index 78629c07f97..7789ffc4399 100644 --- a/hw/display/tc6393xb_template.h +++ b/hw/display/tc6393xb_template.h @@ -21,25 +21,7 @@ * with this program; if not, see . */ -#if BITS == 8 -# define SET_PIXEL(addr, color) (*(uint8_t *)addr = color) -#elif BITS == 15 || BITS == 16 -# define SET_PIXEL(addr, color) (*(uint16_t *)addr = color) -#elif BITS == 24 -# define SET_PIXEL(addr, color) \ - do { \ - addr[0] = color; \ - addr[1] = (color) >> 8; \ - addr[2] = (color) >> 16; \ - } while (0) -#elif BITS == 32 -# define SET_PIXEL(addr, color) (*(uint32_t *)addr = color) -#else -# error unknown bit depth -#endif - - -static void glue(tc6393xb_draw_graphic, BITS)(TC6393xbState *s) +static void tc6393xb_draw_graphic32(TC6393xbState *s) { DisplaySurface *surface = qemu_console_surface(s->con); int i; @@ -49,24 +31,15 @@ static void glue(tc6393xb_draw_graphic, BITS)(TC6393xbState *s) data_buffer = s->vram_ptr; data_display = surface_data(surface); for(i = 0; i < s->scr_height; i++) { -#if (BITS == 16) - memcpy(data_display, data_buffer, s->scr_width * 2); - data_buffer += s->scr_width; - data_display += surface_stride(surface); -#else int j; - for (j = 0; j < s->scr_width; j++, data_display += BITS / 8, data_buffer++) { + for (j = 0; j < s->scr_width; j++, data_display += 4, data_buffer++) { uint16_t color = *data_buffer; - uint32_t dest_color = glue(rgb_to_pixel, BITS)( + uint32_t dest_color = rgb_to_pixel32( ((color & 0xf800) * 0x108) >> 11, ((color & 0x7e0) * 0x41) >> 9, ((color & 0x1f) * 0x21) >> 2 ); - SET_PIXEL(data_display, dest_color); + *(uint32_t *)data_display = dest_color; } -#endif } } - -#undef BITS -#undef SET_PIXEL From patchwork Mon Feb 15 10:32:10 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440442 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=KzejVWJ5; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfL6y34Kxz9rx6 for ; Mon, 15 Feb 2021 21:33:46 +1100 (AEDT) Received: from localhost ([::1]:58222 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbCK-00050U-D4 for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:33:44 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50108) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbB6-0004MK-Vo for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:29 -0500 Received: from mail-wr1-x436.google.com ([2a00:1450:4864:20::436]:35700) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbB1-0001iD-La for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:28 -0500 Received: by mail-wr1-x436.google.com with SMTP id l12so8287532wry.2 for ; Mon, 15 Feb 2021 02:32:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=TCNOlx/VgRYG2pmzepRt+R1HLAN6RNJ7AMXnp5nQA0Y=; b=KzejVWJ5nFWECl9y+CN8pOyBHoYIuEmd5Q7Cst5grbyQ6FZTQUkbtCSlszURG8xzSZ uJ89CVyvb2XVMfJlraKu10l1ycbYbF9nk+BKZhvGBpd+st4CXjvOJIIYcTNaSwGthP6N rEgB/D7o5NIZS2eWiQ5hIBmIYFmo5pr+UFVfxwehqxqxS1qTi0jQB7fP+bhIwLfxKAap lLK89hs3+WISPawvfdkW7k+QYeYnM9zNqFGU5ArPQtjmavf7sJVMnkWrwMGn0SHeKkV6 ssBRRplXosj2gbzUiLshWxkS24YdlkiFqdEMUnWt1AHhShbBaz6ZAwJn1kXmRtmMKpEK FDOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TCNOlx/VgRYG2pmzepRt+R1HLAN6RNJ7AMXnp5nQA0Y=; b=h+aSpvx5qOloMxAMht5Tr1NL2qlaV/dylPm9rrSVWKZjAZnMghDFGoXZYWQLID8oNi 2pewSTzsvHqCOoYs+OZNqBwFrV7MpzP1sGXfA/qBA1pgwuoAXouDEiojwrEXXOiryq/S zziGpHeQguqDLiLohxZ19kP69TJGgM/iUrqQuGNWtLDgiq+FxWV/UFME0xBYQhVcMQQ/ 1u3S8Vtg0y+npxOKCgNp2xx0lbzZ8vAZwsk9hDFziNinzJJmJN8t5o8u6dgnQsTntheD nJrMDtczx8CvyoJ16wYmGyb+jsRlgUYrvygDnMdlvz8XnB12U/rfoiiMuTva8ArsZAzt Cu2Q== X-Gm-Message-State: AOAM530qo4xtSa1jlmJIjSblnD9+OPUcuxmKNBF0bpT3ahaSUGflLgEZ 5mxGAYY6oGI6o+5NBysVC4yVotOn9GEYHA== X-Google-Smtp-Source: ABdhPJwRRr9/SeGGmTmwlT38tZtyruyZYg3sKLE3kqSQPPCzIBHUUi84yYmJ85I0joqr4y3f5OGwRw== X-Received: by 2002:adf:8544:: with SMTP id 62mr18592437wrh.336.1613385140789; Mon, 15 Feb 2021 02:32:20 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:20 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 4/9] hw/display/tc6393xb: Inline tc6393xb_draw_graphic32() at its callsite Date: Mon, 15 Feb 2021 10:32:10 +0000 Message-Id: <20210215103215.4944-5-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::436; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x436.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The function tc6393xb_draw_graphic32() is called in exactly one place, so just inline the function body at its callsite. This allows us to drop the template header entirely. The code move includes a single added space after 'for' to fix the coding style. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/display/tc6393xb_template.h | 45 ---------------------------------- hw/display/tc6393xb.c | 23 ++++++++++++++--- 2 files changed, 19 insertions(+), 49 deletions(-) delete mode 100644 hw/display/tc6393xb_template.h diff --git a/hw/display/tc6393xb_template.h b/hw/display/tc6393xb_template.h deleted file mode 100644 index 7789ffc4399..00000000000 --- a/hw/display/tc6393xb_template.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Toshiba TC6393XB I/O Controller. - * Found in Sharp Zaurus SL-6000 (tosa) or some - * Toshiba e-Series PDAs. - * - * FB support code. Based on G364 fb emulator - * - * Copyright (c) 2007 Hervé Poussineau - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License as - * published by the Free Software Foundation; either version 2 of - * the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, see . - */ - -static void tc6393xb_draw_graphic32(TC6393xbState *s) -{ - DisplaySurface *surface = qemu_console_surface(s->con); - int i; - uint16_t *data_buffer; - uint8_t *data_display; - - data_buffer = s->vram_ptr; - data_display = surface_data(surface); - for(i = 0; i < s->scr_height; i++) { - int j; - for (j = 0; j < s->scr_width; j++, data_display += 4, data_buffer++) { - uint16_t color = *data_buffer; - uint32_t dest_color = rgb_to_pixel32( - ((color & 0xf800) * 0x108) >> 11, - ((color & 0x7e0) * 0x41) >> 9, - ((color & 0x1f) * 0x21) >> 2 - ); - *(uint32_t *)data_display = dest_color; - } - } -} diff --git a/hw/display/tc6393xb.c b/hw/display/tc6393xb.c index 4cddb1a99ad..1f28223c7be 100644 --- a/hw/display/tc6393xb.c +++ b/hw/display/tc6393xb.c @@ -410,12 +410,27 @@ static void tc6393xb_nand_writeb(TC6393xbState *s, hwaddr addr, uint32_t value) (uint32_t) addr, value & 0xff); } -#define BITS 32 -#include "tc6393xb_template.h" - static void tc6393xb_draw_graphic(TC6393xbState *s, int full_update) { - tc6393xb_draw_graphic32(s); + DisplaySurface *surface = qemu_console_surface(s->con); + int i; + uint16_t *data_buffer; + uint8_t *data_display; + + data_buffer = s->vram_ptr; + data_display = surface_data(surface); + for (i = 0; i < s->scr_height; i++) { + int j; + for (j = 0; j < s->scr_width; j++, data_display += 4, data_buffer++) { + uint16_t color = *data_buffer; + uint32_t dest_color = rgb_to_pixel32( + ((color & 0xf800) * 0x108) >> 11, + ((color & 0x7e0) * 0x41) >> 9, + ((color & 0x1f) * 0x21) >> 2 + ); + *(uint32_t *)data_display = dest_color; + } + } dpy_gfx_update_full(s->con); } From patchwork Mon Feb 15 10:32:11 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440449 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=S2vPhc/W; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfLFY2RJDz9sRR for ; Mon, 15 Feb 2021 21:39:29 +1100 (AEDT) Received: from localhost ([::1]:46988 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbHr-0003zZ-9z for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:39:27 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50164) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbB8-0004Pk-C7 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:30 -0500 Received: from mail-wr1-x42e.google.com ([2a00:1450:4864:20::42e]:46154) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbB1-0001iP-Lp for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:30 -0500 Received: by mail-wr1-x42e.google.com with SMTP id t15so8181719wrx.13 for ; Mon, 15 Feb 2021 02:32:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1wqQuNSScfV3wYUHwareGGzMG2kJiGR91GYUzreZvQc=; b=S2vPhc/W8Bj086kHqYFUFE6pOvKHqXBAhdl0iuxV/+svZQEYnRAKMMiux5RnJZeJq4 Lmt1ufZ+n5fyBxA7/sN6SPf2qhLi90/09djJjGBjPpIQriNGBRSoTXMR4Deh3af+IWSV cFHlQipZ101EeZdwkhnGynXz+kX+JIV3VqyC5m1W7xDRK2Cr59XRjJ2HN4Qy5jd/3Odd d+U8Qb8eSNUTB8JQ438myy+4eZY3Pqd7/4JCG4Vs5ohXRvqx4VAlWye+g9r5ZY4uqsa8 G8OQY8bnYFNSxD6oDamRRHUmfHXKFkRv/CceGF5Mr/L+mgmXLyWExnaPo2aLMEwwW94N REfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1wqQuNSScfV3wYUHwareGGzMG2kJiGR91GYUzreZvQc=; b=g7vJdmNmkW1fFHrEeCklHINCzL66RJkQk4W0MVG91SSb5onDR8GUli5w2Co+72hNS0 VAWEHa+NpLwXXedt1d+UV3D5xv4CoKUtCSjIl44XAcoxyHG2+9H4Z/3xfVeBeP9rYqyQ DKUDqYYBcwvua/ia1TcpRoQEUajvJJLwdPnUYcA3vioerH0UI8HoRgMVgF7VvPU0Ytkc NNzh2Sa6xeQh7RyvMpKb1CvT625IEshK6Aziv0pggonYXb58BZMIX8VqeW06N/2bjxVC KN2zELpfmCCWcvvjpwXo1LEZu2/8+f/j7G6qKJlbsMXuoKMBGTSqkLJMpEDpGVqwnzZ/ tlfA== X-Gm-Message-State: AOAM532m0B7ClPGNwJ6i6DcIN6dDAhHgRu5pYfzUWaTcDS/mDOCB65w9 9ubYzkoVr3OaKq4mnB1UwU1U7w== X-Google-Smtp-Source: ABdhPJzCklrTgz9jh0sBt5HUFzb3Rv6hr6Wrrgt2DXTB/iwAj4dsKdwG0Y/2KtpYsdB5tRqEddn/5w== X-Received: by 2002:adf:ec8b:: with SMTP id z11mr15517254wrn.374.1613385141569; Mon, 15 Feb 2021 02:32:21 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:21 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 5/9] hw/display/omap_lcdc: Expand out macros in template header Date: Mon, 15 Feb 2021 10:32:11 +0000 Message-Id: <20210215103215.4944-6-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42e; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The omap_lcdc template header is already only included once, for DEPTH==32, but it still has all the macro-driven parameterization for other depths. Expand out all the macros in the header. Signed-off-by: Peter Maydell --- hw/display/omap_lcd_template.h | 67 ++++++++++++++-------------------- 1 file changed, 28 insertions(+), 39 deletions(-) diff --git a/hw/display/omap_lcd_template.h b/hw/display/omap_lcd_template.h index 1025ff3825d..c7c5025fb04 100644 --- a/hw/display/omap_lcd_template.h +++ b/hw/display/omap_lcd_template.h @@ -27,18 +27,11 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#if DEPTH == 32 -# define BPP 4 -# define PIXEL_TYPE uint32_t -#else -# error unsupport depth -#endif - /* * 2-bit colour */ -static void glue(draw_line2_, DEPTH)(void *opaque, - uint8_t *d, const uint8_t *s, int width, int deststep) +static void draw_line2_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) { uint16_t *pal = opaque; uint8_t v, r, g, b; @@ -48,26 +41,26 @@ static void glue(draw_line2_, DEPTH)(void *opaque, r = (pal[v & 3] >> 4) & 0xf0; g = pal[v & 3] & 0xf0; b = (pal[v & 3] << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); - d += BPP; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; v >>= 2; r = (pal[v & 3] >> 4) & 0xf0; g = pal[v & 3] & 0xf0; b = (pal[v & 3] << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); - d += BPP; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; v >>= 2; r = (pal[v & 3] >> 4) & 0xf0; g = pal[v & 3] & 0xf0; b = (pal[v & 3] << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); - d += BPP; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; v >>= 2; r = (pal[v & 3] >> 4) & 0xf0; g = pal[v & 3] & 0xf0; b = (pal[v & 3] << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); - d += BPP; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; s ++; width -= 4; } while (width > 0); @@ -76,8 +69,8 @@ static void glue(draw_line2_, DEPTH)(void *opaque, /* * 4-bit colour */ -static void glue(draw_line4_, DEPTH)(void *opaque, - uint8_t *d, const uint8_t *s, int width, int deststep) +static void draw_line4_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) { uint16_t *pal = opaque; uint8_t v, r, g, b; @@ -87,14 +80,14 @@ static void glue(draw_line4_, DEPTH)(void *opaque, r = (pal[v & 0xf] >> 4) & 0xf0; g = pal[v & 0xf] & 0xf0; b = (pal[v & 0xf] << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); - d += BPP; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; v >>= 4; r = (pal[v & 0xf] >> 4) & 0xf0; g = pal[v & 0xf] & 0xf0; b = (pal[v & 0xf] << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); - d += BPP; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; s ++; width -= 2; } while (width > 0); @@ -103,8 +96,8 @@ static void glue(draw_line4_, DEPTH)(void *opaque, /* * 8-bit colour */ -static void glue(draw_line8_, DEPTH)(void *opaque, - uint8_t *d, const uint8_t *s, int width, int deststep) +static void draw_line8_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) { uint16_t *pal = opaque; uint8_t v, r, g, b; @@ -114,17 +107,17 @@ static void glue(draw_line8_, DEPTH)(void *opaque, r = (pal[v] >> 4) & 0xf0; g = pal[v] & 0xf0; b = (pal[v] << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); s ++; - d += BPP; + d += 4; } while (-- width != 0); } /* * 12-bit colour */ -static void glue(draw_line12_, DEPTH)(void *opaque, - uint8_t *d, const uint8_t *s, int width, int deststep) +static void draw_line12_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) { uint16_t v; uint8_t r, g, b; @@ -134,17 +127,17 @@ static void glue(draw_line12_, DEPTH)(void *opaque, r = (v >> 4) & 0xf0; g = v & 0xf0; b = (v << 4) & 0xf0; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); s += 2; - d += BPP; + d += 4; } while (-- width != 0); } /* * 16-bit colour */ -static void glue(draw_line16_, DEPTH)(void *opaque, - uint8_t *d, const uint8_t *s, int width, int deststep) +static void draw_line16_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) { #if defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) memcpy(d, s, width * 2); @@ -157,13 +150,9 @@ static void glue(draw_line16_, DEPTH)(void *opaque, r = (v >> 8) & 0xf8; g = (v >> 3) & 0xfc; b = (v << 3) & 0xf8; - ((PIXEL_TYPE *) d)[0] = glue(rgb_to_pixel, DEPTH)(r, g, b); + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); s += 2; - d += BPP; + d += 4; } while (-- width != 0); #endif } - -#undef DEPTH -#undef BPP -#undef PIXEL_TYPE From patchwork Mon Feb 15 10:32:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440445 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=wzf5lP4M; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfLBT0Gcdz9sCD for ; Mon, 15 Feb 2021 21:36:49 +1100 (AEDT) Received: from localhost ([::1]:38346 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbFG-0000BY-RW for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:36:46 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50112) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbB7-0004Ml-4U for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:29 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:44788) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbB1-0001iT-LH for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:28 -0500 Received: by mail-wr1-x431.google.com with SMTP id g6so8208001wrs.11 for ; Mon, 15 Feb 2021 02:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=a/+Lp00ImdUdFCYzgiMMi+eXXtTKdO25fqdcbshDHFk=; b=wzf5lP4M2v8m9ufOOVGz9/4OfRXiTCbT/YdMpZzPmTEHLBbSeSPxU03oJVjPe9Icsf Q+fM+Ryg4bHNT4uFq36lNp8gBxljAyAIb1gAeT7Ty8QKCxJHrLq1RgiD4MQYJp32h9zt bG0cBz79TUDL2xyAawmsOjtjI0a1MRB3o1D7Oaw8lrOkMMOb5GMJ1Ibp8J2w4VCb9uNd XE7EIp74tstX+p+P1hlY0iqbh6WR5MwOMQlPZZWQFpC6u3DitZGeB/ZucKiJuaP85AaI ZiUsYhY+i/BsysJ04t6br3VLxMC2dsbbqwPN2d9wZaHVs0ZtVV8mOEptTZiOw6uPk1mI feHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=a/+Lp00ImdUdFCYzgiMMi+eXXtTKdO25fqdcbshDHFk=; b=jU4EEwoX64jwFcQ0sguSoJkfsfVI+hPsbZ1gq5eqoBVNHQDvcEtRqQRfBISpIwZv8h 9u5E7nsUfw/UQycDEgvrtwaMLzBf9vk41CY4ju3+rko63RmqBq9hkCnQAqSW+fdiKoCo 6z4gh03NFgzhpMr3rJ4paS+cR2VcwIgOqT9kh7q6pw/CXy00lbbLdF7XfwShYc3xr3gV 1lC6kisWq6T5pE3fVAM8SKTzROXVzIK5j35neIYQsVMZ7ghWsm57rts0+7XINtGtUK7k J+HAatfyg+cuUU+ZPBn7mM1ji7BL4H6BSKFMwXX1dvqLKEWjVf5l6JpcCtQlExLCnP9V AJzQ== X-Gm-Message-State: AOAM531w2i0VxL64FtJ3PYIHnDltVRYtCAvEB6QOSASQPHNd7IAAEVEF hm8UcHrTaL8yfXCCbWslkQVtlA== X-Google-Smtp-Source: ABdhPJzc2JJv4ycwTYjqCaojZ6kIw9W+5qlEeJ9IauCyoCuamCtSz7KSdeXJT1IugU839CRJ9V+5rg== X-Received: by 2002:a05:6000:152:: with SMTP id r18mr17790825wrx.226.1613385142286; Mon, 15 Feb 2021 02:32:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:21 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 6/9] hw/display/omap_lcdc: Drop broken bigendian ifdef Date: Mon, 15 Feb 2021 10:32:12 +0000 Message-Id: <20210215103215.4944-7-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The draw_line16_32() function in the omap_lcdc template header includes an ifdef for the case where HOST_WORDS_BIGENDIAN matches TARGET_WORDS_BIGENDIAN. This is trying to optimise for "source bitmap and destination bitmap format match", but it is broken, because in this function the formats don't match: the source is 16-bit colour and the destination is 32-bit colour, so a memcpy() will produce corrupted graphics output. Drop the bogus ifdef. This bug was introduced in commit ea644cf343129, when we dropped support for DEPTH values other than 32 from the template header. The old #if line was #if DEPTH == 16 && defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) and this was mistakenly changed to #if defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) rather than deleting the #if as now having an always-false condition. Fixes: ea644cf343129 Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/display/omap_lcd_template.h | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/display/omap_lcd_template.h b/hw/display/omap_lcd_template.h index c7c5025fb04..22e51d9bffb 100644 --- a/hw/display/omap_lcd_template.h +++ b/hw/display/omap_lcd_template.h @@ -139,9 +139,6 @@ static void draw_line12_32(void *opaque, uint8_t *d, const uint8_t *s, static void draw_line16_32(void *opaque, uint8_t *d, const uint8_t *s, int width, int deststep) { -#if defined(HOST_WORDS_BIGENDIAN) == defined(TARGET_WORDS_BIGENDIAN) - memcpy(d, s, width * 2); -#else uint16_t v; uint8_t r, g, b; @@ -154,5 +151,4 @@ static void draw_line16_32(void *opaque, uint8_t *d, const uint8_t *s, s += 2; d += 4; } while (-- width != 0); -#endif } From patchwork Mon Feb 15 10:32:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440450 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=Bzavho7h; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfLFm58p6z9rx6 for ; Mon, 15 Feb 2021 21:39:40 +1100 (AEDT) Received: from localhost ([::1]:48202 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbI2-0004W3-Kt for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:39:38 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50190) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbB9-0004RE-42 for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:31 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]:39393) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbB2-0001if-SI for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:30 -0500 Received: by mail-wr1-x42d.google.com with SMTP id v1so8243639wrd.6 for ; Mon, 15 Feb 2021 02:32:23 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=kTAUyENAZSmntGrsJs6kE2c/p5aLv9Krgur9nleNNPg=; b=Bzavho7h2B5sLcd9jZsmIHvxTsNEDzcTMs5HrOC4QSSqri9931kvmKQG2ci85jie8L /xeYtF6HfVqQo/YqtwDfgyTx+83bijFR9DpxAmzy8pQ1GJ0JLR42iPg4OEopgjkakCwy 43BECxpHJqww2kCCcqb6bSthJ+D6tYqivF++HKwSeUE/HULyJVSle/w2ZpurxZ9n3fbc zBOXLbiZMoVQL2F7C4KtMkDzWUh5HkjpdCov/GfH5MYdnBM+MyEV/wUwtLm7Gbk4p75p o7UeHQgjiwf5DuIy+4wBIoF7eeepDXTrokjnO1+MHL/MUKfzpHt1Ab7OWgbT4DZdG9jA wLcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=kTAUyENAZSmntGrsJs6kE2c/p5aLv9Krgur9nleNNPg=; b=qNNrAVhxeDOi0qoCNOlKoESQoTArfVjQaQO7J2/sMI8nzX50Rwmw1X5vmu05ciKNPX KhyPkcuqGDzLaxx2ubxepbarUGBoG/iBsdUsiQhZ0xPfXLDxEMfuiANshdcqARjfU7Nm JRK0oGedPCkhXfImynsot3UmcMWwahphAcCv7+Za79x5N6UuocCi77krTgqZvjcCefYw MSdmS3KIAg5/VFz5yiJVy8ZQtRUtmSrNs/xhwJc/cx5tihhWbPRJgr1VPPpffQzvdUUM We0151g5elQdhIZpuoa7nYUVJusfgC91yCa5nPBa4+2aNGleIFF3CGL6OpT+edgUibID D6rQ== X-Gm-Message-State: AOAM532CFoekN1LcLNG2FWfj3C2nTK1GvbPakJuco1hjtI5aAO4IznG9 kHTQLoJdGx6cWOUwF7JCisjfeY5KEQ+pTA== X-Google-Smtp-Source: ABdhPJyy6J7FkQnUICCFr/NvKINz36muZmcVguekD7oqaq49DGxAbmy+KPmblD+1Ds4sLbe6uHx24g== X-Received: by 2002:adf:ce91:: with SMTP id r17mr17791324wrn.219.1613385142954; Mon, 15 Feb 2021 02:32:22 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:22 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 7/9] hw/display/omap_lcdc: Fix coding style issues in template header Date: Mon, 15 Feb 2021 10:32:13 +0000 Message-Id: <20210215103215.4944-8-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Fix some minor coding style issues in the template header, so checkpatch doesn't complain when we move the code. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/display/omap_lcd_template.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/hw/display/omap_lcd_template.h b/hw/display/omap_lcd_template.h index 22e51d9bffb..a2f86eee3c8 100644 --- a/hw/display/omap_lcd_template.h +++ b/hw/display/omap_lcd_template.h @@ -61,7 +61,7 @@ static void draw_line2_32(void *opaque, uint8_t *d, const uint8_t *s, b = (pal[v & 3] << 4) & 0xf0; ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); d += 4; - s ++; + s++; width -= 4; } while (width > 0); } @@ -88,7 +88,7 @@ static void draw_line4_32(void *opaque, uint8_t *d, const uint8_t *s, b = (pal[v & 0xf] << 4) & 0xf0; ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); d += 4; - s ++; + s++; width -= 2; } while (width > 0); } @@ -108,7 +108,7 @@ static void draw_line8_32(void *opaque, uint8_t *d, const uint8_t *s, g = pal[v] & 0xf0; b = (pal[v] << 4) & 0xf0; ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - s ++; + s++; d += 4; } while (-- width != 0); } From patchwork Mon Feb 15 10:32:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440443 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=NIvl9vfy; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfL9K0nrXz9rx6 for ; Mon, 15 Feb 2021 21:35:49 +1100 (AEDT) Received: from localhost ([::1]:35286 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbEJ-0007IK-3G for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:35:47 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50224) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbBA-0004To-Gu for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:32 -0500 Received: from mail-wr1-x431.google.com ([2a00:1450:4864:20::431]:39397) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbB3-0001jC-0s for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:32 -0500 Received: by mail-wr1-x431.google.com with SMTP id v1so8243700wrd.6 for ; Mon, 15 Feb 2021 02:32:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Cx3fiU7zu1QDtVZpKIEUVyibRzjoCZZNp5x6BZT/qW4=; b=NIvl9vfy+TFDAsLhU36L74hmZHLJQas2gyRDUvqSyKVu9KDSJWYkLK2khMJovCmRHj cmMuzmO3SNIxlMaUVV8B2/Yt/k81vL0D/llLGk7V1NsgQMvQ1XVkJgKXmARCT5R+i5Rh lCHOj4xJKFMhHzMmwbuP/3Hi/cwaNISxXb7xIlR5WbmHxaX1F7t/tgVFmNDzWDVOhx2y NEac/8RGKMbhpe/eMQLEX2gh3W3phd5jn+VZ/AKJduNldrLR83015sA0h4fEeNQv8DEQ hW88La1ll7qnqwdLR08RObROGivkzYSLgd8UpEb4CsfKm7VwsXe5vGvhY87GVbyoi7Zm iD7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Cx3fiU7zu1QDtVZpKIEUVyibRzjoCZZNp5x6BZT/qW4=; b=jy+IzzjVjyMOkVYRHFMpc9QYiI5NR5P16EQTZdKlm32Byivz+E64bd9isqNeCJlJOo Zf4wC5W5UsGZaoE96YHDqBZHHDFm++ZxV6gDvfynb9lS+6UiZLUntTInVvgPxzWH7qzy SAyc8tMJz7D6VxhAbD+05AkZru/6IXfBafeWBja4z/M26+zoFBBbouiKT6O6x4ruDhap gtVz4rfjo0yVNZh7HOszYp2wwJ08u2H73yk23WMiOIiraJhY7Z9CEFamRNNXGT9JR5Ir O9g+9JTBjvdAlFYpuy1uOrW8Bg7mmLJf6Ss3uuV7jFDKKW2pc2Z8Me4EAYRXP6LtQVGG Lbjg== X-Gm-Message-State: AOAM533CogSeEq3iKhrUfz/FH8yZ3hLribIxIkN8+KNZMy8Z04uNy47O mVrpifezcP0RwEJEjA6wY/nWJg== X-Google-Smtp-Source: ABdhPJzVDRwlY3m+3wzrPvCD92pgcEfiK3cH47CjWzrOjr6GIET6x14VFxekjIVn5JcQ6HVA2FjCLQ== X-Received: by 2002:adf:d4d0:: with SMTP id w16mr17953789wrk.262.1613385143780; Mon, 15 Feb 2021 02:32:23 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:23 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 8/9] hw/display/omap_lcdc: Inline template header into C file Date: Mon, 15 Feb 2021 10:32:14 +0000 Message-Id: <20210215103215.4944-9-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::431; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x431.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We only include the template header once, so just inline it into the source file for the device. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/display/omap_lcd_template.h | 154 --------------------------------- hw/display/omap_lcdc.c | 127 ++++++++++++++++++++++++++- 2 files changed, 125 insertions(+), 156 deletions(-) delete mode 100644 hw/display/omap_lcd_template.h diff --git a/hw/display/omap_lcd_template.h b/hw/display/omap_lcd_template.h deleted file mode 100644 index a2f86eee3c8..00000000000 --- a/hw/display/omap_lcd_template.h +++ /dev/null @@ -1,154 +0,0 @@ -/* - * QEMU OMAP LCD Emulator templates - * - * Copyright (c) 2006 Andrzej Zaborowski - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in - * the documentation and/or other materials provided with the - * distribution. - * - * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A - * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR - * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY - * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * 2-bit colour - */ -static void draw_line2_32(void *opaque, uint8_t *d, const uint8_t *s, - int width, int deststep) -{ - uint16_t *pal = opaque; - uint8_t v, r, g, b; - - do { - v = ldub_p((void *) s); - r = (pal[v & 3] >> 4) & 0xf0; - g = pal[v & 3] & 0xf0; - b = (pal[v & 3] << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - d += 4; - v >>= 2; - r = (pal[v & 3] >> 4) & 0xf0; - g = pal[v & 3] & 0xf0; - b = (pal[v & 3] << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - d += 4; - v >>= 2; - r = (pal[v & 3] >> 4) & 0xf0; - g = pal[v & 3] & 0xf0; - b = (pal[v & 3] << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - d += 4; - v >>= 2; - r = (pal[v & 3] >> 4) & 0xf0; - g = pal[v & 3] & 0xf0; - b = (pal[v & 3] << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - d += 4; - s++; - width -= 4; - } while (width > 0); -} - -/* - * 4-bit colour - */ -static void draw_line4_32(void *opaque, uint8_t *d, const uint8_t *s, - int width, int deststep) -{ - uint16_t *pal = opaque; - uint8_t v, r, g, b; - - do { - v = ldub_p((void *) s); - r = (pal[v & 0xf] >> 4) & 0xf0; - g = pal[v & 0xf] & 0xf0; - b = (pal[v & 0xf] << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - d += 4; - v >>= 4; - r = (pal[v & 0xf] >> 4) & 0xf0; - g = pal[v & 0xf] & 0xf0; - b = (pal[v & 0xf] << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - d += 4; - s++; - width -= 2; - } while (width > 0); -} - -/* - * 8-bit colour - */ -static void draw_line8_32(void *opaque, uint8_t *d, const uint8_t *s, - int width, int deststep) -{ - uint16_t *pal = opaque; - uint8_t v, r, g, b; - - do { - v = ldub_p((void *) s); - r = (pal[v] >> 4) & 0xf0; - g = pal[v] & 0xf0; - b = (pal[v] << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - s++; - d += 4; - } while (-- width != 0); -} - -/* - * 12-bit colour - */ -static void draw_line12_32(void *opaque, uint8_t *d, const uint8_t *s, - int width, int deststep) -{ - uint16_t v; - uint8_t r, g, b; - - do { - v = lduw_le_p((void *) s); - r = (v >> 4) & 0xf0; - g = v & 0xf0; - b = (v << 4) & 0xf0; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - s += 2; - d += 4; - } while (-- width != 0); -} - -/* - * 16-bit colour - */ -static void draw_line16_32(void *opaque, uint8_t *d, const uint8_t *s, - int width, int deststep) -{ - uint16_t v; - uint8_t r, g, b; - - do { - v = lduw_le_p((void *) s); - r = (v >> 8) & 0xf8; - g = (v >> 3) & 0xfc; - b = (v << 3) & 0xf8; - ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); - s += 2; - d += 4; - } while (-- width != 0); -} diff --git a/hw/display/omap_lcdc.c b/hw/display/omap_lcdc.c index 58e659c94ff..2db04fad2fc 100644 --- a/hw/display/omap_lcdc.c +++ b/hw/display/omap_lcdc.c @@ -72,8 +72,131 @@ static void omap_lcd_interrupts(struct omap_lcd_panel_s *s) #define draw_line_func drawfn -#define DEPTH 32 -#include "omap_lcd_template.h" +/* + * 2-bit colour + */ +static void draw_line2_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) +{ + uint16_t *pal = opaque; + uint8_t v, r, g, b; + + do { + v = ldub_p((void *) s); + r = (pal[v & 3] >> 4) & 0xf0; + g = pal[v & 3] & 0xf0; + b = (pal[v & 3] << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; + v >>= 2; + r = (pal[v & 3] >> 4) & 0xf0; + g = pal[v & 3] & 0xf0; + b = (pal[v & 3] << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; + v >>= 2; + r = (pal[v & 3] >> 4) & 0xf0; + g = pal[v & 3] & 0xf0; + b = (pal[v & 3] << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; + v >>= 2; + r = (pal[v & 3] >> 4) & 0xf0; + g = pal[v & 3] & 0xf0; + b = (pal[v & 3] << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; + s++; + width -= 4; + } while (width > 0); +} + +/* + * 4-bit colour + */ +static void draw_line4_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) +{ + uint16_t *pal = opaque; + uint8_t v, r, g, b; + + do { + v = ldub_p((void *) s); + r = (pal[v & 0xf] >> 4) & 0xf0; + g = pal[v & 0xf] & 0xf0; + b = (pal[v & 0xf] << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; + v >>= 4; + r = (pal[v & 0xf] >> 4) & 0xf0; + g = pal[v & 0xf] & 0xf0; + b = (pal[v & 0xf] << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + d += 4; + s++; + width -= 2; + } while (width > 0); +} + +/* + * 8-bit colour + */ +static void draw_line8_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) +{ + uint16_t *pal = opaque; + uint8_t v, r, g, b; + + do { + v = ldub_p((void *) s); + r = (pal[v] >> 4) & 0xf0; + g = pal[v] & 0xf0; + b = (pal[v] << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + s++; + d += 4; + } while (-- width != 0); +} + +/* + * 12-bit colour + */ +static void draw_line12_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) +{ + uint16_t v; + uint8_t r, g, b; + + do { + v = lduw_le_p((void *) s); + r = (v >> 4) & 0xf0; + g = v & 0xf0; + b = (v << 4) & 0xf0; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + s += 2; + d += 4; + } while (-- width != 0); +} + +/* + * 16-bit colour + */ +static void draw_line16_32(void *opaque, uint8_t *d, const uint8_t *s, + int width, int deststep) +{ + uint16_t v; + uint8_t r, g, b; + + do { + v = lduw_le_p((void *) s); + r = (v >> 8) & 0xf8; + g = (v >> 3) & 0xfc; + b = (v << 3) & 0xf8; + ((uint32_t *) d)[0] = rgb_to_pixel32(r, g, b); + s += 2; + d += 4; + } while (-- width != 0); +} static void omap_update_display(void *opaque) { From patchwork Mon Feb 15 10:32:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 1440451 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org (client-ip=209.51.188.17; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.a=rsa-sha256 header.s=google header.b=OwZWmmH+; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4DfLJ75ZgKz9rx6 for ; Mon, 15 Feb 2021 21:41:43 +1100 (AEDT) Received: from localhost ([::1]:56166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lBbK1-0007pG-QQ for incoming@patchwork.ozlabs.org; Mon, 15 Feb 2021 05:41:41 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:50236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lBbBA-0004Uj-Rr for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:35 -0500 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]:34791) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lBbB3-0001je-LC for qemu-devel@nongnu.org; Mon, 15 Feb 2021 05:32:32 -0500 Received: by mail-wr1-x432.google.com with SMTP id n4so5265049wrx.1 for ; Mon, 15 Feb 2021 02:32:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=LvF8P5E15O40+Gw1s78SulbtIHDLH/Ds9X/sriTHyPY=; b=OwZWmmH+67QuViAPfJoNecTjOjmDLkz2Pz7l3FwpD5dmEKYEl+NKDrHufot9y+vBpu 95FruJvL+vrVVPA6CvnN8c4B4BgB+cGyhEA5DHCrLlSMYssxnRrENtFox96ljyLfxfvO rWXXB70AXb04VD9SqVUnf86bKQF28CkQHbQC97bee5XMa50LhRTY90F5aQ14DJycs8Nm ksAcrzxK1Ijls0fHOIVHDDzJggx3LUFwYOIma1IZKkF6ypY6cT8ITg+S2u54hC9o4eBA +UoNvIejGmMFsXcK+gK6eiri2Aw1KNl/u4V27oXXsV/mrVU+CdonvvBj1+pW+YjsTSuH u0cg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=LvF8P5E15O40+Gw1s78SulbtIHDLH/Ds9X/sriTHyPY=; b=DZ4En4X0X5hAri9Bt8aDgdk2u2kzcWBBOYY1+HPOpf2IRO7T63bT8icQT7uHRDrhad Sf8489zMZBdg8Qty5Y2vb1vf/ZHWHfLDHh/ZGjHxotLvhTJPF96BQUq/Ix5+ks87EkPV EoMQsxUovAzrixGHkwweSWLVaxUbHGZmBCu/2cNDni9ys+wWnjBppo/V5fiQhpVNgBQ0 gnsRNKBImVdMewtCRYv05+gFeYZU411o/xAYzI2wt2RSjNNCQcVD5Gwj73eOCSW75Dbx 5QDBYR2QadFals0/rp97vZflcjXtKHMCcVNRF4bVtmLS+oRKLAvkqcjzriiLf7kP+w6S 4w1g== X-Gm-Message-State: AOAM530qEVz1l43VmedqFSx46g7Xln0tLoWMP98gDH4tggdaKNAwPSD2 XTxuJqizwAgoKP/njEWnUgJkWg== X-Google-Smtp-Source: ABdhPJx2jj51v4FTTjpIMfY+6TUpp2EhnqjPfgOEWJLrgm+o5M0Chn+JgtmZii0Y4Jm4aLaOFMit1Q== X-Received: by 2002:adf:b611:: with SMTP id f17mr17787056wre.8.1613385144453; Mon, 15 Feb 2021 02:32:24 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 36sm25196300wrj.97.2021.02.15.02.32.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Feb 2021 02:32:24 -0800 (PST) From: Peter Maydell To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH 9/9] hw/display/omap_lcdc: Delete unnecessary macro Date: Mon, 15 Feb 2021 10:32:15 +0000 Message-Id: <20210215103215.4944-10-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20210215103215.4944-1-peter.maydell@linaro.org> References: <20210215103215.4944-1-peter.maydell@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=peter.maydell@linaro.org; helo=mail-wr1-x432.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Gerd Hoffmann Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The macro draw_line_func is used only once; just expand it. Signed-off-by: Peter Maydell Reviewed-by: Philippe Mathieu-Daudé --- hw/display/omap_lcdc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/hw/display/omap_lcdc.c b/hw/display/omap_lcdc.c index 2db04fad2fc..0ba42ef637c 100644 --- a/hw/display/omap_lcdc.c +++ b/hw/display/omap_lcdc.c @@ -70,8 +70,6 @@ static void omap_lcd_interrupts(struct omap_lcd_panel_s *s) qemu_irq_lower(s->irq); } -#define draw_line_func drawfn - /* * 2-bit colour */ @@ -202,7 +200,7 @@ static void omap_update_display(void *opaque) { struct omap_lcd_panel_s *omap_lcd = (struct omap_lcd_panel_s *) opaque; DisplaySurface *surface; - draw_line_func draw_line; + drawfn draw_line; int size, height, first, last; int width, linesize, step, bpp, frame_offset; hwaddr frame_base;