All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] drm/msm/dpu: Add support for AR30 format
@ 2023-03-21  2:58 Leonard Lausen
  2023-03-22 13:15 ` Leonard Lausen
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Leonard Lausen @ 2023-03-21  2:58 UTC (permalink / raw)
  To: robdclark, quic_abhinavk, dmitry.baryshkov, linux-arm-msm, freedreno

Commit da7716a249b699978fb5 ("drm/msm/dpu: Add support for XR30 format") enabled
support for the 10-bit XR30 color format but missed enabling support for the
corresponding per-pixel alpha-blending AR30 color format.

Declaring only XR30 but not AR30 color format support can trigger bugs in
userspace. KDE KWin compositor versions prior to 5.27.3 for example prefer
10-bit color formats, rendering a 1cm^2 black box around the cursor due to
missing per-pixel alpha-blending.

Signed-off-by: Leonard Lausen <leonard@lausen.nl>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c    | 11 +++++++++++
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  2 ++
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      |  1 +
 3 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
index d95540309d4d..2b1ef186b909 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
@@ -536,6 +536,16 @@ static const struct dpu_format dpu_format_map_ubwc[] = {
                true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED,
                DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC),
 
+       /* XRGB2101010 and ARGB2101010 purposely have the same color
+        * ordering.  The hardware only supports ARGB2101010 UBWC
+        * natively.
+        */
+       INTERLEAVED_RGB_FMT_TILED(ARGB2101010,
+               COLOR_8BIT, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
+               C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA, 4,
+               true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED,
+               DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC),
+
        PSEUDO_YUV_FMT_TILED(NV12,
                0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
                C1_B_Cb, C2_R_Cr,
@@ -591,6 +601,7 @@ static int _dpu_format_get_media_color_ubwc(const struct dpu_format *fmt)
                {DRM_FORMAT_XBGR8888, COLOR_FMT_RGBA8888_UBWC},
                {DRM_FORMAT_XRGB8888, COLOR_FMT_RGBA8888_UBWC},
                {DRM_FORMAT_ABGR2101010, COLOR_FMT_RGBA1010102_UBWC},
+               {DRM_FORMAT_ARGB2101010, COLOR_FMT_RGBA1010102_UBWC},
                {DRM_FORMAT_XRGB2101010, COLOR_FMT_RGBA1010102_UBWC},
                {DRM_FORMAT_XBGR2101010, COLOR_FMT_RGBA1010102_UBWC},
                {DRM_FORMAT_BGR565, COLOR_FMT_RGB565_UBWC},
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
index e8a217d242ca..6ae9c5358c5c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
@@ -157,6 +157,7 @@ static const uint32_t plane_formats[] = {
        DRM_FORMAT_RGBX8888,
        DRM_FORMAT_BGRX8888,
        DRM_FORMAT_XBGR8888,
+       DRM_FORMAT_ARGB2101010,
        DRM_FORMAT_XRGB2101010,
        DRM_FORMAT_RGB888,
        DRM_FORMAT_BGR888,
@@ -186,6 +187,7 @@ static const uint32_t plane_formats_yuv[] = {
        DRM_FORMAT_RGBA8888,
        DRM_FORMAT_BGRX8888,
        DRM_FORMAT_BGRA8888,
+       DRM_FORMAT_ARGB2101010,
        DRM_FORMAT_XRGB2101010,
        DRM_FORMAT_XRGB8888,
        DRM_FORMAT_XBGR8888,
diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index bfd5be89e8b8..0ed6a1a114c7 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -69,6 +69,7 @@ static const uint32_t qcom_compressed_supported_formats[] = {
        DRM_FORMAT_ARGB8888,
        DRM_FORMAT_XBGR8888,
        DRM_FORMAT_XRGB8888,
+       DRM_FORMAT_ARGB2101010,
        DRM_FORMAT_XRGB2101010,
        DRM_FORMAT_BGR565,
 
-- 
2.30.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/msm/dpu: Add support for AR30 format
  2023-03-21  2:58 [PATCH v2] drm/msm/dpu: Add support for AR30 format Leonard Lausen
@ 2023-03-22 13:15 ` Leonard Lausen
  2023-03-24 18:47 ` Jessica Zhang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Leonard Lausen @ 2023-03-22 13:15 UTC (permalink / raw)
  To: robdclark, quic_abhinavk, dmitry.baryshkov, linux-arm-msm, freedreno

V2 adds missing AR30 swizzles in dpu_format_map_ubwc to avoid the following errors:

[drm:dpu_get_dpu_format_ext:1044] [dpu error]unsupported fmt: AR30 modifier 0x500000000000001
msm_dpu ae01000.display-controller: [drm:msm_framebuffer_init] *ERROR* unsupported pixel format: AR30

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/msm/dpu: Add support for AR30 format
  2023-03-21  2:58 [PATCH v2] drm/msm/dpu: Add support for AR30 format Leonard Lausen
  2023-03-22 13:15 ` Leonard Lausen
