From patchwork Mon May 25 01:48:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297041 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=eNhHWtp0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg501D5Dz9sPF for ; Mon, 25 May 2020 11:49:40 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 2409480679; Mon, 25 May 2020 03:49:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="eNhHWtp0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 36EF88105B; Mon, 25 May 2020 03:49:14 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BFAF0801D8 for ; Mon, 25 May 2020 03:49:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id m6so16048917ilq.7 for ; Sun, 24 May 2020 18:49:10 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Uto5eavoD/5vi8QFt4fXkoJMAXkRGSlg2QDOZ3NQa0E=; b=eNhHWtp0j9QhxepWAmwl7VNpYzHtLSHxs/ys4BWjpvG/XJgcr7O2RfaLiDdROVym1F cI+5FleX5726wk96mG8b3C1ZeO7jgeiIwH6uW5zO4/uyU9XsSU7NSBJRTdx4gM61Pnas ta1hAMivxNbYBO/VT42S3Nd+X+jwcBoeyLZro= 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=Uto5eavoD/5vi8QFt4fXkoJMAXkRGSlg2QDOZ3NQa0E=; b=YfKvZbaUWrDjTQ2kL5EODfbNTJkbM/VEi6u1dnZH8Am0OoYxh9NA2VoDWcbBqtgEl0 mDeWKz0R4UF8X2gpgwdAfAtIO/KSa1yc4nrSS3yA44ueIK8hyBh1SvDCINyopxZ7H0ZR S6ZpFfFobVFueJJINPH4hliKRSpUg6mJiFwKzTCuBgbsJu6nd9bmAmUn2XIk91Ntvevo scbN3Vup6VdwGUo2c7LMQxANyV6nYs8jOX3Tts6/F41kWocw0Wk7lc7M5O7CfL0Bw3MN bU9+p47PliHiE1jbqBte0CNG8itTRv2kwAX2libZeziyJhQquBbCy1rH3UjaUiNyV+rV sasQ== X-Gm-Message-State: AOAM530Ig6vZIzIU6FXasCLWze49zhbvtyXZU3V+A4O+UJz52drk0kAN ZJMZrXAAB8+i9HZsu9s5uHJvxAsoAyqLRw== X-Google-Smtp-Source: ABdhPJx1hIzp8ebmSVQKDO806lCle/bc6nCy1yzL4yzdHXdX0DNjBmsQfsygl6MER20eJGfSgeVFAA== X-Received: by 2002:a92:d2ca:: with SMTP id w10mr23312958ilg.141.1590371349165; Sun, 24 May 2020 18:49:09 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:08 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v2 01/26] x86: fsp: Reinit the FPU after FSP meminit Date: Sun, 24 May 2020 19:48:38 -0600 Message-Id: <20200525014904.115621-2-sjg@chromium.org> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The APL FSP appears to leave the FPU in a bad state in that it has registers in use. This causes an error when the next FPU operation is performed. Work around this by re-resetting the FPU after calling FSP-M. This allows the freetype console to work correctly. Signed-off-by: Simon Glass --- Changes in v2: None arch/x86/cpu/i386/cpu.c | 5 +++++ arch/x86/include/asm/u-boot-x86.h | 8 ++++++++ arch/x86/lib/fsp2/fsp_meminit.c | 1 + 3 files changed, 14 insertions(+) diff --git a/arch/x86/cpu/i386/cpu.c b/arch/x86/cpu/i386/cpu.c index 435e50edad..d27324cb4e 100644 --- a/arch/x86/cpu/i386/cpu.c +++ b/arch/x86/cpu/i386/cpu.c @@ -363,6 +363,11 @@ static void setup_cpu_features(void) : : "i" (em_rst), "i" (mp_ne_set) : "eax"); } +void cpu_reinit_fpu(void) +{ + asm ("fninit\n"); +} + static void setup_identity(void) { /* identify CPU via cpuid and store the decoded info into gd->arch */ diff --git a/arch/x86/include/asm/u-boot-x86.h b/arch/x86/include/asm/u-boot-x86.h index 3e5d56d075..bd3f44014c 100644 --- a/arch/x86/include/asm/u-boot-x86.h +++ b/arch/x86/include/asm/u-boot-x86.h @@ -43,6 +43,14 @@ int x86_cpu_reinit_f(void); */ int x86_cpu_init_tpl(void); +/** + * cpu_reinit_fpu() - Reinit the FPU if something is wrong with it + * + * The FSP-M code can leave registers in use in the FPU. This functions reinits + * it so that the FPU can be used safely + */ +void cpu_reinit_fpu(void); + int cpu_init_f(void); void setup_gdt(struct global_data *id, u64 *gdt_addr); /* diff --git a/arch/x86/lib/fsp2/fsp_meminit.c b/arch/x86/lib/fsp2/fsp_meminit.c index 1a758147b0..faf9c29aef 100644 --- a/arch/x86/lib/fsp2/fsp_meminit.c +++ b/arch/x86/lib/fsp2/fsp_meminit.c @@ -85,6 +85,7 @@ int fsp_memory_init(bool s3wake, bool use_spi_flash) func = (fsp_memory_init_func)(hdr->img_base + hdr->fsp_mem_init); ret = func(&upd, &hob); bootstage_accum(BOOTSTAGE_ID_ACCUM_FSP_M); + cpu_reinit_fpu(); if (ret) return log_msg_ret("SDRAM init fail\n", ret); From patchwork Mon May 25 01:48:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297042 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=YLMZTsDy; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg5C5FB8z9sPF for ; Mon, 25 May 2020 11:49:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C440801D8; Mon, 25 May 2020 03:49:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="YLMZTsDy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id AFFF1813A5; Mon, 25 May 2020 03:49:17 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 6338D80675 for ; Mon, 25 May 2020 03:49:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd42.google.com with SMTP id u23so4149720iot.12 for ; Sun, 24 May 2020 18:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=68VjjQHn5Z5V0xJ743IU7kYmSlzbJFwMpkRbA7b71bU=; b=YLMZTsDyLn1hOoXl21cs09z+IW3TiFZ8KKNTnlfPgmrYtmg4cRN5tCwAuQscQ1o6wy +Z131nQOE6hbjgM+JFtNVIvy4eRHKf3fhVKinhH5UIZa5ZAUNqWYYmvhSAVOD0qU6SkN Keg+SovkGvWwdiqmg+RBrIPzH9p6za+Sw/4ic= 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=68VjjQHn5Z5V0xJ743IU7kYmSlzbJFwMpkRbA7b71bU=; b=NlTmwObWjDMVJZav+/G3JKK93jRyycnP6lbbb75sNYnsurgfx47+EKZMQyrJBdoCZa dOtFEXiBld94JZpIomVj9LjOO9lso9dUbm+djfnARtg8LzBxpv2UhAuRJMeiUP0OJhHf OCX/QOUmFRP/wPM5KQvmfjLz3M3JWdT11tmduJAN1RjHLiQvTb/rVxfF0/PpG/Wak57v VfjTdIc6iXIW6v8SFlWiYlmbLiwAoOjIRbrCAzk5o2S4plu7UDtJptgGy5HlWKDCMIIY 11xjn0rDqiaPW7tj1zWtXacyUG+Z6V8b2Q2jF5o+xslcxPXzvl+2vFGKphDBUXNFxj5r kvMA== X-Gm-Message-State: AOAM531sVef9DF+oBnIK+V7JYjrqVuBBF2bbDBpWfSAMN7v9WKo0ABpy BrYFbkf0YZx1cJfLt+j2KJAmI4RJa1HLeg== X-Google-Smtp-Source: ABdhPJySPGtJwmI3n6Jb2BDLo4LKodbBiD61FlTu6t1EThyQhQiefHJTV3c6quB+Iw1pb8FqXeogLA== X-Received: by 2002:a05:6638:f11:: with SMTP id h17mr29918jas.79.1590371349926; Sun, 24 May 2020 18:49:09 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:09 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v2 02/26] console: Add a way to output to serial only Date: Sun, 24 May 2020 19:48:39 -0600 Message-Id: <20200525014904.115621-3-sjg@chromium.org> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean In the video drivers it is useful to print errors while debugging but doing so risks an infinite loop as the debugging info itself may go through the video drivers. Add a new console function that prints information only to the serial device, thus making it safe for use in debugging. Signed-off-by: Simon Glass --- Changes in v2: None common/console.c | 28 ++++++++++++++++++++++------ include/console.h | 13 +++++++++++++ 2 files changed, 35 insertions(+), 6 deletions(-) diff --git a/common/console.c b/common/console.c index 1deca3cb78..31f46470d2 100644 --- a/common/console.c +++ b/common/console.c @@ -229,18 +229,34 @@ static void console_putc(int file, const char c) } } -static void console_puts_noserial(int file, const char *s) +/** + * console_puts_select() - Output a string to all console devices + * + * @file: File number to output to (e,g, stdout, see stdio.h) + * @serial_only: true to output only to serial, false to output to everything + * else + * @s: String to output + */ +static void console_puts_select(int file, bool serial_only, const char *s) { int i; struct stdio_dev *dev; for (i = 0; i < cd_count[file]; i++) { + bool is_serial; + dev = console_devices[file][i]; - if (dev->puts != NULL && !console_dev_is_serial(dev)) + is_serial = console_dev_is_serial(dev); + if (dev->puts && serial_only == is_serial) dev->puts(dev, s); } } +void console_puts_select_stderr(bool serial_only, const char *s) +{ + console_puts_select(stderr, serial_only, s); +} + static void console_puts(int file, const char *s) { int i; @@ -275,9 +291,9 @@ static inline void console_putc(int file, const char c) stdio_devices[file]->putc(stdio_devices[file], c); } -static inline void console_puts_noserial(int file, const char *s) +void console_puts_select(int file, bool serial_only, const char *s) { - if (!console_dev_is_serial(stdio_devices[file])) + if (serial_only == console_dev_is_serial(stdio_devices[file])) stdio_devices[file]->puts(stdio_devices[file], s); } @@ -489,7 +505,7 @@ static void print_pre_console_buffer(int flushpoint) puts(buf_out); break; case PRE_CONSOLE_FLUSHPOINT2_EVERYTHING_BUT_SERIAL: - console_puts_noserial(stdout, buf_out); + console_puts_select(stdout, false, buf_out); break; } } @@ -776,7 +792,7 @@ int console_announce_r(void) display_options_get_banner(false, buf, sizeof(buf)); - console_puts_noserial(stdout, buf); + console_puts_select(stdout, false, buf); #endif return 0; diff --git a/include/console.h b/include/console.h index 74afe22b7e..4c6b8f2614 100644 --- a/include/console.h +++ b/include/console.h @@ -7,6 +7,8 @@ #ifndef __CONSOLE_H #define __CONSOLE_H +#include + extern char console_buffer[]; /* common/console.c */ @@ -72,6 +74,17 @@ int console_record_avail(void); */ int console_announce_r(void); +/** + * console_puts_select_stderr() - Output a string to selected console devices + * + * This writes to stderr only. It is useful for outputting errors + * + * @serial_only: true to output only to serial, false to output to everything + * else + * @s: String to output + */ +void console_puts_select_stderr(bool serial_only, const char *s); + /* * CONSOLE multiplexing. */ From patchwork Mon May 25 01:48:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297043 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Lj2Yesi3; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg5Q4F4Rz9sPF for ; Mon, 25 May 2020 11:50:02 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0EDE8812E7; Mon, 25 May 2020 03:49:47 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Lj2Yesi3"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 1299C812FE; Mon, 25 May 2020 03:49:21 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E8DD580679 for ; Mon, 25 May 2020 03:49:11 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id 17so16085986ilj.3 for ; Sun, 24 May 2020 18:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7V8gl3ucDvGwg4qRKqpPI0OOlQw85TygLUaH5HqujXk=; b=Lj2Yesi3V6jkVLxa4ihXPGrAWAyINWvhACaOjd+YIyfSzDHixLSuIx0+VMSa/tWKuO jaD340MWS+rsYNF/627fsdrPUyi3ydg7mM1UzDSwwi9qG5BogTgBoyRA0m7A6TsFXDkn kcRWn84wMNECqWZpGdQNiqMUFb57E39/YtXxw= 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=7V8gl3ucDvGwg4qRKqpPI0OOlQw85TygLUaH5HqujXk=; b=HYw/xQ8HVKIYOCyhwY0qn3AaQ3J8wJl70Hh8mmo0SxD98Scxx0Z/XzuNOMmQb/N3Ox lazdkWSnCo6HhryOJ841Vg1dmCGUdaTL9CjKt8s7yTNr+2B5T+rmxDOL3CVtrAJFHM8M aTPjzd/66zsG54Vfzv/aCeqPZ8KzPrkig3ZBnpP0hJiXmqkrzHzKA3+N7GRd//xSDYBv G082AllfIXXaVw0xZIkptMEKUMuFF6zpVHQxAYyoF0Fc6QLa5rhebw3yUhRoaz7DaJNe QjOCxyNnP+61RwjCnoLg4TbT31Pn90AOD4OZ3L5kJEYENAT6+DIoM7BGqakzSZPBvyX5 RcWw== X-Gm-Message-State: AOAM531rq06Y/l2HKDGjSymsothbtRAp51AFxmJee+EPMvawO5yWAQSQ 1FJYGlQxHAztvJBYXNXoBoBJ5bBkDCiZdQ== X-Google-Smtp-Source: ABdhPJwO46KpoEMuAC+VVKidn0i2RCw3T258GM48o1wCOqGnzoMXFeFT/hWZMQUYdjRTLGIOn91KbQ== X-Received: by 2002:a92:c948:: with SMTP id i8mr23188344ilq.258.1590371350626; Sun, 24 May 2020 18:49:10 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:10 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 03/26] video: Show an error when a vidconsole function fails Date: Sun, 24 May 2020 19:48:40 -0600 Message-Id: <20200524194852.v2.3.I8c38c21ef51885e25a6245fb7e4f6ac5567d9937@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean At present these functions fail silently even when debugging, which is not very helpful. Add a way to print a message to the serial output when an error is detected. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/vidconsole-uclass.c | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index d30e6db6f6..e06912cf36 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -9,12 +9,13 @@ #include #include +#include #include -#include #include #include #include #include /* Bitmap font for code page 437 */ +#include /* * Structure to describe a console color @@ -556,16 +557,31 @@ int vidconsole_put_string(struct udevice *dev, const char *str) static void vidconsole_putc(struct stdio_dev *sdev, const char ch) { struct udevice *dev = sdev->priv; + int ret; - vidconsole_put_char(dev, ch); + ret = vidconsole_put_char(dev, ch); + if (ret) { +#ifdef DEBUG + console_puts_select_stderr(true, "[vc err: putc]"); +#endif + } video_sync(dev->parent, false); } static void vidconsole_puts(struct stdio_dev *sdev, const char *s) { struct udevice *dev = sdev->priv; + int ret; + + ret = vidconsole_put_string(dev, s); + if (ret) { +#ifdef DEBUG + char str[30]; - vidconsole_put_string(dev, s); + snprintf(str, sizeof(str), "[vc err: puts %d]", ret); + console_puts_select_stderr(true, str); +#endif + } video_sync(dev->parent, false); } From patchwork Mon May 25 01:48:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297044 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=DVoX7EnP; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg5h4pMLz9sPF for ; Mon, 25 May 2020 11:50:16 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AA954812FE; Mon, 25 May 2020 03:49:48 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="DVoX7EnP"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3E6F9813C5; Mon, 25 May 2020 03:49:19 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8CB5D808A1 for ; Mon, 25 May 2020 03:49:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id 18so16097982iln.9 for ; Sun, 24 May 2020 18:49:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uFJN0GHU7ryaVyeSnKrPx4Z/iXBqyKOpp7qrQaWp41g=; b=DVoX7EnPID/256F5XIHgs+TeNmfkcdwV6RurwMU0dSUbyadfzimJ+gUsIvhCy6P6P4 7I3k5SXGZOSbNFVLN0iWwv60EqazLtX5m8fnx2oaotYdGpU9R127hjBqspqq8m1SmzLM e4D0m/gueQiqr31Tt0pc1dRAaMdCH2xQYSKM0= 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=uFJN0GHU7ryaVyeSnKrPx4Z/iXBqyKOpp7qrQaWp41g=; b=eiEaiv1z+Nj8LlSgJJj+NwqQqf5JLQ9pNB1OHSadXhB3toXltQg9+TaC/M9DTPetQW +jCxz0PP1gVTYgMYFftDK8DIGi8udWnDMoyi+W09S+po9txgXOVIg4snsyMyaCeKjkI5 4bgr6U/fJqUKZsicJNGN0Fyl8X8OmoEv/CT42XWW4mRDGQOwZiyVOToSRU72yMweZl2I 716SKvYxjAT6t3kIdfmh/6FlFYMEH3rNm7dJkSOikBPJcbnSzTF4NZCWqDPEww1NfdfP hJT7r7SJliHoDCvAN3O8JKDcX3Ih6wMqr0Dil602qi7yb4rzpAcTYgn4eo6GYlNKOep6 vQ/g== X-Gm-Message-State: AOAM5337YOfR1yFFm1mpzNEmB85T0oRLZryXXq6f6DFSroGtMF9fIgrd QyHECDSRVnkbQYBrJ2IDdWwVvdX0UXFiqA== X-Google-Smtp-Source: ABdhPJw0nIdwAxJZgPCtHwX4zmzNz9a3Xz9AV9DX0Gg/BkgCeoNg3LfmXPAOW1MD4QCdpcpupCsFYg== X-Received: by 2002:a05:6e02:503:: with SMTP id d3mr23010536ils.208.1590371351372; Sun, 24 May 2020 18:49:11 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 04/26] sandbox: video: Allow selection of rotated console Date: Sun, 24 May 2020 19:48:41 -0600 Message-Id: <20200524194852.v2.4.Ic64153abc8c8e22f5b5348fe2002fa2b17239852@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Add a devicetree property to select a rotated console. This uses the same encoding as vidconsole itself: 0=normal; 1=90 degrees clockwise, 2=upside down, 3=90 degrees anticlockwise. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/sandbox_sdl.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index 20248e6607..c678e728db 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -53,6 +53,7 @@ static int sandbox_sdl_bind(struct udevice *dev) plat->xres = dev_read_u32_default(dev, "xres", LCD_MAX_WIDTH); plat->yres = dev_read_u32_default(dev, "yres", LCD_MAX_HEIGHT); plat->bpix = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16); + plat->rot = dev_read_u32_default(dev, "rotate", 0); uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8; debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); From patchwork Mon May 25 01:48:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297046 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=lUtbJIa2; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg6F6KfTz9sPF for ; Mon, 25 May 2020 11:50:45 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8D8F08158A; Mon, 25 May 2020 03:49:54 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="lUtbJIa2"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 24F13814E1; Mon, 25 May 2020 03:49:22 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 5F1E6811F9 for ; Mon, 25 May 2020 03:49:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd43.google.com with SMTP id f3so17293617ioj.1 for ; Sun, 24 May 2020 18:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=oZfh5E5kRVlqyOwVTudYOaoGyUQj4xnDo/OEgiJAza4=; b=lUtbJIa2LBXLAM1xwjRmDNUxr7u7ORRGv4HncV7CyT6LROxMjf8fG7D7j2jCDoZ7ud HDmynXiO2/5QO58NZhU7l6iaSO6qIkAwavvzHMuNatD19hTCZ9zAoPx6RtXHefl3LDcp QzSvmACa1lUEjOj5mfv+xHcliDokA9sucLfCU= 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=oZfh5E5kRVlqyOwVTudYOaoGyUQj4xnDo/OEgiJAza4=; b=WfbMlzb8K43fRXDZpjB4QgSu1vRv+tZ0ji3B1EeQ2zTT0ED+NwPWTNrCE5SCjBou/t 3jIf4UHa6Fde2ET9qXPrCrCqB2Vp18upF1QzcAgyRK3DvvfxJ2hNez+0QzOmGVmv3By0 F1PXKv2MXml7I2XaYlQyWXPIyA6os6iPy/tAcd8oRQHodnEieYZ9WHR1Lhda3i8FRcqk FvX4WvEmZ1zxjF5o+1lOvFvkSrIpmjjH8/bfhQ9gz9h6FxhfDc/mN5iDrZNLq3qjg8kv +S9ciGtFbtTmIfv/Beqk5jbjtaPMfZHp0x6+mJbqhU7cb6HYDaknl/eP3Bo48ai/V1Uw 7mwg== X-Gm-Message-State: AOAM533musej0bdU+pH9cY1I6YGlgA8G7KnYW2KpbJBk8jWhmR1F2Z5Y 7SYhnisxiFch1XZoHm+YU3DXRbQl0kKM2g== X-Google-Smtp-Source: ABdhPJyDr7BAwM6XJghU0Z5EVqu8ZAvmzmDsSBfQzflM6gC1MV/GedArk5G61DnoSCnFlUgF5f34Cg== X-Received: by 2002:a02:8529:: with SMTP id g38mr6377792jai.143.1590371352079; Sun, 24 May 2020 18:49:12 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:11 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 05/26] video: Split out expression parts into variables Date: Sun, 24 May 2020 19:48:42 -0600 Message-Id: <20200524194852.v2.5.If9aaebbcc4389b38b66478fc3dd0aaff49c3105e@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean The functions in this file do similar things but not always in the same way. To make the code easier to read and compare, use a separate 'linenum' variable in every function. This is then multiplied by the line length to get the offset within the frame buffer to modify. Also use an 'x' variable to hold the pixel position within that line. This is multipled by the pixel size and added to the offset. Also move the pbytes declaration up a little with the other long lines. A side effect of splitting out these variables is that they are promoted to int, i.e. a signed type, from the unsigned short used in the vidconsole_priv struct. This would be necessary should any of the variables go negative. At present this can actually happen in console_putc_xy_2(), if the display width is not a multiple of the character size (see next patch). Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/console_rotate.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c index b485255598..8bb05ae02c 100644 --- a/drivers/video/console_rotate.c +++ b/drivers/video/console_rotate.c @@ -59,9 +59,9 @@ static int console_move_rows_1(struct udevice *dev, uint rowdst, uint rowsrc, uint count) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); + int pbytes = VNBYTES(vid_priv->bpix); void *dst; void *src; - int pbytes = VNBYTES(vid_priv->bpix); int j; dst = vid_priv->fb + vid_priv->line_length - @@ -83,14 +83,15 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; struct video_priv *vid_priv = dev_get_uclass_priv(vid); + uchar *pfont = video_fontdata + (u8)ch * VIDEO_FONT_HEIGHT; int pbytes = VNBYTES(vid_priv->bpix); - int i, col; + int i, col, x, linenum; int mask = 0x80; void *line; - uchar *pfont = video_fontdata + (u8)ch * VIDEO_FONT_HEIGHT; - line = vid_priv->fb + (VID_TO_PIXEL(x_frac) + 1) * - vid_priv->line_length - (y + 1) * pbytes; + linenum = VID_TO_PIXEL(x_frac) + 1; + x = y + 1; + line = vid_priv->fb + linenum * vid_priv->line_length - x * pbytes; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; @@ -204,16 +205,15 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; struct video_priv *vid_priv = dev_get_uclass_priv(vid); - int i, row; + int pbytes = VNBYTES(vid_priv->bpix); + int i, row, x, linenum; void *line; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; - - line = vid_priv->fb + (vid_priv->ysize - y - 1) * - vid_priv->line_length + - (vid_priv->xsize - VID_TO_PIXEL(x_frac) - - VIDEO_FONT_WIDTH - 1) * VNBYTES(vid_priv->bpix); + linenum = vid_priv->ysize - y - 1; + x = vid_priv->xsize - VID_TO_PIXEL(x_frac) - VIDEO_FONT_WIDTH - 1; + line = vid_priv->fb + linenum * vid_priv->line_length + x * pbytes; for (row = 0; row < VIDEO_FONT_HEIGHT; row++) { unsigned int idx = (u8)ch * VIDEO_FONT_HEIGHT + row; @@ -312,9 +312,9 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc, uint count) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); + int pbytes = VNBYTES(vid_priv->bpix); void *dst; void *src; - int pbytes = VNBYTES(vid_priv->bpix); int j; dst = vid_priv->fb + rowdst * VIDEO_FONT_HEIGHT * pbytes; @@ -334,16 +334,16 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) struct vidconsole_priv *vc_priv = dev_get_uclass_priv(dev); struct udevice *vid = dev->parent; struct video_priv *vid_priv = dev_get_uclass_priv(vid); + uchar *pfont = video_fontdata + (u8)ch * VIDEO_FONT_HEIGHT; int pbytes = VNBYTES(vid_priv->bpix); - int i, col; + int i, col, x; int mask = 0x80; - void *line = vid_priv->fb + - (vid_priv->ysize - VID_TO_PIXEL(x_frac) - 1) * - vid_priv->line_length + y * pbytes; - uchar *pfont = video_fontdata + (u8)ch * VIDEO_FONT_HEIGHT; + void *line; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; + x = vid_priv->ysize - VID_TO_PIXEL(x_frac) - 1; + line = vid_priv->fb + x * vid_priv->line_length + y * pbytes; for (col = 0; col < VIDEO_FONT_HEIGHT; col++) { switch (vid_priv->bpix) { From patchwork Mon May 25 01:48:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297045 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=fzXQt0fu; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg5y6qxgz9sPF for ; Mon, 25 May 2020 11:50:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0A739813C9; Mon, 25 May 2020 03:49:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="fzXQt0fu"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 9AE0E812EE; Mon, 25 May 2020 03:49:20 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x141.google.com (mail-il1-x141.google.com [IPv6:2607:f8b0:4864:20::141]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 0E163810E0 for ; Mon, 25 May 2020 03:49:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x141.google.com with SMTP id 17so16086033ilj.3 for ; Sun, 24 May 2020 18:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=fyurLEk/rHqIYzKKrm+jZZVH6CQ1EkRTYHWpniDHqYs=; b=fzXQt0fuImKEGZwBI9gz9OqwjdMWmHN4t5SmOz0Im0pD0voI3KrgpZ9ruaotKpY3rd s0g8OLYiUWldpwF8IJxEP7FKhFvW/iXXVnQ6iuS9t8GpAP2lzrVOdw/OSmWFiTP17C7o yZCfvbl9nR7kHFNzb9cdam1KhcfN0AXOX9rFc= 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=fyurLEk/rHqIYzKKrm+jZZVH6CQ1EkRTYHWpniDHqYs=; b=qiolCLo0wcNF4nnmX85/kjrSNHE58nauDR6TuqulrmX+iicK+OHLlJVUYXOoDmLmP8 AMJR7MAgUU83Be3i8wleRFton+xCYxhZMciPNCdLTDBzY0PMd/w7gQYGb21wi3ou+1hN giVCBuCOz1q+KKe3UuqOT2iJuQPdqaobFyxQISZYSIwbWXqXThZHwS++2YG9uCsan0QI x+a/cjoSQ8wwVsaCpARtWZJilsJLDmu/ppF5fSq23Dhm8UtNo7lRREFSsF1y6mj3q8zg y3mWGp+yvhwswLrya48zqvML+ck5gPNlGtGsWPO3LosH4tmyGy2m0G79hLttwmUQN6BM QGcg== X-Gm-Message-State: AOAM530wlP/TYGFdNweQdqik+6hZg/dql0DMNwQ/mWK0BtCWbOqAk6Ho qANnrEFhznb6p8ZaZojaHHYKQHFXmXXW+Q== X-Google-Smtp-Source: ABdhPJyA8XSz5S+yRQMeUVvSl3sRVzQquTm5cX4tkevNsLr3q5dbmTNaCnDcwEJY8IkgqOVZ3b1eNQ== X-Received: by 2002:a92:3a81:: with SMTP id i1mr23104866ilf.234.1590371352851; Sun, 24 May 2020 18:49:12 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:12 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 06/26] video: Adjust rotated console to start at right edge Date: Sun, 24 May 2020 19:48:43 -0600 Message-Id: <20200524194852.v2.6.Ie8637472573bd3e94375131aa034e7498df340b1@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean At present when the console is rotated 180 degrees it starts almost a whole character to the left of the right edge (typically 7 pixels with an 8-pixel-wide font). On a display which aligns with the font width, this just wastes space. On a display that does not this can result in x_frac going negative for the final character (the one on the left side) and the overflow -EAGAIN check at the start of the function failing. Change the function to start at the rightmost pixel to fix these problems. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/console_rotate.c | 2 +- test/dm/video.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c index 8bb05ae02c..da0ce7b9ce 100644 --- a/drivers/video/console_rotate.c +++ b/drivers/video/console_rotate.c @@ -212,7 +212,7 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; linenum = vid_priv->ysize - y - 1; - x = vid_priv->xsize - VID_TO_PIXEL(x_frac) - VIDEO_FONT_WIDTH - 1; + x = vid_priv->xsize - VID_TO_PIXEL(x_frac) - 1; line = vid_priv->fb + linenum * vid_priv->line_length + x * pbytes; for (row = 0; row < VIDEO_FONT_HEIGHT; row++) { diff --git a/test/dm/video.c b/test/dm/video.c index 0664e3f22b..68f5ba44e7 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -251,7 +251,7 @@ DM_TEST(dm_test_video_rotation1, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); /* Test rotated text output through the console uclass */ static int dm_test_video_rotation2(struct unit_test_state *uts) { - ut_assertok(check_vidconsole_output(uts, 2, 785, 446)); + ut_assertok(check_vidconsole_output(uts, 2, 783, 445)); return 0; } From patchwork Mon May 25 01:48:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297047 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XhLxv9hy; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg6W2rd7z9sPF for ; Mon, 25 May 2020 11:50:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B8FEC812EC; Mon, 25 May 2020 03:49:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XhLxv9hy"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 432F28158A; Mon, 25 May 2020 03:49:23 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id BA434801D8 for ; Mon, 25 May 2020 03:49:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id j2so16092705ilr.5 for ; Sun, 24 May 2020 18:49:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=G1G2yN7CH6mwZowFRLCl3N052lzs4IPNmfKb916UET4=; b=XhLxv9hye5TLeHUyJTvm15gNKhwE8CJ4C+kQWb/iAEkMydZUWn3EOzrP+JpMhUM2XS 3zUJw80EZafRR/yvi+Wenp1lTXYlg0ReQZBQQOpT4R7LTBPvIiRTZ/DfoVMJpOwXwclh g/7kiM6zzDLPLGwM5JBY4A1S9Ym5glfM5LHv8= 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=G1G2yN7CH6mwZowFRLCl3N052lzs4IPNmfKb916UET4=; b=DwRhh7yhb1ECNgkMqzTBrt+TzScDrVfB8oDboHGLTafVTrlkGlITjpKyDbxGwFwczh cH9kCwYDSR+qPZmJTcqvD0HOgtkr6umBvM8h9R1TcUMikt9+Di7NxVOXQ6aDqvyPJQvq EUV++zFQMXTsuQfTZ2UzE4udln7KF3jkP0sXrWEtOy47ciyfOj3JPTVhjj7LtAwso69o /zq7Sq8CNdF1BuEI0wNuSrUaYuw+gSMyp54Hc8k/0oAu80RWF28O984gCKkFNeU3UD87 HTKaV47AHovwUOGMPqh6gD2hh+1Wd3NWfcDbhbsCTWuR1VpCcGz3weffmpTwVPV2TVi8 o4gg== X-Gm-Message-State: AOAM533OXPCYFTc4SB0dDfpBwxjw+lLkv257ZfBUD0NSNXHybE16mHtp cOctLfz5QZ28l11nZIBeSqt9dKzaPWeDgQ== X-Google-Smtp-Source: ABdhPJzZFmZyiFmR8oIqDV5wQQFkCFvw++gdHXq2Vm9DGjpLG7x8kWXU0p0yOaF6cppc9JGlRh004A== X-Received: by 2002:a92:d40f:: with SMTP id q15mr20812164ilm.97.1590371353573; Sun, 24 May 2020 18:49:13 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:13 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 07/26] video: Drop unnecessary #ifdef around vid_console_color() Date: Sun, 24 May 2020 19:48:44 -0600 Message-Id: <20200524194852.v2.7.I077675d6a9b88621e29511331f0773f8bdaf5fc7@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean All of the functions in this file only apply if DM_VIDEO is enabled. Drop the #ifdef as it just clutters things up. Add the needed forward declaration. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None include/video_console.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/include/video_console.h b/include/video_console.h index 0936ceaaf1..d3bc063165 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -8,6 +8,8 @@ #include +struct video_priv; + #define VID_FRAC_DIV 256 #define VID_TO_PIXEL(x) ((x) / VID_FRAC_DIV) @@ -241,8 +243,6 @@ int vidconsole_put_string(struct udevice *dev, const char *str); void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row); -#ifdef CONFIG_DM_VIDEO - /** * vid_console_color() - convert a color code to a pixel's internal * representation @@ -257,5 +257,3 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, u32 vid_console_color(struct video_priv *priv, unsigned int idx); #endif - -#endif From patchwork Mon May 25 01:48:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297048 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=eDEeXx7b; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg6l74fqz9sPF for ; Mon, 25 May 2020 11:51:11 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E789C8167F; Mon, 25 May 2020 03:49:58 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="eDEeXx7b"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B8D9881497; Mon, 25 May 2020 03:49:24 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7C2B4801D6 for ; Mon, 25 May 2020 03:49:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd43.google.com with SMTP id u23so4149818iot.12 for ; Sun, 24 May 2020 18:49:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=PtefK9S7dm4IRyQ304zmit1ey0EEr3Rr7TPD6edNM/M=; b=eDEeXx7bHVzGdA/CYQ02PHRXayM5yYlteieN06KVQtzuG4ex/IbaNbgVshj1rP68xU HAW26yw+dDETPAnJmsBiGWb6oxEh8IialuHADVMufcLBOz4zhs1ObfNmxmju0nOsKnoe WTPJt7+an6z7doFClVf1vs5zwHGNSITBgDA9I= 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=PtefK9S7dm4IRyQ304zmit1ey0EEr3Rr7TPD6edNM/M=; b=VwLc5LMJJtznwRR8InkgTj8LIriDk3F7pxXBuv1vtK9dX8MJCZkvxTY3h2Y2++D9gR OIFu9umrHMTG2/nxE9ng0VJJf941hJUqxMRkpX5Q9wZe+y6MdH0yMjo4tQJQGSHeLGcm KbW7pRe7G3qOmczNkR3MIDkd6ATVSMqXpOmnNrXPgPt4RvULx3PJE9a23TPsPkGslyP4 O0/+VHcGJdRaR79QBtYDPE9b7jYfZU8uqnBd6uZX1iJUdJWrWcc6smgPJeBZosDkHLYv Eges9ts/sdIptNjl39QcWf60gZ8581VPNL0FK44TMbOXnwyxr79xA1BZJb33ddDvx7zF cdtQ== X-Gm-Message-State: AOAM5318aIQwO1WXS3lqHY3nUcosZTJ1g7/Z3lxYcUdER9YU+Jkzr2oy I0izRl//X/gqwfWOqf/EZwccC5ECkDEDRA== X-Google-Smtp-Source: ABdhPJwzLeHknEyE3MCYYadWSjM5sf8PcyK/UIbvL7ekdQ4+daWC65L0RHSAJe4YfBsigipeqx43OA== X-Received: by 2002:a02:82cd:: with SMTP id u13mr4298098jag.32.1590371354276; Sun, 24 May 2020 18:49:14 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 08/26] video: Add a comment for struct video_uc_platdata Date: Sun, 24 May 2020 19:48:45 -0600 Message-Id: <20200524194852.v2.8.Ia4b140d3a91a26c97fa8609ad63a4a3784621d5a@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Add a few notes to explain the purpose of each member of this struct. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None include/video.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/include/video.h b/include/video.h index e7c58e86cb..813b5653b0 100644 --- a/include/video.h +++ b/include/video.h @@ -19,6 +19,18 @@ struct udevice; +/** + * struct video_uc_platdata - uclass platform data for a video device + * + * This holds information that the uclass needs to know about each device. It + * is accessed using dev_get_uclass_platdata(dev). See 'Theory of operation' at + * the top of video-uclass.c for details on how this information is set. + * + * @align: Frame-buffer alignment, indicating the memory boundary the frame + * buffer should start on. If 0, 1MB is assumed + * @size: Frame-buffer size, in bytes + * @base: Base address of frame buffer, 0 if not yet known + */ struct video_uc_platdata { uint align; uint size; From patchwork Mon May 25 01:48:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297051 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=FMXReeGD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg7S1p59z9sPF for ; Mon, 25 May 2020 11:51:48 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 850B181734; Mon, 25 May 2020 03:50:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="FMXReeGD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 7900D81589; Mon, 25 May 2020 03:49:29 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8444081002 for ; Mon, 25 May 2020 03:49:16 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id d7so17275623ioq.5 for ; Sun, 24 May 2020 18:49:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lFXNpUD4B9iR1XCR5FPiaQotW46rw+2RVYIw+k9Q/Y4=; b=FMXReeGDDfosfsGO8u38FhjMURsqW4A7VH14HcJyesRhM+JYMqP8abXh8lXehXQ9xn 8a4caRStL2gXQJNZQblMlJxZvZBTVMykbHFWusUr9QoPbqjFgOcZav/DGIl+zrVcJfIs sUvsIXmI0sIvjFQMQMWUVa5Qv9n6HrGpBlrb8= 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=lFXNpUD4B9iR1XCR5FPiaQotW46rw+2RVYIw+k9Q/Y4=; b=Rdk+DYzoTUbwcgrUQIKLzF4OhI6GsnDiv3cMPSXjm68bF2/+Y8d9hgdF2uVCSf1fYe 9lNKkVyrV/LRJg5WNjH3LBzUdhFak0z0etDr0dXmpGhLQV9OysG22y7YvE0GsaMrNM9R b0IXZtItzYhm1UUnn9kE1A7I4ycN6DVAZ1k/nId6PCJkmVWWz/iYPm7A4yrPG4vbH28U rUgf68rtQU0DXk9Sbx5XOznObfSCxSt7GsDssnA25LhvbR6NRLDmh1IBFjMuJCW7Aald muIVa/yONMJTcJORJlZzM0xfQw1TD9+gQ3oqVi+szAex2YV8peVCZJAHGKPE7yzcvo/H 7UJA== X-Gm-Message-State: AOAM533ZQm64pi0t25bbOtOwWDuB7xbrOAawXAxLC8OiJiiEk6hpoyb+ 4Er+HEpvNM5i34UVuBM8qTvlkOhcZmJxjQ== X-Google-Smtp-Source: ABdhPJwE6T3VTqkEx3uKDJN1wrikM1EYdF4jiH7w7A2IkmcR6moW38grWZr82NBYnBu0b8EKS5pTRA== X-Received: by 2002:a6b:f10c:: with SMTP id e12mr11558467iog.57.1590371355049; Sun, 24 May 2020 18:49:15 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:14 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 09/26] video: Add support for copying to a hardware framebuffer Date: Sun, 24 May 2020 19:48:46 -0600 Message-Id: <20200524194852.v2.9.I27c41308a73654764c8980faf799b37138c1e4b3@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Some architectures use a cached framebuffer and flush the cache as needed so that changes are visible. This is supported by U-Boot. However x86 uses an uncached framebuffer with a 'write-combining' feature to speed up writes. Reads are permitted but they are extremely expensive. Unfortunately, reading from the frame buffer is quite common, e.g. to scroll it. This makes scrolling very slow. Add a new feature which supports copying modified parts of the frame buffer to the uncached hardware buffer. This speeds up scrolling by at least 10x on x86 so the extra complexity cost seems worth it. As a starting point, add the Kconfig, update the video structures to keep track of the buffer and add a function to do the copy. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/Kconfig | 12 ++++++++ drivers/video/video-uclass.c | 54 ++++++++++++++++++++++++++++++++++++ include/video.h | 29 +++++++++++++++++++ 3 files changed, 95 insertions(+) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 38123543a5..1cf63efd48 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -14,6 +14,18 @@ config DM_VIDEO option compiles in the video uclass and routes all LCD/video access through this. +config VIDEO_COPY + bool "Enable copying the frame buffer to a hardware copy" + depends on DM_VIDEO + help + On some machines (e.g. x86), reading from the frame buffer is very + slow because it is uncached. To improve performance, this feature + allows the frame buffer to be kept in cached memory (allocated by + U-Boot) and then copied to the hardware frame-buffer as needed. + + To use this, your video driver must set @copy_base in + struct video_uc_platdata. + config BACKLIGHT_PWM bool "Generic PWM based Backlight Driver" depends on DM_VIDEO && DM_PWM diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index bf396d1091..9fbaa8db10 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -4,6 +4,7 @@ */ #include +#include #include #include #include @@ -200,6 +201,59 @@ int video_get_ysize(struct udevice *dev) return priv->ysize; } +#ifdef CONFIG_VIDEO_COPY +int video_sync_copy(struct udevice *dev, void *from, void *to) +{ + struct video_priv *priv = dev_get_uclass_priv(dev); + + if (priv->copy_fb) { + long offset, size; + + /* Find the offset of the first byte to copy */ + if ((ulong)to > (ulong)from) { + size = to - from; + offset = from - priv->fb; + } else { + size = from - to; + offset = to - priv->fb; + } + + /* + * Allow a bit of leeway for valid requests somewhere near the + * frame buffer + */ + if (offset < -priv->fb_size || offset > 2 * priv->fb_size) { +#ifdef DEBUG + char str[80]; + + snprintf(str, sizeof(str), + "[sync_copy fb=%p, from=%p, to=%p, offset=%lx]", + priv->fb, from, to, offset); + console_puts_select_stderr(true, str); +#endif + return -EFAULT; + } + + /* + * Silently crop the memcpy. This allows callers to avoid doing + * this themselves. It is common for the end pointer to go a + * few lines after the end of the frame buffer, since most of + * the update algorithms terminate a line after their last write + */ + if (offset + size > priv->fb_size) { + size = priv->fb_size - offset; + } else if (offset < 0) { + size += offset; + offset = 0; + } + + memcpy(priv->copy_fb + offset, priv->fb + offset, size); + } + + return 0; +} +#endif + /* Set up the colour map */ static int video_pre_probe(struct udevice *dev) { diff --git a/include/video.h b/include/video.h index 813b5653b0..1a0ffd8037 100644 --- a/include/video.h +++ b/include/video.h @@ -30,11 +30,14 @@ struct udevice; * buffer should start on. If 0, 1MB is assumed * @size: Frame-buffer size, in bytes * @base: Base address of frame buffer, 0 if not yet known + * @copy_base: Base address of a hardware copy of the frame buffer. See + * CONFIG_VIDEO_COPY. */ struct video_uc_platdata { uint align; uint size; ulong base; + ulong copy_base; }; enum video_polarity { @@ -75,6 +78,8 @@ enum video_log2_bpp { * @font_size: Font size in pixels (0 to use a default value) * @fb: Frame buffer * @fb_size: Frame buffer size + * @copy_fb: Copy of the frame buffer to keep up to date; see struct + * video_uc_platdata * @line_length: Length of each frame buffer line, in bytes. This can be * set by the driver, but if not, the uclass will set it after * probing @@ -101,6 +106,7 @@ struct video_priv { */ void *fb; int fb_size; + void *copy_fb; int line_length; u32 colour_fg; u32 colour_bg; @@ -214,6 +220,29 @@ void video_set_flush_dcache(struct udevice *dev, bool flush); */ void video_set_default_colors(struct udevice *dev, bool invert); +#ifdef CONFIG_VIDEO_COPY +/** + * vidconsole_sync_copy() - Sync back to the copy framebuffer + * + * This ensures that the copy framebuffer has the same data as the framebuffer + * for a particular region. It should be called after the framebuffer is updated + * + * @from and @to can be in either order. The region between them is synced. + * + * @dev: Vidconsole device being updated + * @from: Start/end address within the framebuffer (->fb) + * @to: Other address within the frame buffer + * @return 0 if OK, -EFAULT if the start address is before the start of the + * frame buffer start + */ +int video_sync_copy(struct udevice *dev, void *from, void *to); +#else +static inline int video_sync_copy(struct udevice *dev, void *from, void *to) +{ + return 0; +} +#endif + #endif /* CONFIG_DM_VIDEO */ #ifndef CONFIG_DM_VIDEO From patchwork Mon May 25 01:48:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297049 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=b/excENg; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg702Y6Mz9sPF for ; Mon, 25 May 2020 11:51:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 15F208168A; Mon, 25 May 2020 03:50:04 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="b/excENg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 96FC681521; Mon, 25 May 2020 03:49:26 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 315E2812ED for ; Mon, 25 May 2020 03:49:17 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x143.google.com with SMTP id c20so16089272ilk.6 for ; Sun, 24 May 2020 18:49:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=DIZR+ERXAY2/b5I+i4FHjz3UJFlivEuIH+N+pGE01+8=; b=b/excENgRBopJOB10cOM7Yd4e0EdMEvzaES+WThoMTFM1xQ0TA2HN3d2WGFP0r5VoZ auYiiJn+ZLzAJ55feSHy28ud1HLtBNno5beSsk3cNGriUsA35kff3Q0zCT6k5Cpu+V8/ fFD0/qCD2hOi6zd+V2qkRxI1NwPLG5OyeTH5E= 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=DIZR+ERXAY2/b5I+i4FHjz3UJFlivEuIH+N+pGE01+8=; b=p/LwGtXFbjY5AKLwacHxBDMZOcWdvF+s3DXW4XfqX821Xg9iDgSvot+X1cFW/pRqlR RHAqZDeyUUmtspdTRs2rtvTPvySP8civxtbYTq2xQVMhADLaV3jOusc4jfrmZWOhsHcF 6okm+omuNdtRli5mYVXrwxJWMPwivAdjaemZizJwSW3V7xLlZm8TpCgQa9t+SH9JLef5 D5iTw2Tuex8OnBdiMeekqcFyxcLNGN0TaphTBOsVH+S2nfdJlLfzseiUHh2DiRAusXdv vgHIomQ9wTD3szcL8oo9KDQWIDzNi2Pi81PjCludCDGcXmbq/gdrM4BKwCr5mAHnc9UK JPSA== X-Gm-Message-State: AOAM530SOk87aKl0MUvar5A5h3AI+YG8q97RA7smvcL+PmL+bNkk5NLq DiUERsLmMahGSEa9RlI06SLDPXB1isKr7Q== X-Google-Smtp-Source: ABdhPJyAqkTUsDNmqa8qdTuiLWfaP4xsrLMP7Ie0iZjlp6efd3YuDEjeaPO2p0Ai7IixK+g6UVuFsg== X-Received: by 2002:a92:c7a4:: with SMTP id f4mr22789455ilk.44.1590371355991; Sun, 24 May 2020 18:49:15 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:15 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 10/26] video: Set up the copy framebuffer when enabled Date: Sun, 24 May 2020 19:48:47 -0600 Message-Id: <20200524194852.v2.10.I606e8e25387b8d82547def3f4465ae62d1685f84@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This framebuffer is separately mapped. Update the video post-probe function to set this up. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/video-uclass.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 9fbaa8db10..0c97377ea9 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -292,6 +292,9 @@ static int video_post_probe(struct udevice *dev) priv->fb_size = priv->line_length * priv->ysize; + if (IS_ENABLED(CONFIG_VIDEO_COPY) && plat->copy_base) + priv->copy_fb = map_sysmem(plat->copy_base, plat->size); + /* Set up colors */ video_set_default_colors(dev, false); From patchwork Mon May 25 01:48:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297050 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=iojVg09j; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg7D1184z9sPF for ; Mon, 25 May 2020 11:51:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id E60278168D; Mon, 25 May 2020 03:50:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="iojVg09j"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E3885814E1; Mon, 25 May 2020 03:49:27 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 17E3D812E7 for ; Mon, 25 May 2020 03:49:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd41.google.com with SMTP id q8so15863837iow.7 for ; Sun, 24 May 2020 18:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1SwT40vlnAh47lfyLthEkjOmrhT1t4PWYY+4Bbyiuso=; b=iojVg09jt1z3ARAwBWdglv4dtiVSp0D/goEomDFrHSUlnYhKhqak+gBIrG31Ewy8BQ uA01kI92p7AJfwJSpDBWAnBnyTQcDRBE+2nT49jo6cgNQ4r6FogfsYJSNmi4ih/s2ugR cQyQKSP3E3nVwXyO1LI67x4HjDJ8cDocAy7iU= 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=1SwT40vlnAh47lfyLthEkjOmrhT1t4PWYY+4Bbyiuso=; b=itlU3/3WuvU+k9rUCR3YK+ugFPZ8cokfW6xXV6Cc99Yk1wK9EifXkjJDXmZGMtkVYF yviidStSsN1NQQrskMxdblCQio+2KS58sXO1fVENzAMc0XebXn/ZrC10sAJUFIALkhSG wxVrTDt42OrB05IWYnh9phHMb/r7oWWsIOxEDRNzsAWOD6zQC9EtKUCYGIFgErxJvW2F gGh5QvQxNmFxUFrx3LKVeJ3MKcI1FCPWtAusc3wrInzCZoxx5NkF9dD4P4rOT339Moko MauSIwZRTQlW9CjtgSGf2VIFY2lW8kRJ6FNrzM6bWcJ5or6VZlF9/FqIJUejJaQ8fph5 ZMHQ== X-Gm-Message-State: AOAM532Fw7dOuqlU1UYepAYlzh6osmVc7dULrIcjZJVBhhyZFgi9xjTi X6HPnOlza/cd7DlR3qes2IxPzsgXDdfwhA== X-Google-Smtp-Source: ABdhPJwM/4C0JMmXwY/imyu+Ugs542gr0x4NuwG78hgqXQFkPTXdZcjCNc9MbeApS7jz26rS8eQMcA== X-Received: by 2002:a02:c804:: with SMTP id p4mr11507307jao.115.1590371356734; Sun, 24 May 2020 18:49:16 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:16 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 11/26] video: Clear the copy framebuffer when clearing the screen Date: Sun, 24 May 2020 19:48:48 -0600 Message-Id: <20200524194852.v2.11.Idb93182c5620fa4a55ad25cd4ef796bb8ce2241d@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update video_clear() to also sync to the copy framebuffer. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/video-uclass.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 0c97377ea9..4d6f950eab 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -94,6 +94,7 @@ int video_reserve(ulong *addrp) int video_clear(struct udevice *dev) { struct video_priv *priv = dev_get_uclass_priv(dev); + int ret; switch (priv->bpix) { case VIDEO_BPP16: @@ -118,6 +119,9 @@ int video_clear(struct udevice *dev) memset(priv->fb, priv->colour_bg, priv->fb_size); break; } + ret = video_sync_copy(dev, priv->fb, priv->fb + priv->fb_size); + if (ret) + return ret; return 0; } From patchwork Mon May 25 01:48:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297053 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=WtCqnJC/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg7w19zbz9sPF for ; Mon, 25 May 2020 11:52:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 352A181799; Mon, 25 May 2020 03:50:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="WtCqnJC/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 37E6E813C9; Mon, 25 May 2020 03:49:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id C549F813AB for ; Mon, 25 May 2020 03:49:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id k18so17322036ion.0 for ; Sun, 24 May 2020 18:49:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=8dP1lEKUn2+fJDxEWoU2ItGvAr2ysN4e1bSzywQYq/Y=; b=WtCqnJC/vKf8pN+AF23iAZ4788Bx/8gMG3WicJE+9AasvI+PoHeK/Q2WlDcC23mKir Qsiuj8LVQc8W9V5Erc+i9mV0C73ReebquUjnEtzl5/fP9wSEdbFCcCjY/VPi3vzxYS7V f7NODXe2gdtUxZ8aKweaUF2NsauVVaYuIdHEY= 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=8dP1lEKUn2+fJDxEWoU2ItGvAr2ysN4e1bSzywQYq/Y=; b=VAwtzFLB8Lx7XNLfCylLVz09PpP0bzfELQwMkQgO7TMwTCeFEJMtBR4aO5FFAvpg7e GlUbiNqNwK3oBpLgYlFpw+yafmtu5URtcObdTdP0NZ1VLO2GcA3X/0Wu0VRcfFRxIOzL 0Oxu7ORkcEMcA+oYkqvXhMCUODxR3jjh3ZrQ5zBYicRxIP+4lRUgb6hJz9zIKyvGxYGO d10gTIdPQkf0mINSALhvCFX/N6MfnBvQ67xlThOvPIiZjvSSjGdJif2hp9bEIgVZUYHu th16WWZyc+cjpGjTgyS+zQaATSUo12k0LFji27cGifFpS2G7YP7lRVWs0SsYZV9jOPC6 amBg== X-Gm-Message-State: AOAM5319ua6J0qahiplzCOg01nclf6lv2Q+t9WGywPpSHFGozFwVnlcs 6u0x8coYdfgUAAk5m/vzwHLwzb6HxzvUvA== X-Google-Smtp-Source: ABdhPJyKmdCgSNou4X6aEb3qCGGEFoaFgi8d1OsORXXDjRFZP2ZOhs5aZhwySyF6KooNznIYKnhdXQ== X-Received: by 2002:a02:90cd:: with SMTP id c13mr17466536jag.83.1590371357550; Sun, 24 May 2020 18:49:17 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:17 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 12/26] video: Add helpers for vidconsole for the copy framebuffer Date: Sun, 24 May 2020 19:48:49 -0600 Message-Id: <20200524194852.v2.12.If5b172fd65f0d257381cc0f78cca1b506d5d0bcf@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Add a convenience function to call video_sync_copy() for a vidconsole. Also add a memmove() helper, which does the memmove() as well as the sync. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: - Simplify return sequence in vidconsole_memmove() since there is no logging drivers/video/vidconsole-uclass.c | 18 ++++++++++++ include/video_console.h | 49 +++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) diff --git a/drivers/video/vidconsole-uclass.c b/drivers/video/vidconsole-uclass.c index e06912cf36..406ec2334c 100644 --- a/drivers/video/vidconsole-uclass.c +++ b/drivers/video/vidconsole-uclass.c @@ -629,6 +629,24 @@ UCLASS_DRIVER(vidconsole) = { .per_device_auto_alloc_size = sizeof(struct vidconsole_priv), }; +#ifdef CONFIG_VIDEO_COPY +int vidconsole_sync_copy(struct udevice *dev, void *from, void *to) +{ + struct udevice *vid = dev_get_parent(dev); + + return video_sync_copy(vid, from, to); +} + +int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, + int size) +{ + int ret; + + memmove(dst, src, size); + return vidconsole_sync_copy(dev, dst, dst + size); +} +#endif + void vidconsole_position_cursor(struct udevice *dev, unsigned col, unsigned row) { struct vidconsole_priv *priv = dev_get_uclass_priv(dev); diff --git a/include/video_console.h b/include/video_console.h index d3bc063165..06b798ef10 100644 --- a/include/video_console.h +++ b/include/video_console.h @@ -256,4 +256,53 @@ void vidconsole_position_cursor(struct udevice *dev, unsigned col, */ u32 vid_console_color(struct video_priv *priv, unsigned int idx); +#ifdef CONFIG_VIDEO_COPY +/** + * vidconsole_sync_copy() - Sync back to the copy framebuffer + * + * This ensures that the copy framebuffer has the same data as the framebuffer + * for a particular region. It should be called after the framebuffer is updated + * + * @from and @to can be in either order. The region between them is synced. + * + * @dev: Vidconsole device being updated + * @from: Start/end address within the framebuffer (->fb) + * @to: Other address within the frame buffer + * @return 0 if OK, -EFAULT if the start address is before the start of the + * frame buffer start + */ +int vidconsole_sync_copy(struct udevice *dev, void *from, void *to); + +/** + * vidconsole_memmove() - Perform a memmove() within the frame buffer + * + * This handles a memmove(), e.g. for scrolling. It also updates the copy + * framebuffer. + * + * @dev: Vidconsole device being updated + * @dst: Destination address within the framebuffer (->fb) + * @src: Source address within the framebuffer (->fb) + * @size: Number of bytes to transfer + * @return 0 if OK, -EFAULT if the start address is before the start of the + * frame buffer start + */ +int vidconsole_memmove(struct udevice *dev, void *dst, const void *src, + int size); +#else +static inline int vidconsole_sync_copy(struct udevice *dev, void *from, + void *to) +{ + return 0; +} + +static inline int vidconsole_memmove(struct udevice *dev, void *dst, + const void *src, int size) +{ + memmove(dst, src, size); + + return 0; +} + +#endif + #endif From patchwork Mon May 25 01:48:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297052 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Xasi5Iic; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg7g2m9sz9sPF for ; Mon, 25 May 2020 11:51:59 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8CD0581777; Mon, 25 May 2020 03:50:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Xasi5Iic"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C9B5A8158A; Mon, 25 May 2020 03:49:30 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id AAB26808A1 for ; Mon, 25 May 2020 03:49:19 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id f3so17293762ioj.1 for ; Sun, 24 May 2020 18:49:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=o6ROTwfyKuNPjV5FdSTV0jpYEc/JmAMO5HtT2nPbKE4=; b=Xasi5Iics5HXHcT7/aDu7ooKmNm1N8yrQ5S9ap/Imd5xncO3pyNqgAsOFaJQTZ/Tze FjeHABQldvpmh6rj9uqS/fLypcr1i4OMY8EHMYRmrr4s3LFeV2nFygTxsQYK0tLai5C9 bpZsOcjSeGyr6UbXJ/adeEHFckruh7wz4Vrtw= 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=o6ROTwfyKuNPjV5FdSTV0jpYEc/JmAMO5HtT2nPbKE4=; b=m7dTirDwm8dVoFQOwcxtwsvtkhXmN/v5zupwLHe72Qu4OUc/y+nJDYI2bYn/CyVhtE 4WIKtXlzSPXvSWqK82A0prpS///ErhIM7XSFWweW5XaIwzgv3ctOnwf6eEyPOvLiMT1i aOBnm3SJp0LUgl02s0ThA/qVqWxzmUpaZk5ol6O5Clha/Rpr0NEBwtO0UzR+a2zsCznv DWHd04M/PegUIsqByNfIWJU4tNuir1kHMtnT+vg04ogWpKDgX4G7Yq8lObgPWVTmjXLs cipZ6iQqKFrn5WOaKE2JLjtBeYL1LMGXnxtMEfojr+2kpKUItDj3wcd07hgBkSwdqOZC 2diA== X-Gm-Message-State: AOAM531YV+328ZQGEwdzmK4tcKu765R1Wbv7YWpGPG+sdrb5vzk9z2SI x8xpooHhp+gn4DJ1YC2Eb5lcE0JyQfBVQQ== X-Google-Smtp-Source: ABdhPJyDXm0OgkXl+edHPoXKwfgzmGS1M2RPUPmAeUuvGvOjo/KemsYfXtPVu4kgN/dlfT/aCWr29Q== X-Received: by 2002:a6b:700a:: with SMTP id l10mr11370443ioc.170.1590371358270; Sun, 24 May 2020 18:49:18 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 13/26] video: Update normal console to support copy buffer Date: Sun, 24 May 2020 19:48:50 -0600 Message-Id: <20200524194852.v2.13.Ibeb0ab19b593a5cfcb737f756feeaddf09d5e3cb@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update the implementation to keep a track of what it changes in the frame buffer and then tell the copy buffer about it. Use the special vidconsole_memmove() helper so that memmove() operations are also reflected in the copy buffer. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/console_normal.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/drivers/video/console_normal.c b/drivers/video/console_normal.c index c3f7ef8add..04f022491e 100644 --- a/drivers/video/console_normal.c +++ b/drivers/video/console_normal.c @@ -16,8 +16,9 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); - void *line; + void *line, *end; int pixels = VIDEO_FONT_HEIGHT * vid_priv->xsize; + int ret; int i; line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * vid_priv->line_length; @@ -28,6 +29,7 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } case VIDEO_BPP16: @@ -36,6 +38,7 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } case VIDEO_BPP32: @@ -44,11 +47,15 @@ static int console_normal_set_row(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } default: return -ENOSYS; } + ret = vidconsole_sync_copy(dev, line, end); + if (ret) + return ret; return 0; } @@ -59,10 +66,15 @@ static int console_normal_move_rows(struct udevice *dev, uint rowdst, struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); void *dst; void *src; + int size; + int ret; dst = vid_priv->fb + rowdst * VIDEO_FONT_HEIGHT * vid_priv->line_length; src = vid_priv->fb + rowsrc * VIDEO_FONT_HEIGHT * vid_priv->line_length; - memmove(dst, src, VIDEO_FONT_HEIGHT * vid_priv->line_length * count); + size = VIDEO_FONT_HEIGHT * vid_priv->line_length * count; + ret = vidconsole_memmove(dev, dst, src, size); + if (ret) + return ret; return 0; } @@ -74,8 +86,13 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y, struct udevice *vid = dev->parent; struct video_priv *vid_priv = dev_get_uclass_priv(vid); int i, row; - void *line = vid_priv->fb + y * vid_priv->line_length + + void *start; + void *line; + int ret; + + start = vid_priv->fb + y * vid_priv->line_length + VID_TO_PIXEL(x_frac) * VNBYTES(vid_priv->bpix); + line = start; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; @@ -126,6 +143,9 @@ static int console_normal_putc_xy(struct udevice *dev, uint x_frac, uint y, } line += vid_priv->line_length; } + ret = vidconsole_sync_copy(dev, start, line); + if (ret) + return ret; return VID_TO_POS(VIDEO_FONT_WIDTH); } From patchwork Mon May 25 01:48:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297054 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IKYC0E1/; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg8856MMz9sPF for ; Mon, 25 May 2020 11:52:24 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0513481810; Mon, 25 May 2020 03:50:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="IKYC0E1/"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 8BCAA81002; Mon, 25 May 2020 03:49:32 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 785E7813C3 for ; Mon, 25 May 2020 03:49:20 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id a14so16083859ilk.2 for ; Sun, 24 May 2020 18:49:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=VPeDnoIHe3kGKH9VDpX/Vi/1coqMqRxyGv1FUHP7UX8=; b=IKYC0E1/6YH2v+RI5tYPnH7RBlvFtmA4DQdrEjq3GWURju8hIW2fXrdDl38z76ILRt W3DiM7U5HdV+i3vuernks8wN4DBCMqUBzBo+u53Pp1XE3Ud3M4+u6CrJx7pa4ouyuKQQ R3VYcBHv09sgRsUr9OnduLQYPVgGM6208mmgQ= 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=VPeDnoIHe3kGKH9VDpX/Vi/1coqMqRxyGv1FUHP7UX8=; b=sKzHENyNkEsSzSGF2uqR/jrkabNrPY/9HDBAp8iR+2ZcjW6MK1vswuquv7FT7d8Inq kS2EKmwGopjtJFQQLsUPlRt33Fp4y4V5Qs7mxt63RgEuye7IdT5PrgWtLQJsFqG8iDcT zxSx+YQ0itGuYTJTYdH/yyAA8MECgrXKSPcNgVLZ8PeSkn11lUHAHULjXnEJzcYHM7WR 47mf7ZY7JxZf42Lk+cUp/rK/3EGE0Qp1bVdEBWR1DWtJN8XpKQ+uru65gkfU1UZgthmi GCc5YOFu2IqwWVv3e4XlIYy2Z+6/1r2j0PWPd8l7uhHVwnSOnx1W/U10ip1R70VUzK2/ EAgg== X-Gm-Message-State: AOAM530hndztoG7xE5WyQKgJyx9Na4xBl34okJGVRdVp1DTOI7ytnvyZ acKQY8EfAR9nSIrwSsfBUhgmLj1B1/1Jvg== X-Google-Smtp-Source: ABdhPJyf34n88Iwei6yAhQ4itZcCHnhuMEMw7dz2HBEe7GjjwniIFfEycXPoP1IpOV5YFK6MfwfsHQ== X-Received: by 2002:a92:aace:: with SMTP id p75mr20025863ill.160.1590371359103; Sun, 24 May 2020 18:49:19 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:18 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 14/26] video: Update truetype console to support copy buffer Date: Sun, 24 May 2020 19:48:51 -0600 Message-Id: <20200524194852.v2.14.I7b2b4487cb81658022e283a2676803ae1bc173ff@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update the implementation to keep a track of what it changes in the frame buffer and then tell the copy buffer about it. Use the special vidconsole_memmove() helper so that memmove() operations are also reflected in the copy buffer. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/console_truetype.c | 43 +++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 12 deletions(-) diff --git a/drivers/video/console_truetype.c b/drivers/video/console_truetype.c index 5f7f03904b..22b2ea7191 100644 --- a/drivers/video/console_truetype.c +++ b/drivers/video/console_truetype.c @@ -127,9 +127,9 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); struct console_tt_priv *priv = dev_get_priv(dev); - void *line; + void *end, *line; int pixels = priv->font_size * vid_priv->line_length; - int i; + int i, ret; line = vid_priv->fb + row * priv->font_size * vid_priv->line_length; switch (vid_priv->bpix) { @@ -139,6 +139,7 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } #endif @@ -148,6 +149,7 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } #endif @@ -157,12 +159,16 @@ static int console_truetype_set_row(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } #endif default: return -ENOSYS; } + ret = vidconsole_sync_copy(dev, line, end); + if (ret) + return ret; return 0; } @@ -174,11 +180,14 @@ static int console_truetype_move_rows(struct udevice *dev, uint rowdst, struct console_tt_priv *priv = dev_get_priv(dev); void *dst; void *src; - int i, diff; + int i, diff, ret; dst = vid_priv->fb + rowdst * priv->font_size * vid_priv->line_length; src = vid_priv->fb + rowsrc * priv->font_size * vid_priv->line_length; - memmove(dst, src, priv->font_size * vid_priv->line_length * count); + ret = vidconsole_memmove(dev, dst, src, priv->font_size * + vid_priv->line_length * count); + if (ret) + return ret; /* Scroll up our position history */ diff = (rowsrc - rowdst) * priv->font_size; @@ -203,8 +212,8 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, struct pos_info *pos; u8 *bits, *data; int advance; - void *line; - int row; + void *start, *end, *line; + int row, ret; /* First get some basic metrics about this character */ stbtt_GetCodepointHMetrics(font, ch, &advance, &lsb); @@ -253,11 +262,12 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, /* Figure out where to write the character in the frame buffer */ bits = data; - line = vid_priv->fb + y * vid_priv->line_length + + start = vid_priv->fb + y * vid_priv->line_length + VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix); linenum = priv->baseline + yoff; if (linenum > 0) - line += linenum * vid_priv->line_length; + start += linenum * vid_priv->line_length; + line = start; /* * Write a row at a time, converting the 8bpp image into the colour @@ -286,6 +296,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, *dst++ &= out; bits++; } + end = dst; break; } #endif @@ -307,6 +318,7 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, *dst++ &= out; bits++; } + end = dst; break; } #endif @@ -317,6 +329,9 @@ static int console_truetype_putc_xy(struct udevice *dev, uint x, uint y, line += vid_priv->line_length; } + ret = vidconsole_sync_copy(dev, start, line); + if (ret) + return ret; free(data); return width_frac; @@ -340,12 +355,13 @@ static int console_truetype_erase(struct udevice *dev, int xstart, int ystart, int xend, int yend, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); - void *line; + void *start, *line; int pixels = xend - xstart; - int row, i; + int row, i, ret; - line = vid_priv->fb + ystart * vid_priv->line_length; - line += xstart * VNBYTES(vid_priv->bpix); + start = vid_priv->fb + ystart * vid_priv->line_length; + start += xstart * VNBYTES(vid_priv->bpix); + line = start; for (row = ystart; row < yend; row++) { switch (vid_priv->bpix) { #ifdef CONFIG_VIDEO_BPP8 @@ -380,6 +396,9 @@ static int console_truetype_erase(struct udevice *dev, int xstart, int ystart, } line += vid_priv->line_length; } + ret = vidconsole_sync_copy(dev, start, line); + if (ret) + return ret; return 0; } From patchwork Mon May 25 01:48:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297055 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=N4YJdVe0; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg8N4qhSz9sPF for ; Mon, 25 May 2020 11:52:36 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13C3D8185E; Mon, 25 May 2020 03:50:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="N4YJdVe0"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B4369812F8; Mon, 25 May 2020 03:49:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 87B15810E0 for ; Mon, 25 May 2020 03:49:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id h10so17227678iob.10 for ; Sun, 24 May 2020 18:49:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=tw0JBPwd9oBqLutW8BnBzgU9hzdc21t5wID7QB8YGvo=; b=N4YJdVe0T3/1MQlc0GSnGiCrE4bKhjCZcu8uhEYrDv3ynBCArYe2GniArMgrLYYvdL Zp4GbTsQHP973PAsFvp/CQeC3R467wdJjrK+NhwgrR5tPycBwn53vh1G/wn6XOG8AspO 4N3qH7WpNKi6MHzhTYEYabFyZ7dTU/irKKY+I= 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=tw0JBPwd9oBqLutW8BnBzgU9hzdc21t5wID7QB8YGvo=; b=FCF+PGUEQ6pyCVdCZOo7z8KDiXb0Sew3EY7HTUbmMedgRocgyvpZQpmbLufvH1+QCX HobmunTc1Zd0K2MjmUuDPZ40LKZQuH1+N3aL5eyJ/XTmWStjk1eNsPg8dyqRwY6l2blL 41+slp5mpZUTfy66VCZZ+dSckB/byKxlxKOM3uTo9YvkoiKsbJ1F10dHZO4OPLcFTsty WU9TohCqUyPy7yp4EZB1Nn7Of9V2yIsTPndsVqnRIrAU6bwoaAd9eEM6JSFC6oz96vWC 9Fm0VNk7SvbDWhVOZuVKf7jIAAUGwWU15NCsIqJP31N54vGImk+ULgZFMCqBQA7Dj7G7 8VGg== X-Gm-Message-State: AOAM530SZ2L67o8L8348hFUuZtw11emaJtsYH4Vvv+QbVXIanhcFd6Kb v04LC2hBCWCVVr+/pAe1UcA6LoOlY35eog== X-Google-Smtp-Source: ABdhPJx+I8D6ixMXQ5jolBY8j5zN/H9egNUu3d/gStO/TjZVqde/FSX78WyhDxvJhwC9yuqqgHcHSQ== X-Received: by 2002:a05:6638:1405:: with SMTP id k5mr17163453jad.108.1590371359947; Sun, 24 May 2020 18:49:19 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:19 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 15/26] video: Update rotated console to support copy buffer Date: Sun, 24 May 2020 19:48:52 -0600 Message-Id: <20200524194852.v2.15.Ieb8fa645754166cb903055967c544f29fc2cfd2c@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update the implementation to keep a track of what it changes in the frame buffer and then tell the copy buffer about it. Use the special vidconsole_memmove() helper so that memmove() operations are also reflected in the copy buffer. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/console_rotate.c | 83 ++++++++++++++++++++++++---------- 1 file changed, 60 insertions(+), 23 deletions(-) diff --git a/drivers/video/console_rotate.c b/drivers/video/console_rotate.c index da0ce7b9ce..36c8d0609d 100644 --- a/drivers/video/console_rotate.c +++ b/drivers/video/console_rotate.c @@ -15,11 +15,13 @@ static int console_set_row_1(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); int pbytes = VNBYTES(vid_priv->bpix); - void *line; + void *start, *line; int i, j; + int ret; - line = vid_priv->fb + vid_priv->line_length - + start = vid_priv->fb + vid_priv->line_length - (row + 1) * VIDEO_FONT_HEIGHT * pbytes; + line = start; for (j = 0; j < vid_priv->ysize; j++) { switch (vid_priv->bpix) { case VIDEO_BPP8: @@ -51,6 +53,9 @@ static int console_set_row_1(struct udevice *dev, uint row, int clr) } line += vid_priv->line_length; } + ret = vidconsole_sync_copy(dev, start, line); + if (ret) + return ret; return 0; } @@ -62,7 +67,7 @@ static int console_move_rows_1(struct udevice *dev, uint rowdst, uint rowsrc, int pbytes = VNBYTES(vid_priv->bpix); void *dst; void *src; - int j; + int j, ret; dst = vid_priv->fb + vid_priv->line_length - (rowdst + count) * VIDEO_FONT_HEIGHT * pbytes; @@ -70,7 +75,10 @@ static int console_move_rows_1(struct udevice *dev, uint rowdst, uint rowsrc, (rowsrc + count) * VIDEO_FONT_HEIGHT * pbytes; for (j = 0; j < vid_priv->ysize; j++) { - memmove(dst, src, VIDEO_FONT_HEIGHT * pbytes * count); + ret = vidconsole_memmove(dev, dst, src, + VIDEO_FONT_HEIGHT * pbytes * count); + if (ret) + return ret; src += vid_priv->line_length; dst += vid_priv->line_length; } @@ -85,13 +93,14 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) struct video_priv *vid_priv = dev_get_uclass_priv(vid); uchar *pfont = video_fontdata + (u8)ch * VIDEO_FONT_HEIGHT; int pbytes = VNBYTES(vid_priv->bpix); - int i, col, x, linenum; + int i, col, x, linenum, ret; int mask = 0x80; - void *line; + void *start, *line; linenum = VID_TO_PIXEL(x_frac) + 1; x = y + 1; - line = vid_priv->fb + linenum * vid_priv->line_length - x * pbytes; + start = vid_priv->fb + linenum * vid_priv->line_length - x * pbytes; + line = start; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; @@ -136,6 +145,10 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) line += vid_priv->line_length; mask >>= 1; } + /* We draw backwards from 'start, so account for the first line */ + ret = vidconsole_sync_copy(dev, start - vid_priv->line_length, line); + if (ret) + return ret; return VID_TO_POS(VIDEO_FONT_WIDTH); } @@ -144,12 +157,13 @@ static int console_putc_xy_1(struct udevice *dev, uint x_frac, uint y, char ch) static int console_set_row_2(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); - void *line; + void *start, *line, *end; int pixels = VIDEO_FONT_HEIGHT * vid_priv->xsize; - int i; + int i, ret; - line = vid_priv->fb + vid_priv->ysize * vid_priv->line_length - + start = vid_priv->fb + vid_priv->ysize * vid_priv->line_length - (row + 1) * VIDEO_FONT_HEIGHT * vid_priv->line_length; + line = start; switch (vid_priv->bpix) { case VIDEO_BPP8: if (IS_ENABLED(CONFIG_VIDEO_BPP8)) { @@ -157,6 +171,7 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } case VIDEO_BPP16: @@ -165,6 +180,7 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } case VIDEO_BPP32: @@ -173,11 +189,15 @@ static int console_set_row_2(struct udevice *dev, uint row, int clr) for (i = 0; i < pixels; i++) *dst++ = clr; + end = dst; break; } default: return -ENOSYS; } + ret = vidconsole_sync_copy(dev, start, end); + if (ret) + return ret; return 0; } @@ -195,7 +215,8 @@ static int console_move_rows_2(struct udevice *dev, uint rowdst, uint rowsrc, vid_priv->line_length; src = end - (rowsrc + count) * VIDEO_FONT_HEIGHT * vid_priv->line_length; - memmove(dst, src, VIDEO_FONT_HEIGHT * vid_priv->line_length * count); + vidconsole_memmove(dev, dst, src, + VIDEO_FONT_HEIGHT * vid_priv->line_length * count); return 0; } @@ -206,14 +227,15 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) struct udevice *vid = dev->parent; struct video_priv *vid_priv = dev_get_uclass_priv(vid); int pbytes = VNBYTES(vid_priv->bpix); - int i, row, x, linenum; - void *line; + int i, row, x, linenum, ret; + void *start, *line; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; linenum = vid_priv->ysize - y - 1; x = vid_priv->xsize - VID_TO_PIXEL(x_frac) - 1; - line = vid_priv->fb + linenum * vid_priv->line_length + x * pbytes; + start = vid_priv->fb + linenum * vid_priv->line_length + x * pbytes; + line = start; for (row = 0; row < VIDEO_FONT_HEIGHT; row++) { unsigned int idx = (u8)ch * VIDEO_FONT_HEIGHT + row; @@ -261,6 +283,10 @@ static int console_putc_xy_2(struct udevice *dev, uint x_frac, uint y, char ch) } line -= vid_priv->line_length; } + /* Add 4 bytes to allow for the first pixel writen */ + ret = vidconsole_sync_copy(dev, start + 4, line); + if (ret) + return ret; return VID_TO_POS(VIDEO_FONT_WIDTH); } @@ -269,10 +295,11 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr) { struct video_priv *vid_priv = dev_get_uclass_priv(dev->parent); int pbytes = VNBYTES(vid_priv->bpix); - void *line; - int i, j; + void *start, *line; + int i, j, ret; - line = vid_priv->fb + row * VIDEO_FONT_HEIGHT * pbytes; + start = vid_priv->fb + row * VIDEO_FONT_HEIGHT * pbytes; + line = start; for (j = 0; j < vid_priv->ysize; j++) { switch (vid_priv->bpix) { case VIDEO_BPP8: @@ -304,6 +331,9 @@ static int console_set_row_3(struct udevice *dev, uint row, int clr) } line += vid_priv->line_length; } + ret = vidconsole_sync_copy(dev, start, line); + if (ret) + return ret; return 0; } @@ -315,13 +345,16 @@ static int console_move_rows_3(struct udevice *dev, uint rowdst, uint rowsrc, int pbytes = VNBYTES(vid_priv->bpix); void *dst; void *src; - int j; + int j, ret; dst = vid_priv->fb + rowdst * VIDEO_FONT_HEIGHT * pbytes; src = vid_priv->fb + rowsrc * VIDEO_FONT_HEIGHT * pbytes; for (j = 0; j < vid_priv->ysize; j++) { - memmove(dst, src, VIDEO_FONT_HEIGHT * pbytes * count); + ret = vidconsole_memmove(dev, dst, src, + VIDEO_FONT_HEIGHT * pbytes * count); + if (ret) + return ret; src += vid_priv->line_length; dst += vid_priv->line_length; } @@ -336,15 +369,15 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) struct video_priv *vid_priv = dev_get_uclass_priv(vid); uchar *pfont = video_fontdata + (u8)ch * VIDEO_FONT_HEIGHT; int pbytes = VNBYTES(vid_priv->bpix); - int i, col, x; + int i, col, x, ret; int mask = 0x80; - void *line; + void *start, *line; if (x_frac + VID_TO_POS(vc_priv->x_charsize) > vc_priv->xsize_frac) return -EAGAIN; x = vid_priv->ysize - VID_TO_PIXEL(x_frac) - 1; - line = vid_priv->fb + x * vid_priv->line_length + y * pbytes; - + start = vid_priv->fb + x * vid_priv->line_length + y * pbytes; + line = start; for (col = 0; col < VIDEO_FONT_HEIGHT; col++) { switch (vid_priv->bpix) { case VIDEO_BPP8: @@ -386,6 +419,10 @@ static int console_putc_xy_3(struct udevice *dev, uint x_frac, uint y, char ch) line -= vid_priv->line_length; mask >>= 1; } + /* Add a line to allow for the first pixels writen */ + ret = vidconsole_sync_copy(dev, start + vid_priv->line_length, line); + if (ret) + return ret; return VID_TO_POS(VIDEO_FONT_WIDTH); } From patchwork Mon May 25 01:48:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297056 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=SBWZp+w7; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg8d5ckwz9sPF for ; Mon, 25 May 2020 11:52:49 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id D86F081868; Mon, 25 May 2020 03:50:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="SBWZp+w7"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 4EE9781002; Mon, 25 May 2020 03:49:36 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x142.google.com (mail-il1-x142.google.com [IPv6:2607:f8b0:4864:20::142]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 249DE811F9 for ; Mon, 25 May 2020 03:49:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x142.google.com with SMTP id y17so13864495ilg.0 for ; Sun, 24 May 2020 18:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZbiAb/ZJX4NO7Lh8vVfeveTitxynMGHHXWW61Wv+ZhI=; b=SBWZp+w7p1/Dr5yYnewcSqspHbtgcXYFcskHopqZrIoXSvMJ+tgVEHruC7qO7J3GeC tYuUB2dwTSLmCHd8ooiccyeh2X2U/bNew9HpvXfbnoY5iOsqY+vp44tYdCgUoUlnU8rV q1Tv9+OC2bAhtNj4p3nRUJjm19ej9/eJjh3ZE= 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=ZbiAb/ZJX4NO7Lh8vVfeveTitxynMGHHXWW61Wv+ZhI=; b=LXHfouHMWFfWxbefJrJfi3+y63V5ExtnWwYxQ5Jp6GBh6bwzXqBHuasP3zXMhIKcLo M2AVi3dNH0JWajIbMjbi07M/fHICT6GrYhrs3EqcztaHpGLaW2fGNFe+/gp+FjcMiudO NF0vH0Ji/UrK7zQQ9PmUG1oyfSQOzFrTV5yruWWi1U5k7s0X/HVI8AZg98SrQlaUt1CK b/MWRSyh9RVw54yQB46kiJfQyUnX5N5NBb0mdAaIgDgBWvLUA6sgY7Z8uFV+b69k7xT7 nA6KOx9cS+75m4NXWBoISPeW72bwj1nl/jod1mIer+iI/gg8k0hwfT+FkeB+yoo/4AKj s7yA== X-Gm-Message-State: AOAM532qsLv6IYjVPwc+6XjmTk8E4GN6qkGFGlVNPSv5DaEr3TQSXKl3 9EH9i0AJriT9dsPRehamr5OprPIH4RxaSw== X-Google-Smtp-Source: ABdhPJwgRcQNf3jlQuiGX898/CmdTAuQAJEJR2LDh5PIfgyVdzwC69opLIdF4ite645VK3YowOvsWA== X-Received: by 2002:a92:d591:: with SMTP id a17mr23770215iln.13.1590371360812; Sun, 24 May 2020 18:49:20 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:20 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 16/26] video: Update the copy framebuffer when writing bitmaps Date: Sun, 24 May 2020 19:48:53 -0600 Message-Id: <20200524194852.v2.16.I42de10293e7246dce9339826506eb01c133c8c06@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Adjust the bitmap code to sync to the copy framebuffer when done. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/video_bmp.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/drivers/video/video_bmp.c b/drivers/video/video_bmp.c index eb9636541d..732ce3bcc1 100644 --- a/drivers/video/video_bmp.c +++ b/drivers/video/video_bmp.c @@ -192,7 +192,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, struct video_priv *priv = dev_get_uclass_priv(dev); ushort *cmap_base = NULL; int i, j; - uchar *fb; + uchar *start, *fb; struct bmp_image *bmp = map_sysmem(bmp_image, 0); uchar *bmap; ushort padded_width; @@ -201,6 +201,7 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, unsigned colours, bpix, bmp_bpix; struct bmp_color_table_entry *palette; int hdr_size; + int ret; if (!bmp || !(bmp->header.signature[0] == 'B' && bmp->header.signature[1] == 'M')) { @@ -259,8 +260,11 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, height = priv->ysize - y; bmap = (uchar *)bmp + get_unaligned_le32(&bmp->header.data_offset); - fb = (uchar *)(priv->fb + - (y + height - 1) * priv->line_length + x * bpix / 8); + start = (uchar *)(priv->fb + + (y + height) * priv->line_length + x * bpix / 8); + + /* Move back to the final line to be drawn */ + fb = start - priv->line_length; switch (bmp_bpix) { case 1: @@ -354,6 +358,12 @@ int video_bmp_display(struct udevice *dev, ulong bmp_image, int x, int y, break; }; + /* Find the position of the top left of the image in the framebuffer */ + fb = (uchar *)(priv->fb + y * priv->line_length + x * bpix / 8); + ret = video_sync_copy(dev, start, fb); + if (ret) + return log_ret(ret); + video_sync(dev, false); return 0; From patchwork Mon May 25 01:48:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297057 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=hLur71SV; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg8r1WF4z9sSJ for ; Mon, 25 May 2020 11:53:00 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 95D22818E0; Mon, 25 May 2020 03:50:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="hLur71SV"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D79EC810E0; Mon, 25 May 2020 03:49:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E10B2812FE for ; Mon, 25 May 2020 03:49:22 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id q8so15863956iow.7 for ; Sun, 24 May 2020 18:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cMGe0IY0elKzHfIu/o5OZbwWXbSvSSentim9lmaEV5w=; b=hLur71SVgzBKH+V0o4/U0dLDrryRuzLJ7EbftvqsON/6EvCgN4ywrsM9CFc3rFimfC Q0uTmLWayBN8vWVZJkL/bKZVJe8F60BED2dJTYWORP+Ws1bks9ckQvXHJYEadXDno0X3 gg6Hpo8AJZsXoYKc3NmySYyGOy1ePUy3CelZw= 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=cMGe0IY0elKzHfIu/o5OZbwWXbSvSSentim9lmaEV5w=; b=sGXQmJj7BGDFEkimc841JeiGD1Og4kll+GBbR7rt+B5xW8/iFJO5yh1/VUoB6nC/Ft h3TxF/akwLkkWgWQrOxUxM/iLDpBqmTfaermtVbJpNazC4SJdK6t3YsC4OKELDlrMXzP 4wzrqcv5sXbJgjYHwxXPTX5ttQFvmWSUijAhheTYWtlQTtbh119BFg5zxjMA2mNrP5l+ AitsPeOvO4A1xkb+baomPcPmUkf/jkaif0h6f6oFXi2VU8CvFX1BMMLmu5xXhN8tY15X JfZA+z/0x2TVZgSSlx5IvdcS8Q1WGDU7Qd6TyukeUMmK9gVZQsmyBdqKZjS5lISz4ndt NNAQ== X-Gm-Message-State: AOAM533FHCpGQe35E0VN3QILJyuN2MsjHGMXotnuGwAIOwNXuodNzuDT X93DofC+ZmJs8Az+toWTENcwshhDLEGm9g== X-Google-Smtp-Source: ABdhPJyON1O9LO6RFHFhNokw5CHx+mQJm7UL2NB97aTUpih7wxmtlQCe6NZlDd+aMxjuJ1KAQNFFtw== X-Received: by 2002:a02:665c:: with SMTP id l28mr17158082jaf.1.1590371361532; Sun, 24 May 2020 18:49:21 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:21 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 17/26] video: Add comments to struct sandbox_sdl_plat Date: Sun, 24 May 2020 19:48:54 -0600 Message-Id: <20200524194852.v2.17.I5a77b98330d65a94fd165b06d60fb51d83109d2d@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This struct is not commented but needs it. Also fix the comment in check_vidconsole_output() about the encoding for the rotation value. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None include/dm/test.h | 14 +++++++++++++- test/dm/video.c | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/include/dm/test.h b/include/dm/test.h index f0f36624ce..d39686cde2 100644 --- a/include/dm/test.h +++ b/include/dm/test.h @@ -159,7 +159,19 @@ enum { /* Declare a new driver model test */ #define DM_TEST(_name, _flags) UNIT_TEST(_name, _flags, dm_test) -/* This platform data is needed in tests, so declare it here */ +/* + * struct sandbox_sdl_plat - Platform data for the SDL video driver + * + * This platform data is needed in tests, so declare it here + * + * @xres: Width of display in pixels + * @yres: Height of display in pixels + * @bpix: Log2 of bits per pixel (enum video_log2_bpp) + * @rot: Console rotation (0=normal orientation, 1=90 degrees clockwise, + * 2=upside down, 3=90 degree counterclockwise) + * @vidconsole_drv_name: Name of video console driver (set by tests) + * @font_size: Console font size to select (set by tests) + */ struct sandbox_sdl_plat { int xres; int yres; diff --git a/test/dm/video.c b/test/dm/video.c index 68f5ba44e7..729c31b47d 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -188,7 +188,8 @@ DM_TEST(dm_test_video_ansi, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); * check_vidconsole_output() - Run a text console test * * @uts: Test state - * @rot: Console rotation (0, 90, 180, 270) + * @rot: Console rotation (0=normal orientation, 1=90 degrees clockwise, + * 2=upside down, 3=90 degree counterclockwise) * @wrap_size: Expected size of compressed frame buffer for the wrap test * @scroll_size: Same for the scroll test * @return 0 on success From patchwork Mon May 25 01:48:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297061 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=D1rXOgqS; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg9R1X9Zz9sPF for ; Mon, 25 May 2020 11:53:31 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 191C8808A1; Mon, 25 May 2020 03:51:59 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="D1rXOgqS"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D435E801D8; Mon, 25 May 2020 03:49:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE, T_FILL_THIS_FORM_SHORT,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id D7C84813C5 for ; Mon, 25 May 2020 03:49:23 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x143.google.com with SMTP id 4so16105565ilg.1 for ; Sun, 24 May 2020 18:49:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2zUz6btB0eOuAASRmTaqjYXDmz8o0YIQRFtwWUySRU4=; b=D1rXOgqSy8Ev81yQEMBIePk7IcZvGNgyuGTWiRi8xjkqJdaXLqoFXOtl0FEDFFMs7v dM8l4982IOeicpzracq2CJ7q7I41EfYUTNdA91Lz72u2ZCfYjiNE8BFoEMEqjUhyzFpO 6tX1A3zWooaywG/ttEkWwSRTADuPeJ9SoYldA= 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=2zUz6btB0eOuAASRmTaqjYXDmz8o0YIQRFtwWUySRU4=; b=aWw9PdfsINW4XOcCOrbRjAeGoGikVTm11Vn8OviULXu6U5ZonCaqpwt8GHjJqjf93U IM8ZcqZE6sepOq69KQlUfR8mLYhi+HdIYGD4MX5eR4WBpotO8jL3XpwWxRDvdX4YvWkC Fn4FRmbPsC5wviD38BXYUBai10BxOZtpLxI6eIiV/Wg1Pk/BGJ1OKQjS6Cu58aHAqyPz bQEXxyAsPOJT3fhZqbGVQ4x8LwL0gtk5mCSVhq2G+kwvcM3tRcMn8AHLL4jWA47tq7// 9bqDz/XoXG8YaWcyo3TEm8I5AVongjxEO7lrj/qci1pEfnJIz2ASU8bF9S+VkT/Z0S/G H+4Q== X-Gm-Message-State: AOAM53235EGjd4jRPd7Z+kvnY4QAjjwaXepofHvjHeYz/bmeEdj0bd/0 nR4hdg/Njqh1BiJylczjusMHRebtonEtGg== X-Google-Smtp-Source: ABdhPJx5RcxhYbL/3DoPE+VJKyY4jP81T13RICIijA/bIQAwq69gqsOSEgfHmNxq6M9M6ArUQFF0zg== X-Received: by 2002:a92:8d4c:: with SMTP id s73mr22051158ild.93.1590371362414; Sun, 24 May 2020 18:49:22 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 18/26] video: sandbox: Add support for the copy framebuffer Date: Sun, 24 May 2020 19:48:55 -0600 Message-Id: <20200524194852.v2.18.I43794bcb7a8a65f9ffa7a0821642ba4b602dcf47@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Enable this feature on sandbox by updating the SDL driver to have two framebuffers. Update the video tests to check that the copy framebuffer is kept in sync. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None configs/sandbox_defconfig | 1 + drivers/video/sandbox_sdl.c | 9 +++++- test/dm/video.c | 55 +++++++++++++++++++++++-------------- 3 files changed, 43 insertions(+), 22 deletions(-) diff --git a/configs/sandbox_defconfig b/configs/sandbox_defconfig index 9445d78118..ea567506e5 100644 --- a/configs/sandbox_defconfig +++ b/configs/sandbox_defconfig @@ -215,6 +215,7 @@ CONFIG_DM_USB=y CONFIG_USB_EMUL=y CONFIG_USB_KEYBOARD=y CONFIG_DM_VIDEO=y +CONFIG_VIDEO_COPY=y CONFIG_CONSOLE_ROTATION=y CONFIG_CONSOLE_TRUETYPE=y CONFIG_CONSOLE_TRUETYPE_CANTORAONE=y diff --git a/drivers/video/sandbox_sdl.c b/drivers/video/sandbox_sdl.c index c678e728db..f529a350fb 100644 --- a/drivers/video/sandbox_sdl.c +++ b/drivers/video/sandbox_sdl.c @@ -23,6 +23,7 @@ enum { static int sandbox_sdl_probe(struct udevice *dev) { + struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); struct sandbox_sdl_plat *plat = dev_get_platdata(dev); struct video_priv *uc_priv = dev_get_uclass_priv(dev); struct sandbox_state *state = state_get_current(); @@ -40,6 +41,8 @@ static int sandbox_sdl_probe(struct udevice *dev) uc_priv->rot = plat->rot; uc_priv->vidconsole_drv_name = plat->vidconsole_drv_name; uc_priv->font_size = plat->font_size; + if (IS_ENABLED(CONFIG_VIDEO_COPY)) + uc_plat->copy_base = uc_plat->base - uc_plat->size / 2; return 0; } @@ -55,7 +58,11 @@ static int sandbox_sdl_bind(struct udevice *dev) plat->bpix = dev_read_u32_default(dev, "log2-depth", VIDEO_BPP16); plat->rot = dev_read_u32_default(dev, "rotate", 0); uc_plat->size = plat->xres * plat->yres * (1 << plat->bpix) / 8; - debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); + + /* Allow space for two buffers, the lower one being the copy buffer */ + log_debug("Frame buffer size %x\n", uc_plat->size); + if (IS_ENABLED(CONFIG_VIDEO_COPY)) + uc_plat->size *= 2; return ret; } diff --git a/test/dm/video.c b/test/dm/video.c index 729c31b47d..19f78b6239 100644 --- a/test/dm/video.c +++ b/test/dm/video.c @@ -51,12 +51,18 @@ DM_TEST(dm_test_video_base, DM_TESTF_SCAN_PDATA | DM_TESTF_SCAN_FDT); * size of the compressed data. This provides a pretty good level of * certainty and the resulting tests need only check a single value. * + * If the copy framebuffer is enabled, this compares it to the main framebuffer + * too. + * + * @uts: Test state * @dev: Video device * @return compressed size of the frame buffer, or -ve on error */ -static int compress_frame_buffer(struct udevice *dev) +static int compress_frame_buffer(struct unit_test_state *uts, + struct udevice *dev) { struct video_priv *priv = dev_get_uclass_priv(dev); + struct video_priv *uc_priv = dev_get_uclass_priv(dev); uint destlen; void *dest; int ret; @@ -72,6 +78,13 @@ static int compress_frame_buffer(struct udevice *dev) if (ret) return ret; + /* Check here that the copy frame buffer is working correctly */ + if (IS_ENABLED(CONFIG_VIDEO_COPY)) { + ut_assertf(!memcmp(uc_priv->fb, uc_priv->copy_fb, + uc_priv->fb_size), + "Copy framebuffer does not match fb"); + } + return destlen; } @@ -110,25 +123,25 @@ static int dm_test_video_text(struct unit_test_state *uts) ut_assertok(select_vidconsole(uts, "vidconsole0")); ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); - ut_asserteq(46, compress_frame_buffer(dev)); + ut_asserteq(46, compress_frame_buffer(uts, dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_putc_xy(con, 0, 0, 'a'); - ut_asserteq(79, compress_frame_buffer(dev)); + ut_asserteq(79, compress_frame_buffer(uts, dev)); vidconsole_putc_xy(con, 0, 0, ' '); - ut_asserteq(46, compress_frame_buffer(dev)); + ut_asserteq(46, compress_frame_buffer(uts, dev)); for (i = 0; i < 20; i++) vidconsole_putc_xy(con, VID_TO_POS(i * 8), 0, ' ' + i); - ut_asserteq(273, compress_frame_buffer(dev)); + ut_asserteq(273, compress_frame_buffer(uts, dev)); vidconsole_set_row(con, 0, WHITE); - ut_asserteq(46, compress_frame_buffer(dev)); + ut_asserteq(46, compress_frame_buffer(uts, dev)); for (i = 0; i < 20; i++) vidconsole_putc_xy(con, VID_TO_POS(i * 8), 0, ' ' + i); - ut_asserteq(273, compress_frame_buffer(dev)); + ut_asserteq(273, compress_frame_buffer(uts, dev)); return 0; } @@ -144,7 +157,7 @@ static int dm_test_video_chars(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_put_string(con, test_string); - ut_asserteq(466, compress_frame_buffer(dev)); + ut_asserteq(466, compress_frame_buffer(uts, dev)); return 0; } @@ -164,20 +177,20 @@ static int dm_test_video_ansi(struct unit_test_state *uts) /* reference clear: */ video_clear(con->parent); video_sync(con->parent, false); - ut_asserteq(46, compress_frame_buffer(dev)); + ut_asserteq(46, compress_frame_buffer(uts, dev)); /* test clear escape sequence: [2J */ vidconsole_put_string(con, "A\tB\tC"ANSI_ESC"[2J"); - ut_asserteq(46, compress_frame_buffer(dev)); + ut_asserteq(46, compress_frame_buffer(uts, dev)); /* test set-cursor: [%d;%df */ vidconsole_put_string(con, "abc"ANSI_ESC"[2;2fab"ANSI_ESC"[4;4fcd"); - ut_asserteq(143, compress_frame_buffer(dev)); + ut_asserteq(143, compress_frame_buffer(uts, dev)); /* test colors (30-37 fg color, 40-47 bg color) */ vidconsole_put_string(con, ANSI_ESC"[30;41mfoo"); /* black on red */ vidconsole_put_string(con, ANSI_ESC"[33;44mbar"); /* yellow on blue */ - ut_asserteq(272, compress_frame_buffer(dev)); + ut_asserteq(272, compress_frame_buffer(uts, dev)); return 0; } @@ -208,24 +221,24 @@ static int check_vidconsole_output(struct unit_test_state *uts, int rot, ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); - ut_asserteq(46, compress_frame_buffer(dev)); + ut_asserteq(46, compress_frame_buffer(uts, dev)); /* Check display wrap */ for (i = 0; i < 120; i++) vidconsole_put_char(con, 'A' + i % 50); - ut_asserteq(wrap_size, compress_frame_buffer(dev)); + ut_asserteq(wrap_size, compress_frame_buffer(uts, dev)); /* Check display scrolling */ for (i = 0; i < SCROLL_LINES; i++) { vidconsole_put_char(con, 'A' + i % 50); vidconsole_put_char(con, '\n'); } - ut_asserteq(scroll_size, compress_frame_buffer(dev)); + ut_asserteq(scroll_size, compress_frame_buffer(uts, dev)); /* If we scroll enough, the screen becomes blank again */ for (i = 0; i < SCROLL_LINES; i++) vidconsole_put_char(con, '\n'); - ut_asserteq(46, compress_frame_buffer(dev)); + ut_asserteq(46, compress_frame_buffer(uts, dev)); return 0; } @@ -299,7 +312,7 @@ static int dm_test_video_bmp(struct unit_test_state *uts) ut_assertok(read_file(uts, "tools/logos/denx.bmp", &addr)); ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); - ut_asserteq(1368, compress_frame_buffer(dev)); + ut_asserteq(1368, compress_frame_buffer(uts, dev)); return 0; } @@ -315,7 +328,7 @@ static int dm_test_video_bmp_comp(struct unit_test_state *uts) ut_assertok(read_file(uts, "tools/logos/denx-comp.bmp", &addr)); ut_assertok(video_bmp_display(dev, addr, 0, 0, false)); - ut_asserteq(1368, compress_frame_buffer(dev)); + ut_asserteq(1368, compress_frame_buffer(uts, dev)); return 0; } @@ -330,7 +343,7 @@ static int dm_test_video_truetype(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_put_string(con, test_string); - ut_asserteq(12237, compress_frame_buffer(dev)); + ut_asserteq(12237, compress_frame_buffer(uts, dev)); return 0; } @@ -351,7 +364,7 @@ static int dm_test_video_truetype_scroll(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_put_string(con, test_string); - ut_asserteq(35030, compress_frame_buffer(dev)); + ut_asserteq(35030, compress_frame_buffer(uts, dev)); return 0; } @@ -372,7 +385,7 @@ static int dm_test_video_truetype_bs(struct unit_test_state *uts) ut_assertok(uclass_get_device(UCLASS_VIDEO, 0, &dev)); ut_assertok(uclass_get_device(UCLASS_VIDEO_CONSOLE, 0, &con)); vidconsole_put_string(con, test_string); - ut_asserteq(29018, compress_frame_buffer(dev)); + ut_asserteq(29018, compress_frame_buffer(uts, dev)); return 0; } From patchwork Mon May 25 01:48:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297058 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=Le7kYUwD; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg924bGCz9sPF for ; Mon, 25 May 2020 11:53:10 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 41D0D818F8; Mon, 25 May 2020 03:50:30 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="Le7kYUwD"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id D1C5F81002; Mon, 25 May 2020 03:49:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 870F1801D8 for ; Mon, 25 May 2020 03:49:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x143.google.com with SMTP id j3so16010383ilk.11 for ; Sun, 24 May 2020 18:49:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=BCHGhyhxP/YSMQJefiaxkYO1f+ySh96tiIj8MeI7OVk=; b=Le7kYUwD/gMJoMhKHaKgJH2C2awoUFydqKakxnthkIZtZk0NhS9NAYb9fJ+ihKn+Xs ixJxAaT9WdU9VRMVPzHm10/gFlXepuGqBPoKQkUjL7vMJGWWddzfzQsuyrnA0PCJw+rT 5HQc4Ggv469x+hArJp3I5H+352Gh2N93VxKQM= 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=BCHGhyhxP/YSMQJefiaxkYO1f+ySh96tiIj8MeI7OVk=; b=qOY6g70Z42yPfUdD5SWLdeGp1TswGGBh4sFeDsQlIm4NXLdjdx9lawgfI9h3cNMBeZ WqBNgo+pnBZZXxutOajDVyzBsBWTJAbYOdULyWFXHaLL0UfCk3XNxEh/KUAwYmOXZ2c6 pFmfILwCl89o70XfUjKqi46P7alw2pYh07o6CJ/DLr1uD0q71OjIlsWC5cRcE8zgC15F TS9/bd3OpK1PyHuWhll32VLJ1mhL97UH/3uwQvGccbxDzRx/Tb+LuueZntWH2b4U54bz V6n/7TX0+IfLN3d/3hhQVfHb1EP5B8ZgAZktgcnFMELUeQFFPK+9Szs6BebsaqXFLdEZ UV6Q== X-Gm-Message-State: AOAM533NkRpW6nUHh4i5MprQcEXEXmeTSR0/NEixQlhZQx+N98cKXLvb WJREpJTi3MsWCVUHKNVIUKs7KcqpLeZqKQ== X-Google-Smtp-Source: ABdhPJzXT4y79d3Ct3IRLqZGnR2C/DjqImNL7LNuVcHzyu/wSRxd1ofb/IhVZKFpJFLbtw+bCxI5Gw== X-Received: by 2002:a92:3918:: with SMTP id g24mr23637962ila.139.1590371363160; Sun, 24 May 2020 18:49:23 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:22 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 19/26] video: pci: Set up the copy framebuffer Date: Sun, 24 May 2020 19:48:56 -0600 Message-Id: <20200524194852.v2.19.I6830e2259b28645c0ed29b68bbadf67598c0ed70@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean When using a copy framebuffer we need to tell the video subsystem its address. U-Boot's normally allocated framebuffer is used as the working buffer, but nothing is displayed until it is copied to the copy framebuffer. For this to work the video driver must request that a framebuffer be allocated separately from the hardware framebuffer, so add a check for that. Also add a log category so that logging appears correctly. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/pci/pci_rom.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/drivers/pci/pci_rom.c b/drivers/pci/pci_rom.c index 6a9bc49978..fa29d69e85 100644 --- a/drivers/pci/pci_rom.c +++ b/drivers/pci/pci_rom.c @@ -22,6 +22,8 @@ * Copyright 1997 -- 1999 Martin Mares */ +#define LOG_CATEGORY UCLASS_PCI + #include #include #include @@ -344,7 +346,16 @@ int vbe_setup_video_priv(struct vesa_mode_info *vesa, default: return -EPROTONOSUPPORT; } - plat->base = vesa->phys_base_ptr; + + /* Use double buffering if enabled */ + if (IS_ENABLED(CONFIG_VIDEO_COPY)) { + if (!plat->base) + return log_msg_ret("copy", -ENFILE); + plat->copy_base = vesa->phys_base_ptr; + } else { + plat->base = vesa->phys_base_ptr; + } + log_debug("base = %lx, copy_base = %lx\n", plat->base, plat->copy_base); plat->size = vesa->bytes_per_scanline * vesa->y_resolution; return 0; @@ -372,6 +383,15 @@ int vbe_setup_video(struct udevice *dev, int (*int15_handler)(void)) ret = vbe_setup_video_priv(&mode_info.vesa, uc_priv, plat); if (ret) { + if (ret == -ENFILE) { + /* + * See video-uclass.c for how to set up reserved memory + * in your video driver + */ + log_err("CONFIG_VIDEO_COPY enabled but driver '%s' set up no reserved memory\n", + dev->driver->name); + } + debug("No video mode configured\n"); return ret; } From patchwork Mon May 25 01:48:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297059 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=jtyu+7qE; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg9D58tfz9sPF for ; Mon, 25 May 2020 11:53:20 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 292818190C; Mon, 25 May 2020 03:50:33 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="jtyu+7qE"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 996BF812F8; Mon, 25 May 2020 03:49:37 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd42.google.com (mail-io1-xd42.google.com [IPv6:2607:f8b0:4864:20::d42]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 1F0A4801D6 for ; Mon, 25 May 2020 03:49:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd42.google.com with SMTP id j8so17204043iog.13 for ; Sun, 24 May 2020 18:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ROi0Ud8HfB8I0NpK6UzetmXIpgnS00JozZlsmiTvJYg=; b=jtyu+7qEmYUIhhOx+/wJs5b7jhDwzTnZV/dwn+DNaSLgG4QajbiuHZpYYbE+ywyjk2 5oNy3FPfQAd8p5klzdN5PvZEhKbyUKKzsk3VF9JLd5J0uoxuY10eSnTDlNA2mcbgCnXG goVt5LK38E1p2HzaMbwLece+byjoDZ+7dr7IU= 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=ROi0Ud8HfB8I0NpK6UzetmXIpgnS00JozZlsmiTvJYg=; b=A/zTxxUuwmH4YYPk+yoTQCjjDDxAYW5Dc9dZWEAPTT5k95alf2hRNuN4owFT1TQNBr gnBqw69a9OoL5hKwfiARlZI5CZ3xRFLalC8xCuAeBlvm0V+efeExOeNHuVA77I8xTL4J ZEm55ZTnEKhEP4VUn5JExcIbQT3Ph4JNwlL5+M2XIOePBvVUKxT9KUr37fz2Cw5LwbZ+ NRbO2RiUmOfjOWIzeuwHYlXDZjHXVUpJr/TLwENo9CVLF3El69ELGvHlIz37l5AuEUsw LXgmMXIbv22Dv6ZmfUpTVQWY+FjZLf/OH/f1GNWSXfJASSTS4d4nmOMqqGfKBEc4Pqmg htFA== X-Gm-Message-State: AOAM531Np76HvcA+xGNhxIotvWQr1bXG71XW4vBaTEYKhX8Ve3AK8mn4 T9FGNkgBM+3Nlt2e6MQOGnAibc9XEYyrEA== X-Google-Smtp-Source: ABdhPJzbi75g9u+GeOUjSNLenqGIR+kRl4yMJUBByRbVpfXXnrkfqNgy9/nsCwm2ADFH+YDvLUQnWQ== X-Received: by 2002:a02:a19d:: with SMTP id n29mr3203364jah.85.1590371363899; Sun, 24 May 2020 18:49:23 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:23 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 20/26] x86: fsp: video: Allocate a frame buffer when needed Date: Sun, 24 May 2020 19:48:57 -0600 Message-Id: <20200524194852.v2.20.I924a9e665cb5136a4034703a9360c1b4049c97b7@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean When the copy framebuffer is in use, we must also have the standard U-Boot framebuffer available. Update the FSP driver to support this. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None arch/x86/lib/fsp/fsp_graphics.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/lib/fsp/fsp_graphics.c b/arch/x86/lib/fsp/fsp_graphics.c index 70224c1a48..4eaa4fa6d4 100644 --- a/arch/x86/lib/fsp/fsp_graphics.c +++ b/arch/x86/lib/fsp/fsp_graphics.c @@ -116,6 +116,16 @@ err: return ret; } +static int fsp_video_bind(struct udevice *dev) +{ + struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); + + /* Set the maximum supported resolution */ + plat->size = 2560 * 1600 * 4; + + return 0; +} + static const struct udevice_id fsp_video_ids[] = { { .compatible = "fsp-fb" }, { } @@ -125,7 +135,9 @@ U_BOOT_DRIVER(fsp_video) = { .name = "fsp_video", .id = UCLASS_VIDEO, .of_match = fsp_video_ids, + .bind = fsp_video_bind, .probe = fsp_video_probe, + .flags = DM_FLAG_PRE_RELOC, }; static struct pci_device_id fsp_video_supported[] = { From patchwork Mon May 25 01:48:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297062 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=XfIgOA5u; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg9d2ywGz9sPF for ; Mon, 25 May 2020 11:53:41 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 36BC3813C5; Mon, 25 May 2020 03:52:03 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="XfIgOA5u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 44FE4808A1; Mon, 25 May 2020 03:49:38 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x143.google.com (mail-il1-x143.google.com [IPv6:2607:f8b0:4864:20::143]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id E8CEA813A5 for ; Mon, 25 May 2020 03:49:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x143.google.com with SMTP id m6so16049246ilq.7 for ; Sun, 24 May 2020 18:49:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=gTn2eropA4AKyUMZeXN970cfKasyDbsgbCaNBa9AAgk=; b=XfIgOA5uWr8O9kVxsfGRYzT5rBRS7lkD/YosQiRzsl7n39p33n1N4pP9XlrkHJ/RtA +yEeDAnEPWeWaKuTIGoGPkR7Q82jU9liWOFCbFFDFNF+2fTgaoYD7Wxo2cBWCnLTxbld q+CqHgbaY8RL2X9CFgpMZ5k7wNHr+iOe8vBnk= 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=gTn2eropA4AKyUMZeXN970cfKasyDbsgbCaNBa9AAgk=; b=tUOTH8SKEOlrHQ2+ndrUkOjcAvyNn8TgtEsMcc73u4MaipI/P3R6BqrZLg8P0uYVDN N7r0uNtffWDDLzAgF4ek7x70NgUFPMK64hfC7JfhiCurAIeKT7eqrgczVtB6VMI1NIs6 irEyaI4rQiN/LSEF7bjgDdkQKE5jNo7XBgyhZnropUHX8JkLLKq2XptoDS96BWRL6FtY xpSZGpxhftaKc9tmvZiVZ2E0yY9nP/djQ4wlfGTwDxA5nJ2eDn9RwedVVTl074dp1fvf l6HpzwB/L2fh9DdjFsvU9EFraKLlMqPp/LN9D6IVkNj1PBlZwMuJmlGti2X1ncmzbydY GBfg== X-Gm-Message-State: AOAM530wOtSlKODvKFXHMIFLZGJRk/tyMKtztVQynJ0m4mqESakF7wpF t8IF+zlFBY7ZcAkTAnoIZbOVsYVZ7UaiHg== X-Google-Smtp-Source: ABdhPJxDgx5DjXbVGQQKfKX0w57QxMj/j9JY43rJ0xjedzcFQNQyaHY4Eo9tzy+v8HOLKa4zNjmawQ== X-Received: by 2002:a92:8dd2:: with SMTP id w79mr23236473ill.239.1590371364663; Sun, 24 May 2020 18:49:24 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:24 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 21/26] video: Correctly handle multiple framebuffers Date: Sun, 24 May 2020 19:48:58 -0600 Message-Id: <20200524194852.v2.21.I3472e0c85a061aad040c07d26651a3b80da500f2@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean At present video_bottom is set to the bottom of each framebuffer when it is allocated. This is not correct, since it should hold the bottom of the entire area available for framebuffers. Fix this by adding a private address in the uclass which keeps track of the next available spot for a framebuffer. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/video-uclass.c | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index 4d6f950eab..aa543cb5df 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -46,6 +46,19 @@ */ DECLARE_GLOBAL_DATA_PTR; +/** + * struct video_uc_priv - Information for the video uclass + * + * @video_ptr: Current allocation position of the video framebuffer pointer. + * While binding devices after relocation, this points to the next + * available address to use for a device's framebuffer. It starts at + * gd->video_top and works downwards, running out of space when it hits + * gd->video_bottom. + */ +struct video_uc_priv { + ulong video_ptr; +}; + void video_set_flush_dcache(struct udevice *dev, bool flush) { struct video_priv *priv = dev_get_uclass_priv(dev); @@ -350,12 +363,21 @@ static int video_post_probe(struct udevice *dev) /* Post-relocation, allocate memory for the frame buffer */ static int video_post_bind(struct udevice *dev) { - ulong addr = gd->video_top; + struct video_uc_priv *uc_priv; + ulong addr; ulong size; /* Before relocation there is nothing to do here */ if (!(gd->flags & GD_FLG_RELOC)) return 0; + + /* Set up the video pointer, if this is the first device */ + uc_priv = dev->uclass->priv; + if (!uc_priv->video_ptr) + uc_priv->video_ptr = gd->video_top; + + /* Allocate framebuffer space for this device */ + addr = uc_priv->video_ptr; size = alloc_fb(dev, &addr); if (addr < gd->video_bottom) { /* Device tree node may need the 'u-boot,dm-pre-reloc' or @@ -367,7 +389,7 @@ static int video_post_bind(struct udevice *dev) } debug("%s: Claiming %lx bytes at %lx for video device '%s'\n", __func__, size, addr, dev->name); - gd->video_bottom = addr; + uc_priv->video_ptr = addr; return 0; } @@ -380,6 +402,7 @@ UCLASS_DRIVER(video) = { .pre_probe = video_pre_probe, .post_probe = video_post_probe, .pre_remove = video_pre_remove, + .priv_auto_alloc_size = sizeof(struct video_uc_priv), .per_device_auto_alloc_size = sizeof(struct video_priv), .per_device_platdata_auto_alloc_size = sizeof(struct video_uc_platdata), }; From patchwork Mon May 25 01:48:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297063 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=KFAlri3P; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49Vg9q4HLCz9sPF for ; Mon, 25 May 2020 11:53:51 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4F1C78158A; Mon, 25 May 2020 03:52:07 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="KFAlri3P"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6C12F801D8; Mon, 25 May 2020 03:49:40 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B200D812ED for ; Mon, 25 May 2020 03:49:26 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id p20so3841391iop.11 for ; Sun, 24 May 2020 18:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=d6XvLB6K76u+k9wUurQoxJlk8ARXQmrBVYQ8sZqOSkw=; b=KFAlri3Pp+z1o2deY9BGn2TCjrTBMRW2JWyii9q3tC7TQthnvTMuYQoCdJgSq9Y2bK SQaMXcombFJFz28dMaFoU47dbekP4RkWEC9mXLxrmUvVLHDhp8jSebPDmPqu02McH6MX QhgL3BCy4tRS2JmNHmLqKCP71O1UEn78FFrpE= 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=d6XvLB6K76u+k9wUurQoxJlk8ARXQmrBVYQ8sZqOSkw=; b=U1SAZ/l6eJeGuru4dblAKA/ZOk7IAvIUO99CDKhrdJpx+qxMx3kNntOMXk8sysYSq4 dutz9iT7uv5IAiU1J/DyTdK6B1iblBwRGaiRfiTZe3Fz9WzhotLATRz/PP46wPmK3VS7 LcMqsT3GC76gSM1tpWdW8dYCSueDzDSA8eqRkxSRIZSjDCvCOI7EyJvdJ1Y7KMpSzg9G x8iME3ShjJHJNVQiT7u6dJ2UR7H8eIV7P+hClJ4bwgagNm5k/UdG/kMJMJdbfBjglY+j bwGHba2dYFLXJm4+oivtbm/9UHRNbhij1yzmjEEuSldu0M5vs78auWPZNjjBZY7LsDW0 k+iQ== X-Gm-Message-State: AOAM5317lliRgE3ruSPRDdgu53G2UevHHNbKU1G6M0FaQu5lflASYMHo vfgIbq3PoElt10BcUgSGOe1LIRqB8zytCg== X-Google-Smtp-Source: ABdhPJx+n37Fvatie6WMtwVvDjWFHZ6zj0Vbxh71JzA06iMCVo/h/jb7dsdhBa9AZPrxBYaFyTxBiQ== X-Received: by 2002:a6b:b608:: with SMTP id g8mr6038421iof.177.1590371365380; Sun, 24 May 2020 18:49:25 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 22/26] x86: video: Support copy framebuffer with probed devices Date: Sun, 24 May 2020 19:48:59 -0600 Message-Id: <20200524194852.v2.22.I77e552931a507922710db3d34954e8367239e531@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean For PCI video devices that are not mentioned in the devicetree, U-Boot does not bind a driver before relocation, since PCI is not fully probed at that point. Furthermore it is possible for the video device to be on a secondary bus which is not even scanned. This is fine if the framebuffer is allocated in fixed memory, as it normally is on x86. But when using this as a copy framebuffer, we also need U-Boot to allocate its own cached framebuffer for working in. Since the video driver is never bound before relocation, the framebuffer size is never set and U-Boot does no allocation. Add a new CONFIG option to reserve 16MB of memory for this eventuality. This allows vesa devices to use the copy framebuffer. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None drivers/video/Kconfig | 19 +++++++++++++++++++ drivers/video/video-uclass.c | 5 +++++ 2 files changed, 24 insertions(+) diff --git a/drivers/video/Kconfig b/drivers/video/Kconfig index 1cf63efd48..3e65052359 100644 --- a/drivers/video/Kconfig +++ b/drivers/video/Kconfig @@ -14,6 +14,25 @@ config DM_VIDEO option compiles in the video uclass and routes all LCD/video access through this. +config VIDEO_PCI_DEFAULT_FB_SIZE + hex "Default framebuffer size to use if no drivers request it" + depends on DM_VIDEO + default 0x1000000 if X86 && PCI + default 0 if !(X86 && PCI) + help + Generally, video drivers request the amount of memory they need for + the frame buffer when they are bound, by setting the size field in + struct video_uc_platdata. That memory is then reserved for use after + relocation. But PCI drivers cannot be bound before relocation unless + they are mentioned in the devicetree. + + With this value set appropriately, it is possible for PCI video + devices to have a framebuffer allocated by U-Boot. + + Note: the framebuffer needs to be large enough to store all pixels at + maximum resolution. For example, at 1920 x 1200 with 32 bits per + pixel, 2560 * 1600 * 32 / 8 = 0xfa0000 bytes are needed. + config VIDEO_COPY bool "Enable copying the frame buffer to a hardware copy" depends on DM_VIDEO diff --git a/drivers/video/video-uclass.c b/drivers/video/video-uclass.c index aa543cb5df..b5a03042c2 100644 --- a/drivers/video/video-uclass.c +++ b/drivers/video/video-uclass.c @@ -97,6 +97,11 @@ int video_reserve(ulong *addrp) debug("%s: Reserving %lx bytes at %lx for video device '%s'\n", __func__, size, *addrp, dev->name); } + + /* Allocate space for PCI video devices in case there were not bound */ + if (*addrp == gd->video_top) + *addrp -= CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE; + gd->video_bottom = *addrp; debug("Video frame buffers from %lx to %lx\n", gd->video_bottom, gd->video_top); From patchwork Mon May 25 01:49:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297065 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=M2kcEGdt; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49VgBD2sb3z9sSF for ; Mon, 25 May 2020 11:54:12 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 796068172F; Mon, 25 May 2020 03:52:12 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="M2kcEGdt"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 71DD4810E0; Mon, 25 May 2020 03:49:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x144.google.com (mail-il1-x144.google.com [IPv6:2607:f8b0:4864:20::144]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 7A94881497 for ; Mon, 25 May 2020 03:49:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x144.google.com with SMTP id 18so16098262iln.9 for ; Sun, 24 May 2020 18:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J+esxxl/IuRo6uCuedRbeWKVG9AsK61k94er1AG/2mk=; b=M2kcEGdtHChMCLoBilBuiKZgfb8ditdReMbSQXMtHy8RxeQfVczVRNATENyR7A42AF V7/GhYFKZL54/b13oCbGtbd/SvVovQTKQAotYKCyTxGK20B6qORyNYkEwhTza7fOARcK G8OJ5334FdL7vdedObz9Mud1qR3p0XA1JQnsA= 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=J+esxxl/IuRo6uCuedRbeWKVG9AsK61k94er1AG/2mk=; b=D5wCiQLwBWk0Fy1xtVm2i3d2gK3TU7rIxsllJyBQtzq126ozZEaq9rMP0EmyqwaXBA JSPPw76BzidjoIa9HadChEAs8VFQXAsM1Jj1LzOSAyrPCMX3I0EIlgMjrw4yjA6PEo1D TTEM08eSxCB4D2/+CrM+XCKFZVQMAkPTObFdZF5d4h1STVX+AK9NnGK3+1UYgVQWe1f9 gDYU+529HowkVFSZipYzkAk4oNQc2VGFakiCARCK2Ag6b1QGOx3pKBnB42CwLmbxYKkl sbTHE0VweRxvFyzs6rQyh3HzS+jkOVpvw2ZjDTTwN58GdaDQOV9i9Rhs9jDRMj0As9kw tPTQ== X-Gm-Message-State: AOAM532YiE9Po4mfKBA5BSVnrnkqhIRe5XIqoFgCi+jvjK9QlFxDMwsG V8q+5pbHDw+fE24Iu4WcqOruq32hdMxm5Q== X-Google-Smtp-Source: ABdhPJxTurRVHvWGj3zPcMwxD58p6bCrgO3S+Y4xaEoCGEOaVfNChWB+3ec9TFCeNHSFZBiYTLSi5Q== X-Received: by 2002:a92:58d6:: with SMTP id z83mr22246139ilf.129.1590371366181; Sun, 24 May 2020 18:49:26 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:25 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 23/26] chromebook_samus: Enable the copy framebuffer Date: Sun, 24 May 2020 19:49:00 -0600 Message-Id: <20200524194852.v2.23.I8eb1f86b38972fdc3dc0fa708653b529007f4b86@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update the video driver to support this feature and enable it on samus. Also remove the multi-line scrolling since normal scrolling is fast enough now. With this change, the time taken to print the environment to the display without CONFIG_CONSOLE_SCROLL_LINES is reduced from about 430ms to 12ms. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None configs/chromebook_samus_defconfig | 2 +- drivers/video/broadwell_igd.c | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/configs/chromebook_samus_defconfig b/configs/chromebook_samus_defconfig index fb4d88028c..13058ea7d7 100644 --- a/configs/chromebook_samus_defconfig +++ b/configs/chromebook_samus_defconfig @@ -67,7 +67,7 @@ CONFIG_SPI=y CONFIG_TPM_TIS_LPC=y CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y +CONFIG_VIDEO_COPY=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y CONFIG_FRAMEBUFFER_VESA_MODE_11A=y -CONFIG_CONSOLE_SCROLL_LINES=5 CONFIG_TPM=y diff --git a/drivers/video/broadwell_igd.c b/drivers/video/broadwell_igd.c index 8e8fe9d9b3..df6a761d2d 100644 --- a/drivers/video/broadwell_igd.c +++ b/drivers/video/broadwell_igd.c @@ -664,6 +664,7 @@ static int broadwell_igd_probe(struct udevice *dev) struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); struct video_priv *uc_priv = dev_get_uclass_priv(dev); bool is_broadwell; + ulong fbbase; int ret; if (!ll_boot_init()) { @@ -690,7 +691,8 @@ static int broadwell_igd_probe(struct udevice *dev) return ret; /* Use write-combining for the graphics memory, 256MB */ - ret = mtrr_add_request(MTRR_TYPE_WRCOMB, plat->base, 256 << 20); + fbbase = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base; + ret = mtrr_add_request(MTRR_TYPE_WRCOMB, fbbase, 256 << 20); if (!ret) ret = mtrr_commit(true); if (ret && ret != -ENOSYS) { @@ -752,6 +754,17 @@ static int broadwell_igd_ofdata_to_platdata(struct udevice *dev) return 0; } +static int broadwell_igd_bind(struct udevice *dev) +{ + struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); + + /* Set the maximum supported resolution */ + uc_plat->size = 2560 * 1600 * 4; + log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); + + return 0; +} + static const struct video_ops broadwell_igd_ops = { }; @@ -766,6 +779,7 @@ U_BOOT_DRIVER(broadwell_igd) = { .of_match = broadwell_igd_ids, .ops = &broadwell_igd_ops, .ofdata_to_platdata = broadwell_igd_ofdata_to_platdata, + .bind = broadwell_igd_bind, .probe = broadwell_igd_probe, .priv_auto_alloc_size = sizeof(struct broadwell_igd_priv), .platdata_auto_alloc_size = sizeof(struct broadwell_igd_plat), From patchwork Mon May 25 01:49:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297067 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=MdMylb/z; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49VgBR57Qtz9sPF for ; Mon, 25 May 2020 11:54:23 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id B4FD78179A; Mon, 25 May 2020 03:52:15 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="MdMylb/z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 37D42808A1; Mon, 25 May 2020 03:49:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 41B46812EE for ; Mon, 25 May 2020 03:49:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd44.google.com with SMTP id d7so17275887ioq.5 for ; Sun, 24 May 2020 18:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=E8NPufMrD7wXOTc30PchBHHDF6qZjsQe+NM5uGZsWMg=; b=MdMylb/zqWbChUE2C/Q995DMw/U9YSLYVa+zXBzNjTpfeOoxXgXIoJPgHK5U5ZJE1i 5RVeBhIIn12YFLpEUb97FQNZMZa2jP+NkizjNOjLkr3c2mpH8xBWvX9CrhKoSQsei93D AJZRb6REKotuGJhMR48cO/4qrU8oh/BWbj2PY= 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=E8NPufMrD7wXOTc30PchBHHDF6qZjsQe+NM5uGZsWMg=; b=Tjq7N0HnZtrNwgonRDJrVld5WvB0v0uHlLpr1ndklzupWWAislVPGJo++t6wQ7KyvE ZlTp+eCm2vOkcR10pg2QquV00NxSZNEXtDHmRwZrAndwFqo38KpZAWtwT/O1+NEzmkaR mDw8Ph0RZdkG8w+/lxV8p2sCzERzDGB1Gm2JSFHwbFICCByXPDqVSwuZRalkrT6WZrgm EQf1jnP4SFo7bCTa4yvrV/Q5Sgi3jmIA02HKIMlLKaWAlENW+s6nmjhIeUTOA38Hwr1l PfAh15mAKIcyNKwUBzcAQ4v1NRjW8pIbQUwx5Li8rr2Vt87SOuh5vLhB+2ZA6UE0XtI7 Gk3g== X-Gm-Message-State: AOAM5324YrzhxP/CZOEQRX1TIx30/dM80p/zNyfQnZKzISPOcVCuHHla a7PlJ8CRhWZw7jlUr9YRU773hDaW2faJsg== X-Google-Smtp-Source: ABdhPJx/5WYiXZBi4b8OrG1jnBfM/mJ/HF/XgHVECNL6zRUmX14KmSE6U2XfkuDChZKfJMO/q4Ydhg== X-Received: by 2002:a5d:9604:: with SMTP id w4mr11963435iol.105.1590371366963; Sun, 24 May 2020 18:49:26 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:26 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 24/26] chromebook_link: Enable the copy framebuffer Date: Sun, 24 May 2020 19:49:01 -0600 Message-Id: <20200524194852.v2.24.Ie438b93466294b6fca88cf16c07ef2c3096981e7@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update the video driver to support this feature and enable it on link. Also remove the multi-line scrolling since normal scrolling is fast enough now. With this change, the time taken to print the environment to the display without CONFIG_CONSOLE_SCROLL_LINES is reduced from about 930ms to 29ms. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None configs/chromebook_link_defconfig | 2 +- drivers/video/ivybridge_igd.c | 26 ++++++++++++++++++++------ 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/configs/chromebook_link_defconfig b/configs/chromebook_link_defconfig index de4186cdf2..215185c974 100644 --- a/configs/chromebook_link_defconfig +++ b/configs/chromebook_link_defconfig @@ -62,10 +62,10 @@ CONFIG_SPI=y CONFIG_TPM_TIS_LPC=y CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y +CONFIG_VIDEO_COPY=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y CONFIG_FRAMEBUFFER_VESA_MODE_11A=y CONFIG_VIDEO_IVYBRIDGE_IGD=y -CONFIG_CONSOLE_SCROLL_LINES=5 CONFIG_CMD_DHRYSTONE=y CONFIG_TPM=y # CONFIG_EFI_LOADER is not set diff --git a/drivers/video/ivybridge_igd.c b/drivers/video/ivybridge_igd.c index 4c57e311d1..2587f53ac1 100644 --- a/drivers/video/ivybridge_igd.c +++ b/drivers/video/ivybridge_igd.c @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -722,7 +723,6 @@ static int gma_func0_init(struct udevice *dev) { struct udevice *nbridge; void *gtt_bar; - ulong base; u32 reg32; int ret; int rev; @@ -742,11 +742,6 @@ static int gma_func0_init(struct udevice *dev) reg32 |= PCI_COMMAND_MASTER | PCI_COMMAND_MEMORY | PCI_COMMAND_IO; dm_pci_write_config32(dev, PCI_COMMAND, reg32); - /* Use write-combining for the graphics memory, 256MB */ - base = dm_pci_read_bar32(dev, 2); - mtrr_add_request(MTRR_TYPE_WRCOMB, base, 256 << 20); - mtrr_commit(true); - gtt_bar = (void *)(ulong)dm_pci_read_bar32(dev, 0); debug("GT bar %p\n", gtt_bar); ret = gma_pm_init_pre_vbios(gtt_bar, rev); @@ -758,6 +753,8 @@ static int gma_func0_init(struct udevice *dev) static int bd82x6x_video_probe(struct udevice *dev) { + struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); + ulong fbbase; void *gtt_bar; int ret, rev; @@ -774,6 +771,22 @@ static int bd82x6x_video_probe(struct udevice *dev) if (ret) return ret; + /* Use write-combining for the graphics memory, 256MB */ + fbbase = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base; + mtrr_add_request(MTRR_TYPE_WRCOMB, fbbase, 256 << 20); + mtrr_commit(true); + + return 0; +} + +static int bd82x6x_video_bind(struct udevice *dev) +{ + struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); + + /* Set the maximum supported resolution */ + uc_plat->size = 2560 * 1600 * 4; + log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); + return 0; } @@ -786,5 +799,6 @@ U_BOOT_DRIVER(bd82x6x_video) = { .name = "bd82x6x_video", .id = UCLASS_VIDEO, .of_match = bd82x6x_video_ids, + .bind = bd82x6x_video_bind, .probe = bd82x6x_video_probe, }; From patchwork Mon May 25 01:49:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297068 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=IZT2mi8z; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49VgBf4X6gz9sPF for ; Mon, 25 May 2020 11:54:34 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8374A81861; Mon, 25 May 2020 03:52:18 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="IZT2mi8z"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 98C0C801D8; Mon, 25 May 2020 03:49:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-io1-xd43.google.com (mail-io1-xd43.google.com [IPv6:2607:f8b0:4864:20::d43]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F080F81521 for ; Mon, 25 May 2020 03:49:28 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-io1-xd43.google.com with SMTP id c16so17270809iol.3 for ; Sun, 24 May 2020 18:49:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Zfc0mtcdxtMFz7A+RCZtIfx0qobhmxP4aDSTCle/11E=; b=IZT2mi8zPTZghpYdXesRK0upxjRHBB5S8ZqRA468RCf6IASlTSV/mjM9UeyOzNJFvx xVtQjyJt4mn7eZ8K5r6A0WRuHyI8ri5+CPabpQML3kPUMVt6pWwsC589Q+vYWZ+a9d0M AuSW1W8eD8AtYJp/2Tx6yS0bSVpQrDR7qEAio= 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=Zfc0mtcdxtMFz7A+RCZtIfx0qobhmxP4aDSTCle/11E=; b=mHutnIqHT56cm6Noe40RrBPY2U1pfg8M5NGQTyeNLO4jF9h2UJHLmCS19QbR6U2M1v +QfGJgACO3hJvbWkjLLhEK9IQLgf9OStBE0R56b9EnNb8k5zwzXWIJ1kk4nSlvZsenbZ QrxQADgKXRIilYROK7oiRCQLd0NbXCQg6Ux9B89wRbTn13yBLtwak0yfwn9c/ITQFfPH YqfHDU/4firnYjrK512hAX1ytzEE3LxdASbHaOdRrtFJOB3kEmMJCXKRJm7QlJtVrnny DnYtDimhUiJA/fGgnhHO/ypOSdA4gh5gf/0VvnLkrCE0ZLOenxNZ5UPer88fM7hkJJhJ qr4A== X-Gm-Message-State: AOAM532mwCKdtjvGQJCKC6kcPwo9GokUwDHYdK3rgdxuQHhq4PkQQmwb AcfwX3SGGs4edEZh9JbI0OO+4Kklg4Q3fw== X-Google-Smtp-Source: ABdhPJwwZRlzEvmFWc/dHUrdSOHGh+txR6RiK4wdFsh99dyyFGbnnxqppuL71mroBKtG2aNRhNLpiA== X-Received: by 2002:a05:6602:1591:: with SMTP id e17mr9694608iow.65.1590371367706; Sun, 24 May 2020 18:49:27 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:27 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 25/26] minnowmax: Enable the copy framebuffer Date: Sun, 24 May 2020 19:49:02 -0600 Message-Id: <20200524194852.v2.25.I4c7569b67d52db471b3490c7dac21e1dc10dcd97@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean Update the video driver to support this feature and enable it on minnowmax to speed up the display. With this change, the time taken to print the environment to the display without CONFIG_CONSOLE_SCROLL_LINES is reduced from over 13 seconds to 300ms, at 1280x1024. Signed-off-by: Simon Glass Reviewed-by: Anatolij Gustschin --- Changes in v2: None configs/minnowmax_defconfig | 2 +- drivers/video/vesa.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 2 deletions(-) diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig index 127fd5d53e..19528c4641 100644 --- a/configs/minnowmax_defconfig +++ b/configs/minnowmax_defconfig @@ -59,6 +59,6 @@ CONFIG_RTL8169=y CONFIG_SPI=y CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y +CONFIG_VIDEO_COPY=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y CONFIG_FRAMEBUFFER_VESA_MODE_11B=y -CONFIG_CONSOLE_SCROLL_LINES=5 diff --git a/drivers/video/vesa.c b/drivers/video/vesa.c index 6c03611e80..9656326bdb 100644 --- a/drivers/video/vesa.c +++ b/drivers/video/vesa.c @@ -5,12 +5,39 @@ #include #include +#include #include #include +#include +#include static int vesa_video_probe(struct udevice *dev) { - return vbe_setup_video(dev, NULL); + struct video_uc_platdata *plat = dev_get_uclass_platdata(dev); + ulong fbbase; + int ret; + + ret = vbe_setup_video(dev, NULL); + if (ret) + return log_ret(ret); + + /* Use write-combining for the graphics memory, 256MB */ + fbbase = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base; + mtrr_add_request(MTRR_TYPE_WRCOMB, fbbase, 256 << 20); + mtrr_commit(true); + + return 0; +} + +static int vesa_video_bind(struct udevice *dev) +{ + struct video_uc_platdata *uc_plat = dev_get_uclass_platdata(dev); + + /* Set the maximum supported resolution */ + uc_plat->size = 2560 * 1600 * 4; + log_debug("%s: Frame buffer size %x\n", __func__, uc_plat->size); + + return 0; } static const struct udevice_id vesa_video_ids[] = { @@ -22,6 +49,7 @@ U_BOOT_DRIVER(vesa_video) = { .name = "vesa_video", .id = UCLASS_VIDEO, .of_match = vesa_video_ids, + .bind = vesa_video_bind, .probe = vesa_video_probe, }; From patchwork Mon May 25 01:49:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297064 X-Patchwork-Delegate: bmeng.cn@gmail.com 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=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=TsJKKwbU; dkim-atps=neutral Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 49VgB21H3Fz9sPF for ; Mon, 25 May 2020 11:54:01 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 20C4A8160C; Mon, 25 May 2020 03:52:10 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="TsJKKwbU"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B093481002; Mon, 25 May 2020 03:49:41 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,SPF_HELO_NONE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from mail-il1-x133.google.com (mail-il1-x133.google.com [IPv6:2607:f8b0:4864:20::133]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id B7F68812E7 for ; Mon, 25 May 2020 03:49:29 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=sjg@chromium.org Received: by mail-il1-x133.google.com with SMTP id b15so16041408ilq.12 for ; Sun, 24 May 2020 18:49:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=yRsRPtxbCoc7SWKPbGFW3G1s3ZFS2v9MWy4w5gjuskM=; b=TsJKKwbUznzFyeOQcOorCMwAoAgc3IhY7OIefuzi0EP8kiohIqwOmCq9dCRnGUR4N5 JmdX+H6cupZgBwp4VlPAU1OduaERWaHu4ZOVHcx+YJ1eGc4RShOH7VSzbNMpkYJVBF82 xn6mcYeq4VX5r2AI0Lo12mlD94+Yosdq/QIlM= 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=yRsRPtxbCoc7SWKPbGFW3G1s3ZFS2v9MWy4w5gjuskM=; b=lGj+s1vAOHXQ6VQhxlYln47VqjiG2WhCNoA9I9osgLiw3W6gQO4URD/RDlTjx8JHFQ tbSgoNcO8ubaSM3jQ/VmbdoXK3z9h3DTZsFS4bCDUOhKdc0tHdpAYanaesaK1F1UxkJD wBPoffkB42g70g0KM8+XL1qPU/j4h/T+PGoDFpPjFX/yyJMosgy2FhjkyleXrSHVxFbh 3QTpFvsYJM79ID2DzNPwOIS2vHWHq5bt4bx4nLC+Ugb0hywbcu9lA9dUf/DNEjWXzXQW u/jfoHduqvzwnmgI3gEoM2dbLQ6mA0zotsJAsNmExLdXZ9yiTJktKOwT0reVtNfP75M8 iasA== X-Gm-Message-State: AOAM533nKT7GlFlXpDuMjk1GtC1rX4f7p4ix/yO0zE9MvMgH2MmYzkbm yd6JRF1+jyT3/RXLHPDdEICj8T1Ta44d+A== X-Google-Smtp-Source: ABdhPJzTnVZzx/FClzt58f/LSW+SgTOmy5ejd4vlYf0faSf/BRJl8G+ZyjxZgmBvLe5oIgDSKkGTrg== X-Received: by 2002:a92:5a4a:: with SMTP id o71mr22152965ilb.217.1590371368425; Sun, 24 May 2020 18:49:28 -0700 (PDT) Received: from localhost.localdomain (c-73-14-175-90.hsd1.co.comcast.net. [73.14.175.90]) by smtp.gmail.com with ESMTPSA id s7sm6822965ioc.37.2020.05.24.18.49.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:28 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass Subject: [PATCH v2 26/26] x86: minnowmax: Drop screen resolution to 1024x768 Date: Sun, 24 May 2020 19:49:03 -0600 Message-Id: <20200524194852.v2.26.Ia291ebfeddb9d936914febb00854daa5d0ec2e26@changeid> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog In-Reply-To: <20200525014904.115621-1-sjg@chromium.org> References: <20200525014904.115621-1-sjg@chromium.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.30rc1 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.102.2 at phobos.denx.de X-Virus-Status: Clean This seems like a more reasonable resolution for this board, since it is quite slow. It also allows it to work with a 5" LCD display in my lab. Signed-off-by: Simon Glass --- Changes in v2: None configs/minnowmax_defconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configs/minnowmax_defconfig b/configs/minnowmax_defconfig index 19528c4641..cce9ee6fea 100644 --- a/configs/minnowmax_defconfig +++ b/configs/minnowmax_defconfig @@ -61,4 +61,4 @@ CONFIG_USB_STORAGE=y CONFIG_USB_KEYBOARD=y CONFIG_VIDEO_COPY=y CONFIG_FRAMEBUFFER_SET_VESA_MODE=y -CONFIG_FRAMEBUFFER_VESA_MODE_11B=y +CONFIG_FRAMEBUFFER_VESA_MODE_118=y