From patchwork Tue Mar 21 02:58:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Leonard Lausen X-Patchwork-Id: 13182181 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37C31C76195 for ; Tue, 21 Mar 2023 02:58:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229931AbjCUC6N (ORCPT ); Mon, 20 Mar 2023 22:58:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229511AbjCUC6M (ORCPT ); Mon, 20 Mar 2023 22:58:12 -0400 Received: from devico.uberspace.de (devico.uberspace.de [185.26.156.185]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCB8840EC for ; Mon, 20 Mar 2023 19:58:08 -0700 (PDT) Received: (qmail 25382 invoked by uid 990); 21 Mar 2023 02:58:04 -0000 Authentication-Results: devico.uberspace.de; auth=pass (plain) MIME-Version: 1.0 Date: Tue, 21 Mar 2023 02:58:04 +0000 From: "Leonard Lausen" Message-ID: <6f33219dc848ccd7122bce6933338033aa18c33c@lausen.nl> TLS-Required: No Subject: [PATCH v2] drm/msm/dpu: Add support for AR30 format To: robdclark@gmail.com, quic_abhinavk@quicinc.com, dmitry.baryshkov@linaro.org, linux-arm-msm@vger.kernel.org, freedreno@lists.freedesktop.org X-Rspamd-Bar: --- X-Rspamd-Report: BAYES_HAM(-2.999999) MIME_GOOD(-0.1) X-Rspamd-Score: -3.099999 Received: from unknown (HELO unkown) (::1) by devico.uberspace.de (Haraka/3.0.1) with ESMTPSA; Tue, 21 Mar 2023 03:58:04 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=lausen.nl; s=uberspace; h=from; bh=rYbDhks1ZE3HAb7y2rSMfUjbBwhYGu9ZnE2vd1eSzvM=; b=MDTpbnXG29DKkpF8ZfL2uLn/Q3jPopFzVlffIANlVfzjDtZShZ4aOLTLA/bQZ80HQCHiEOMnaO 9JRgBh2b0xsrZeSweogA+k2YyT9oFHZLLU60S52hfVQ9gqyVrLWgz3/pXLAb9URTZAaKJLDMDwcF QY/Tf5cM0QQjOUpiIY9kqQBEzR/v/QWtbTNNKyZsu4XkDi4uxYqMTIcMPfGbX8Om6bu9Ge4R+wg5 jWdCZ2yie56kDHioAISflmYrVRJHa120b7byyd+X3u/Q06jKHRbuyxPOkCbHFqkcTvHujdXJoLcp BcdfPFMs0RiUBA43QVo1b9HoxSWpm8FRBgov6fz7BuEEQpDc4ObqLJATtGVD8fKFJBkrTdZttXog DLJLJliHWlc7SjL/vCtoY41BPhHV3LI3ZlJ1ebzKurWY2AEord89twkKJfFg9UHF34fi7fzesuYu tYOWF3RCqZu/j6k7nm9foC53SQDg6jtmFT8GH2cOt0w1G+PopCSF4+MeBRqgFgTFLCUmkOxj2TBP VlEtXtdQ614185sY4Hh97A3sE4B59kzutEGglxlt8yd7AwDSf1n2/s2UdP4OgUmpUkR/804fNP7k kixRrhajOBthYsl1eqJFHUUN2OmNIf3/BJyIGaO+IDgExd/2idkQszfU9erXMJVL3LpHTf6bgIPn 8= Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org 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 Reviewed-by: Jessica Zhang Tested-by: Jessica Zhang # Trogdor (sc7180) --- 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,