@ 2023-03-24 18:47 ` Jessica Zhang
  2023-03-28 13:25 ` Dmitry Baryshkov
  2023-03-28 22:37 ` Dmitry Baryshkov
  3 siblings, 0 replies; 5+ messages in thread
From: Jessica Zhang @ 2023-03-24 18:47 UTC (permalink / raw)
  To: Leonard Lausen, robdclark, quic_abhinavk, dmitry.baryshkov,
	linux-arm-msm, freedreno



On 3/20/2023 7:58 PM, Leonard Lausen wrote:
> Commit da7716a249b699978fb5 ("drm/msm/dpu: Add support for XR30 format") enabled
> support for the 10-bit XR30 color format but missed enabling support for the
> corresponding per-pixel alpha-blending AR30 color format.
> 
> Declaring only XR30 but not AR30 color format support can trigger bugs in
> userspace. KDE KWin compositor versions prior to 5.27.3 for example prefer
> 10-bit color formats, rendering a 1cm^2 black box around the cursor due to
> missing per-pixel alpha-blending.
> 
> Signed-off-by: Leonard Lausen <leonard@lausen.nl>

Hi Leonard,

Was able to validate the changes on SC7180 with null_platform_test and 
modetest.

Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Tested-by: Jessica Zhang <quic_jesszhan@quicinc.com> # Trogdor (sc7180)

Thanks,

Jessica Zhang

> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c    | 11 +++++++++++
>   drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  2 ++
>   drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      |  1 +
>   3 files changed, 14 insertions(+)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
> index d95540309d4d..2b1ef186b909 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c
> @@ -536,6 +536,16 @@ static const struct dpu_format dpu_format_map_ubwc[] = {
>                  true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED,
>                  DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC),
>   
> +       /* XRGB2101010 and ARGB2101010 purposely have the same color
> +        * ordering.  The hardware only supports ARGB2101010 UBWC
> +        * natively.
> +        */
> +       INTERLEAVED_RGB_FMT_TILED(ARGB2101010,
> +               COLOR_8BIT, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
> +               C2_R_Cr, C0_G_Y, C1_B_Cb, C3_ALPHA, 4,
> +               true, 4, DPU_FORMAT_FLAG_DX | DPU_FORMAT_FLAG_COMPRESSED,
> +               DPU_FETCH_UBWC, 2, DPU_TILE_HEIGHT_UBWC),
> +
>          PSEUDO_YUV_FMT_TILED(NV12,
>                  0, COLOR_8BIT, COLOR_8BIT, COLOR_8BIT,
>                  C1_B_Cb, C2_R_Cr,
> @@ -591,6 +601,7 @@ static int _dpu_format_get_media_color_ubwc(const struct dpu_format *fmt)
>                  {DRM_FORMAT_XBGR8888, COLOR_FMT_RGBA8888_UBWC},
>                  {DRM_FORMAT_XRGB8888, COLOR_FMT_RGBA8888_UBWC},
>                  {DRM_FORMAT_ABGR2101010, COLOR_FMT_RGBA1010102_UBWC},
> +               {DRM_FORMAT_ARGB2101010, COLOR_FMT_RGBA1010102_UBWC},
>                  {DRM_FORMAT_XRGB2101010, COLOR_FMT_RGBA1010102_UBWC},
>                  {DRM_FORMAT_XBGR2101010, COLOR_FMT_RGBA1010102_UBWC},
>                  {DRM_FORMAT_BGR565, COLOR_FMT_RGB565_UBWC},
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
> index e8a217d242ca..6ae9c5358c5c 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
> @@ -157,6 +157,7 @@ static const uint32_t plane_formats[] = {
>          DRM_FORMAT_RGBX8888,
>          DRM_FORMAT_BGRX8888,
>          DRM_FORMAT_XBGR8888,
> +       DRM_FORMAT_ARGB2101010,
>          DRM_FORMAT_XRGB2101010,
>          DRM_FORMAT_RGB888,
>          DRM_FORMAT_BGR888,
> @@ -186,6 +187,7 @@ static const uint32_t plane_formats_yuv[] = {
>          DRM_FORMAT_RGBA8888,
>          DRM_FORMAT_BGRX8888,
>          DRM_FORMAT_BGRA8888,
> +       DRM_FORMAT_ARGB2101010,
>          DRM_FORMAT_XRGB2101010,
>          DRM_FORMAT_XRGB8888,
>          DRM_FORMAT_XBGR8888,
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index bfd5be89e8b8..0ed6a1a114c7 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -69,6 +69,7 @@ static const uint32_t qcom_compressed_supported_formats[] = {
>          DRM_FORMAT_ARGB8888,
>          DRM_FORMAT_XBGR8888,
>          DRM_FORMAT_XRGB8888,
> +       DRM_FORMAT_ARGB2101010,
>          DRM_FORMAT_XRGB2101010,
>          DRM_FORMAT_BGR565,
>   
> -- 
> 2.30.2

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/msm/dpu: Add support for AR30 format
  2023-03-21  2:58 [PATCH v2] drm/msm/dpu: Add support for AR30 format Leonard Lausen
  2023-03-22 13:15 ` Leonard Lausen
  2023-03-24 18:47 ` Jessica Zhang
@ 2023-03-28 13:25 ` Dmitry Baryshkov
  2023-03-28 22:37 ` Dmitry Baryshkov
  3 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2023-03-28 13:25 UTC (permalink / raw)
  To: Leonard Lausen, robdclark, quic_abhinavk, linux-arm-msm, freedreno

On 21/03/2023 04:58, Leonard Lausen wrote:
> Commit da7716a249b699978fb5 ("drm/msm/dpu: Add support for XR30 format") enabled
> support for the 10-bit XR30 color format but missed enabling support for the
> corresponding per-pixel alpha-blending AR30 color format.
> 
> Declaring only XR30 but not AR30 color format support can trigger bugs in
> userspace. KDE KWin compositor versions prior to 5.27.3 for example prefer
> 10-bit color formats, rendering a 1cm^2 black box around the cursor due to
> missing per-pixel alpha-blending.
> 
> Signed-off-by: Leonard Lausen <leonard@lausen.nl>
> ---
>   drivers/gpu/drm/msm/disp/dpu1/dpu_formats.c    | 11 +++++++++++
>   drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c |  2 ++
>   drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c      |  1 +
>   3 files changed, 14 insertions(+)

Your patch doesn't apply as all tabs seems to be expanded to spaces. I 
have fixed this while applying as not to delay it further. Please use 
git-send-email when sending further patches.

-- 
With best wishes
Dmitry


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v2] drm/msm/dpu: Add support for AR30 format
  2023-03-21  2:58 [PATCH v2] drm/msm/dpu: Add support for AR30 format Leonard Lausen
                   ` (2 preceding siblings ...)
  2023-03-28 13:25 ` Dmitry Baryshkov
@ 2023-03-28 22:37 ` Dmitry Baryshkov
  3 siblings, 0 replies; 5+ messages in thread
