From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>, Bin Meng <bmeng.cn@gmail.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Ilias Apalodimas <ilias.apalodimas@linaro.org>,
Jiaxun Yang <jiaxun.yang@flygoat.com>
Subject: [PATCH v2 2/2] efi: gop: Mark pixel_format as BLTONLY if we have sync hook
Date: Fri, 24 May 2024 14:02:40 +0100 [thread overview]
Message-ID: <20240524-virtio_gpu-v2-2-b198c35b1fd2@flygoat.com> (raw)
In-Reply-To: <20240524-virtio_gpu-v2-0-b198c35b1fd2@flygoat.com>
If a video device has a video_sync hook, it means some software
intervene is required to scanout framebuffer up on change.
That means EFI application can't just use it as raw framebuffer,
it should call BLT operation to let U-Boot help with scanout.
Mark pixel format as BLTONLY as per UEFI spec to reflect this
nature.
Signed-off-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
---
v2:
- Remove an unused variable
---
include/efi_api.h | 1 +
lib/efi_loader/efi_gop.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/efi_api.h b/include/efi_api.h
index ab40b1b5ddf6..3eaefb322878 100644
--- a/include/efi_api.h
+++ b/include/efi_api.h
@@ -1399,6 +1399,7 @@ struct efi_hii_config_access_protocol {
#define EFI_GOT_RGBA8 0
#define EFI_GOT_BGRA8 1
#define EFI_GOT_BITMASK 2
+#define EFI_GOT_BLTONLY 3
struct efi_gop_mode_info {
u32 version;
diff --git a/lib/efi_loader/efi_gop.c b/lib/efi_loader/efi_gop.c
index 41e12fa72460..c9244376c09a 100644
--- a/lib/efi_loader/efi_gop.c
+++ b/lib/efi_loader/efi_gop.c
@@ -471,6 +471,7 @@ efi_status_t efi_gop_register(void)
struct udevice *vdev;
struct video_priv *priv;
struct video_uc_plat *plat;
+ struct video_ops *ops;
/* We only support a single video output device for now */
if (uclass_first_device_err(UCLASS_VIDEO, &vdev)) {
@@ -485,6 +486,7 @@ efi_status_t efi_gop_register(void)
row = video_get_ysize(vdev);
plat = dev_get_uclass_plat(vdev);
+ ops = video_get_ops(vdev);
fb_base = IS_ENABLED(CONFIG_VIDEO_COPY) ? plat->copy_base : plat->base;
fb_size = plat->size;
@@ -529,7 +531,11 @@ efi_status_t efi_gop_register(void)
gopobj->info.version = 0;
gopobj->info.width = col;
gopobj->info.height = row;
- if (bpix == VIDEO_BPP32)
+
+ if (ops && ops->video_sync) {
+ /* Applications can't really use it as framebuffer */
+ gopobj->info.pixel_format = EFI_GOT_BLTONLY;
+ } else if (bpix == VIDEO_BPP32)
{
if (format == VIDEO_X2R10G10B10) {
gopobj->info.pixel_format = EFI_GOT_BITMASK;
--
2.43.0
prev parent reply other threads:[~2024-05-24 13:03 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-24 13:02 [PATCH v2 0/2] virtio_gpu driver and relevant fix Jiaxun Yang
2024-05-24 13:02 ` [PATCH v2 1/2] virtio: New virtio_gpu driver Jiaxun Yang
2024-07-17 14:33 ` Jiaxun Yang
2024-07-19 15:05 ` Simon Glass
2024-07-20 6:57 ` Jiaxun Yang
2024-07-21 10:08 ` Simon Glass
2024-07-21 10:41 ` Jiaxun Yang
2024-05-24 13:02 ` Jiaxun Yang [this message]
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=20240524-virtio_gpu-v2-2-b198c35b1fd2@flygoat.com \
--to=jiaxun.yang@flygoat.com \
--cc=bmeng.cn@gmail.com \
--cc=ilias.apalodimas@linaro.org \
--cc=trini@konsulko.com \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox