All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Glass <sjg@chromium.org>
To: u-boot@lists.denx.de
Subject: [PATCH v2 24/26] chromebook_link: Enable the copy framebuffer
Date: Sun, 24 May 2020 19:49:01 -0600	[thread overview]
Message-ID: <20200524194852.v2.24.Ie438b93466294b6fca88cf16c07ef2c3096981e7@changeid> (raw)
In-Reply-To: <20200525014904.115621-1-sjg@chromium.org>

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 <sjg@chromium.org>
Reviewed-by: Anatolij Gustschin <agust@denx.de>
---

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 <log.h>
 #include <pci_rom.h>
 #include <vbe.h>
+#include <video.h>
 #include <asm/intel_regs.h>
 #include <asm/io.h>
 #include <asm/mtrr.h>
@@ -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,
 };
-- 
2.27.0.rc0.183.gde8f92d652-goog

  parent reply	other threads:[~2020-05-25  1:49 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-25  1:48 [PATCH v2 00/26] x86: video: Speed up the framebuffer Simon Glass
2020-05-25  1:48 ` [PATCH v2 01/26] x86: fsp: Reinit the FPU after FSP meminit Simon Glass
2020-05-25  1:48 ` [PATCH v2 02/26] console: Add a way to output to serial only Simon Glass
2020-05-25  1:48 ` [PATCH v2 03/26] video: Show an error when a vidconsole function fails Simon Glass
2020-05-25  1:48 ` [PATCH v2 04/26] sandbox: video: Allow selection of rotated console Simon Glass
2020-05-25  1:48 ` [PATCH v2 05/26] video: Split out expression parts into variables Simon Glass
2020-05-25  1:48 ` [PATCH v2 06/26] video: Adjust rotated console to start at right edge Simon Glass
2020-05-25  1:48 ` [PATCH v2 07/26] video: Drop unnecessary #ifdef around vid_console_color() Simon Glass
2020-05-25  1:48 ` [PATCH v2 08/26] video: Add a comment for struct video_uc_platdata Simon Glass
2020-05-25  1:48 ` [PATCH v2 09/26] video: Add support for copying to a hardware framebuffer Simon Glass
2020-05-25  1:48 ` [PATCH v2 10/26] video: Set up the copy framebuffer when enabled Simon Glass
2020-05-25  1:48 ` [PATCH v2 11/26] video: Clear the copy framebuffer when clearing the screen Simon Glass
2020-05-25  1:48 ` [PATCH v2 12/26] video: Add helpers for vidconsole for the copy framebuffer Simon Glass
2020-05-25  1:48 ` [PATCH v2 13/26] video: Update normal console to support copy buffer Simon Glass
2020-05-25  1:48 ` [PATCH v2 14/26] video: Update truetype " Simon Glass
2020-05-25  1:48 ` [PATCH v2 15/26] video: Update rotated " Simon Glass
2020-05-25  1:48 ` [PATCH v2 16/26] video: Update the copy framebuffer when writing bitmaps Simon Glass
2020-05-25  1:48 ` [PATCH v2 17/26] video: Add comments to struct sandbox_sdl_plat Simon Glass
2020-05-25  1:48 ` [PATCH v2 18/26] video: sandbox: Add support for the copy framebuffer Simon Glass
2020-05-25  1:48 ` [PATCH v2 19/26] video: pci: Set up " Simon Glass
2020-05-25  1:48 ` [PATCH v2 20/26] x86: fsp: video: Allocate a frame buffer when needed Simon Glass
2020-05-25  1:48 ` [PATCH v2 21/26] video: Correctly handle multiple framebuffers Simon Glass
2020-05-25  1:48 ` [PATCH v2 22/26] x86: video: Support copy framebuffer with probed devices Simon Glass
2020-05-25  1:49 ` [PATCH v2 23/26] chromebook_samus: Enable the copy framebuffer Simon Glass
2020-05-25  1:49 ` Simon Glass [this message]
2020-05-25  1:49 ` [PATCH v2 25/26] minnowmax: " Simon Glass
2020-05-25  1:49 ` [PATCH v2 26/26] x86: minnowmax: Drop screen resolution to 1024x768 Simon Glass

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200524194852.v2.24.Ie438b93466294b6fca88cf16c07ef2c3096981e7@changeid \
    --to=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.