From: Dmitry Baryshkov @ 2023-03-28 22:37 UTC (permalink / raw)
  To: robdclark, quic_abhinavk, linux-arm-msm, freedreno, Leonard Lausen


On Tue, 21 Mar 2023 02:58:04 +0000, Leonard Lausen wrote:
> Commit da7716a249b699978fb5 ("drm/msm/dpu: Add support for XR30 format") enabled
> support for the 10-bit XR30 color format but missed enabling support for the
> corresponding per-pixel alpha-blending AR30 color format.
> 
> Declaring only XR30 but not AR30 color format support can trigger bugs in
> userspace. KDE KWin compositor versions prior to 5.27.3 for example prefer
> 10-bit color formats, rendering a 1cm^2 black box around the cursor due to
> missing per-pixel alpha-blending.
> 
> [...]

Applied, thanks!

[1/1] drm/msm/dpu: Add support for AR30 format
      https://gitlab.freedesktop.org/lumag/msm/-/commit/a8318110b987

Best regards,
-- 
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-03-28 22:38 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-21  2:58 [PATCH v2] drm/msm/dpu: Add support for AR30 format Leonard Lausen
2023-03-22 13:15 ` Leonard Lausen
2023-03-24 18:47 ` Jessica Zhang
2023-03-28 13:25 ` Dmitry Baryshkov
2023-03-28 22:37 ` Dmitry Baryshkov

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.