diff mbox series

[3/3] video: simplefb: Add 30bpp support

Message ID 20210916130117.20894-4-kettenis@openbsd.org
State Superseded
Delegated to: Anatolij Gustschin
Headers show
Series 30bpp framebuffer support | expand

Commit Message

Mark Kettenis Sept. 16, 2021, 1:01 p.m. UTC
Recognize the canonical format strings for framebuffers in
30bpp mode.

Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
---
 drivers/video/simplefb.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Simon Glass Sept. 25, 2021, 1:41 p.m. UTC | #1
On Thu, 16 Sept 2021 at 07:02, Mark Kettenis <kettenis@openbsd.org> wrote:
>
> Recognize the canonical format strings for framebuffers in
> 30bpp mode.
>
> Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
> ---
>  drivers/video/simplefb.c | 3 +++
>  1 file changed, 3 insertions(+)
>
> diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c
> index fd58426cf5..7e1cc4560f 100644
> --- a/drivers/video/simplefb.c
> +++ b/drivers/video/simplefb.c
> @@ -52,6 +52,9 @@ static int simple_video_probe(struct udevice *dev)
>                 uc_priv->bpix = VIDEO_BPP16;
>         } else if (strcmp(format, "a8b8g8r8") == 0) {
>                 uc_priv->bpix = VIDEO_BPP32;
> +       } else if (strcmp(format, "a2r10g10b10") == 0 ||
> +                  strcmp(format, "x2r10g10b10") == 0) {
> +               uc_priv->bpix = VIDEO_BPP30;
>         } else {
>                 printf("%s: invalid format: %s\n", __func__, format);
>                 return -EINVAL;
> --
> 2.33.0
>

Reviewed-by: Simon Glass <sjg@chromium.org>
Tested on: Macbook Air M1
Tested-by: Simon Glass <sjg@chromium.org>
diff mbox series

Patch

diff --git a/drivers/video/simplefb.c b/drivers/video/simplefb.c
index fd58426cf5..7e1cc4560f 100644
--- a/drivers/video/simplefb.c
+++ b/drivers/video/simplefb.c
@@ -52,6 +52,9 @@  static int simple_video_probe(struct udevice *dev)
 		uc_priv->bpix = VIDEO_BPP16;
 	} else if (strcmp(format, "a8b8g8r8") == 0) {
 		uc_priv->bpix = VIDEO_BPP32;
+	} else if (strcmp(format, "a2r10g10b10") == 0 ||
+		   strcmp(format, "x2r10g10b10") == 0) {
+		uc_priv->bpix = VIDEO_BPP30;
 	} else {
 		printf("%s: invalid format: %s\n", __func__, format);
 		return -EINVAL;