All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@openbsd.org>
To: u-boot@lists.denx.de
Cc: Mark Kettenis <kettenis@openbsd.org>,
	Anatolij Gustschin <agust@denx.de>,
	Heinrich Schuchardt <xypron.glpk@gmx.de>,
	Alexander Graf <agraf@csgraf.de>
Subject: [PATCH v2 2/4] efi_loader: GOP: Add 30bpp support
Date: Sat, 25 Sep 2021 22:47:37 +0200	[thread overview]
Message-ID: <20210925204740.52468-3-kettenis@openbsd.org> (raw)
In-Reply-To: <20210925204740.52468-1-kettenis@openbsd.org>

Provide correct framebuffer information for 30bpp modes.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
---
 lib/efi_loader/efi_gop.c | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c
index 1206b2d7a2..5033a2c9e3 100644
--- a/lib/efi_loader/efi_gop.c
+++ b/lib/efi_loader/efi_gop.c
@@ -432,7 +432,7 @@ efi_status_t EFIAPI gop_blt(struct efi_gop *this, struct efi_gop_pixel *buffer,
 efi_status_t efi_gop_register(void)
 {
 	struct efi_gop_obj *gopobj;
-	u32 bpix, col, row;
+	u32 bpix, format, col, row;
 	u64 fb_base, fb_size;
 	void *fb;
 	efi_status_t ret;
@@ -449,6 +449,7 @@ efi_status_t efi_gop_register(void)
 
 	priv = dev_get_uclass_priv(vdev);
 	bpix = priv->bpix;
+	format = priv->format;
 	col = video_get_xsize(vdev);
 	row = video_get_ysize(vdev);
 	fb_base = (uintptr_t)priv->fb;
@@ -458,6 +459,7 @@ efi_status_t efi_gop_register(void)
 	int line_len;
 
 	bpix = panel_info.vl_bpix;
+	format = VIDEO_UNKNOWN;
 	col = panel_info.vl_col;
 	row = panel_info.vl_row;
 	fb_base = gd->fb_base;
@@ -517,7 +519,15 @@ efi_status_t efi_gop_register(void)
 	if (bpix == LCD_COLOR32)
 #endif
 	{
-		gopobj->info.pixel_format = EFI_GOT_BGRA8;
+		if (format == VIDEO_X2R10G10B10) {
+			gopobj->info.pixel_format = EFI_GOT_BITMASK;
+			gopobj->info.pixel_bitmask[0] = 0x3ff00000; /* red */
+			gopobj->info.pixel_bitmask[1] = 0x000ffc00; /* green */
+			gopobj->info.pixel_bitmask[2] = 0x000003ff; /* blue */
+			gopobj->info.pixel_bitmask[3] = 0xc0000000; /* reserved */
+		} else {
+			gopobj->info.pixel_format = EFI_GOT_BGRA8;
+		}
 	} else {
 		gopobj->info.pixel_format = EFI_GOT_BITMASK;
 		gopobj->info.pixel_bitmask[0] = 0xf800; /* red */
-- 
2.33.0


  parent reply	other threads:[~2021-09-25 20:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-25 20:47 [PATCH v2 0/4] 30bpp framebuffer support Mark Kettenis
2021-09-25 20:47 ` [PATCH v2 1/4] video: Add 30bpp support Mark Kettenis
2021-09-25 20:47 ` Mark Kettenis [this message]
2021-09-25 20:47 ` [PATCH v2 3/4] video: simplefb: " Mark Kettenis
2021-09-25 20:47 ` [PATCH v2 4/4] efi_loader: GOP: Fix 30bpp block transfer support Mark Kettenis
2021-09-26  6:51   ` Heinrich Schuchardt
2021-10-12  7:24 ` [PATCH v2 0/4] 30bpp framebuffer support Anatolij Gustschin

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=20210925204740.52468-3-kettenis@openbsd.org \
    --to=kettenis@openbsd.org \
    --cc=agraf@csgraf.de \
    --cc=agust@denx.de \
    --cc=u-boot@lists.denx.de \
    --cc=xypron.glpk@gmx.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.