dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: <freedreno@lists.freedesktop.org>
Cc: linux-arm-msm@vger.kernel.org,
	Abhinav Kumar <quic_abhinavk@quicinc.com>,
	Kuogee Hsieh <quic_khsieh@quicinc.com>,
	Konrad Dybcio <konrad.dybcio@linaro.org>,
	dri-devel@lists.freedesktop.org,
	Jessica Zhang <quic_jesszhan@quicinc.com>,
	Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Marijn Suijten <marijn.suijten@somainline.org>,
	Sean Paul <sean@poorly.run>
Subject: [PATCH v14 6/9] drm/msm/dpu: Use fixed DRM DSC helper for det_thresh_flatness
Date: Wed, 24 May 2023 10:45:19 -0700	[thread overview]
Message-ID: <20230329-rfc-msm-dsc-helper-v14-6-bafc7be95691@quicinc.com> (raw)
In-Reply-To: <20230329-rfc-msm-dsc-helper-v14-0-bafc7be95691@quicinc.com>

The current dpu_hw_dsc calculation for det_thresh_flatness does not
match the downstream calculation or the DSC spec.

Use the DRM DSC helper for det_thresh_flatness to match downstream
implementation and the DSC spec.

Fixes: c110cfd1753e ("drm/msm/disp/dpu1: Add support for DSC")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org>
Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
index 4e1396575e6a..3cad6a80af97 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dsc.c
@@ -3,6 +3,8 @@
  * Copyright (c) 2020-2022, Linaro Limited
  */
 
+#include <drm/display/drm_dsc_helper.h>
+
 #include "dpu_kms.h"
 #include "dpu_hw_catalog.h"
 #include "dpu_hwio.h"
@@ -102,7 +104,7 @@ static void dpu_hw_dsc_config(struct dpu_hw_dsc *hw_dsc,
 	data |= dsc->final_offset;
 	DPU_REG_WRITE(c, DSC_DSC_OFFSET, data);
 
-	det_thresh_flatness = 7 + 2 * (dsc->bits_per_component - 8);
+	det_thresh_flatness = drm_dsc_flatness_det_thresh(dsc);
 	data = det_thresh_flatness << 10;
 	data |= dsc->flatness_max_qp << 5;
 	data |= dsc->flatness_min_qp;

-- 
2.40.1


  parent reply	other threads:[~2023-05-24 17:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-24 17:45 [PATCH v14 0/9] Introduce MSM-specific DSC helpers Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 1/9] drm/display/dsc: Add flatness and initial scale value calculations Jessica Zhang
2023-05-24 19:05   ` Marijn Suijten
2023-05-25  1:05     ` Jessica Zhang
2023-05-25 20:33       ` Marijn Suijten
2023-05-24 17:45 ` [PATCH v14 2/9] drm/display/dsc: add helper to set semi-const parameters Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 3/9] drm/display/dsc: Add drm_dsc_get_bpp_int helper Jessica Zhang
2023-05-24 19:14   ` Marijn Suijten
2023-05-24 22:38     ` Jessica Zhang
2023-05-25 20:18       ` Marijn Suijten
2023-05-25 21:23         ` Dmitry Baryshkov
2023-05-24 17:45 ` [PATCH v14 4/9] drm/msm/dsi: use DRM DSC helpers for DSC setup Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 5/9] drm/msm: Add MSM-specific DSC helper methods Jessica Zhang
2023-05-24 17:45 ` Jessica Zhang [this message]
2023-05-24 17:45 ` [PATCH v14 7/9] drm/msm/dpu: Fix slice_last_group_size calculation Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 8/9] drm/msm/dsi: Use MSM and DRM DSC helper methods Jessica Zhang
2023-05-24 17:45 ` [PATCH v14 9/9] drm/msm/dsi: update hdisplay calculation for dsi_timing_setup Jessica Zhang
2023-05-24 19:09 ` [PATCH v14 0/9] Introduce MSM-specific DSC helpers Marijn Suijten
2023-06-15 11:31 ` Dmitry Baryshkov

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=20230329-rfc-msm-dsc-helper-v14-6-bafc7be95691@quicinc.com \
    --to=quic_jesszhan@quicinc.com \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=marijn.suijten@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=quic_khsieh@quicinc.com \
    --cc=sean@poorly.run \
    /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;
as well as URLs for NNTP newsgroup(s).