openwrt/target/linux/bcm27xx/patches-6.6/950-1224-drm-rp1-rp1-vec-Add-DRM_FORMAT_ARGB8888-and-DRM_FORM.patch

49 lines
1.5 KiB
Diff
Raw Permalink Normal View History

From 29f7f01091f9aaa6b0c45f5c2e3db1792d381e9d Mon Sep 17 00:00:00 2001
From: Jan Kehren <jan.kehren@emteria.com>
Date: Tue, 20 Aug 2024 08:16:06 +0000
Subject: [PATCH 1224/1350] drm: rp1: rp1-vec: Add DRM_FORMAT_ARGB8888 and
DRM_FORMAT_ABGR8888
Android requires this.
As the underlying hardware doesn't support alpha blending,
we ignore the alpha value.
Signed-off-by: Jan Kehren <jan.kehren@emteria.com>
---
drivers/gpu/drm/rp1/rp1-vec/rp1_vec.c | 2 ++
drivers/gpu/drm/rp1/rp1-vec/rp1_vec_hw.c | 12 ++++++++++++
2 files changed, 14 insertions(+)
--- a/drivers/gpu/drm/rp1/rp1-vec/rp1_vec.c
+++ b/drivers/gpu/drm/rp1/rp1-vec/rp1_vec.c
@@ -420,6 +420,8 @@ static const struct drm_mode_config_func
static const u32 rp1vec_formats[] = {
DRM_FORMAT_XRGB8888,
DRM_FORMAT_XBGR8888,
+ DRM_FORMAT_ARGB8888,
+ DRM_FORMAT_ABGR8888,
DRM_FORMAT_RGB888,
DRM_FORMAT_BGR888,
DRM_FORMAT_RGB565
--- a/drivers/gpu/drm/rp1/rp1-vec/rp1_vec_hw.c
+++ b/drivers/gpu/drm/rp1/rp1-vec/rp1_vec_hw.c
@@ -63,6 +63,18 @@ static const struct rp1vec_ipixfmt my_fo
.rgbsz = BITS(VEC_RGBSZ_BYTES_PER_PIXEL_MINUS1, 3),
},
{
+ .format = DRM_FORMAT_ARGB8888,
+ .mask = MASK_RGB(0x3fc, 0x3fc, 0x3fc),
+ .shift = SHIFT_RGB(23, 15, 7),
+ .rgbsz = BITS(VEC_RGBSZ_BYTES_PER_PIXEL_MINUS1, 3),
+ },
+ {
+ .format = DRM_FORMAT_ABGR8888,
+ .mask = MASK_RGB(0x3fc, 0x3fc, 0x3fc),
+ .shift = SHIFT_RGB(7, 15, 23),
+ .rgbsz = BITS(VEC_RGBSZ_BYTES_PER_PIXEL_MINUS1, 3),
+ },
+ {
.format = DRM_FORMAT_RGB888,
.mask = MASK_RGB(0x3fc, 0x3fc, 0x3fc),
.shift = SHIFT_RGB(23, 15, 7),