From patchwork Mon May 25 01:48:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 1297040 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=JeUxhkGC; 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 49Vg4s0jGgz9sPF for ; Mon, 25 May 2020 11:49:30 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id AAE82812EC; 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=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="JeUxhkGC"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 97CCC801D6; Mon, 25 May 2020 03:49:13 +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 117DB801D6 for ; Mon, 25 May 2020 03:49:09 +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 a14so16083637ilk.2 for ; Sun, 24 May 2020 18:49:09 -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:mime-version :content-transfer-encoding; bh=YAqLj//yECCtZ21YGtEZGjBJi0Ivvral6/CwkX7rZgA=; b=JeUxhkGCNQst+A46yGpIaftlKMUEL1bIZwDlqF0Y4ikbxML9hYwyZ+2JB6W//bIjHq B3OwvccyO/nH9YQ054Ag26loQeeGVMHwgRuuxZMGU7ITf8IDXmzXoM4R6fXAHsAhR3af 2roFYjlyG3Swni5Iid+8MtqUb0Tf82ou+/2r0= 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:mime-version :content-transfer-encoding; bh=YAqLj//yECCtZ21YGtEZGjBJi0Ivvral6/CwkX7rZgA=; b=QnxeqUHI+dN0OUReMH/Rqscq+VAe3tl9sAGGjP1LCEpC14xJ+sZIddQiO3qWKN1H33 tbXkZ3XJAhvrWNAAurM5VUDJF5TPDPtKBeuMUQQ6UA31lPkIo+LGBCxIHamzHoHPvDDJ DhUM/DtyRHHuci+0vPl00naoLjGcN5kIhAut8uaeZdKY15BkcYLtLDYZVWdIiFMXkCsF /Qzfhb/PQ4tDwkT++p5p8p0GhLLO+zbJMYaNwh4uf3T4fyv44lW93vGpW3v7+kVo2TrI Bl5IenZgEsedFu8Ux88iGuYVloxWrjETOaHPpmWCFPXdt76NDBdc2WsULPWWtVN2uUL/ LsKQ== X-Gm-Message-State: AOAM530mGw5eAmrplfnw8jKxA0p1NzRe+4ZjzYK2aECFujkaD70YY0Zj 2DhXvA4xQvDkejSEwbJIf6C3Xf+2JoojIA== X-Google-Smtp-Source: ABdhPJzI249vgl8yiLN3Alzh/WVh0uhsHnbI2r6ku4v6v0PxASKSkdsrTT2GSW7OuQoyEhDAU8raGw== X-Received: by 2002:a92:6b10:: with SMTP id g16mr22757771ilc.29.1590371348394; Sun, 24 May 2020 18:49:08 -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.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 May 2020 18:49:07 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Cc: Bin Meng , Simon Glass , Anatolij Gustschin Subject: [PATCH v2 00/26] x86: video: Speed up the framebuffer Date: Sun, 24 May 2020 19:48:37 -0600 Message-Id: <20200525014904.115621-1-sjg@chromium.org> X-Mailer: git-send-email 2.27.0.rc0.183.gde8f92d652-goog 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. This series adds a new feature which supports copying modified parts of the frame buffer to the uncached hardware buffer. This speeds up scrolling dramatically on x86 so the extra complexity cost seems worth it. In an extreme case, the time to print the environment on minnowboard with 1280x1024 and CONFIG_CONSOLE_SCROLL_LINES disabled is reduced significantly, from 13 seconds to 300ms. Changes in v2: - Simplify return sequence in vidconsole_memmove() since there is no logging Simon Glass (26): x86: fsp: Reinit the FPU after FSP meminit console: Add a way to output to serial only video: Show an error when a vidconsole function fails sandbox: video: Allow selection of rotated console video: Split out expression parts into variables video: Adjust rotated console to start at right edge video: Drop unnecessary #ifdef around vid_console_color() video: Add a comment for struct video_uc_platdata video: Add support for copying to a hardware framebuffer video: Set up the copy framebuffer when enabled video: Clear the copy framebuffer when clearing the screen video: Add helpers for vidconsole for the copy framebuffer video: Update normal console to support copy buffer video: Update truetype console to support copy buffer video: Update rotated console to support copy buffer video: Update the copy framebuffer when writing bitmaps video: Add comments to struct sandbox_sdl_plat video: sandbox: Add support for the copy framebuffer video: pci: Set up the copy framebuffer x86: fsp: video: Allocate a frame buffer when needed video: Correctly handle multiple framebuffers x86: video: Support copy framebuffer with probed devices chromebook_samus: Enable the copy framebuffer chromebook_link: Enable the copy framebuffer minnowmax: Enable the copy framebuffer x86: minnowmax: Drop screen resolution to 1024x768 arch/x86/cpu/i386/cpu.c | 5 ++ arch/x86/include/asm/u-boot-x86.h | 8 +++ arch/x86/lib/fsp/fsp_graphics.c | 12 ++++ arch/x86/lib/fsp2/fsp_meminit.c | 1 + common/console.c | 28 ++++++-- configs/chromebook_link_defconfig | 2 +- configs/chromebook_samus_defconfig | 2 +- configs/minnowmax_defconfig | 4 +- configs/sandbox_defconfig | 1 + drivers/pci/pci_rom.c | 22 +++++- drivers/video/Kconfig | 31 +++++++++ drivers/video/broadwell_igd.c | 16 ++++- drivers/video/console_normal.c | 26 +++++++- drivers/video/console_rotate.c | 103 ++++++++++++++++++++--------- drivers/video/console_truetype.c | 43 ++++++++---- drivers/video/ivybridge_igd.c | 26 ++++++-- drivers/video/sandbox_sdl.c | 10 ++- drivers/video/vesa.c | 30 ++++++++- drivers/video/vidconsole-uclass.c | 40 ++++++++++- drivers/video/video-uclass.c | 93 +++++++++++++++++++++++++- drivers/video/video_bmp.c | 16 ++++- include/console.h | 13 ++++ include/dm/test.h | 14 +++- include/video.h | 41 ++++++++++++ include/video_console.h | 51 +++++++++++++- test/dm/video.c | 60 ++++++++++------- 26 files changed, 596 insertions(+), 102 deletions(-)