All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marijn Suijten <marijn.suijten@somainline.org>
To: Rob Clark <robdclark@gmail.com>,
	 Abhinav Kumar <quic_abhinavk@quicinc.com>,
	 Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Sean Paul <sean@poorly.run>,  David Airlie <airlied@gmail.com>,
	Daniel Vetter <daniel@ffwll.ch>,
	 Archit Taneja <architt@codeaurora.org>,
	 Chandan Uddaraju <chandanu@codeaurora.org>,
	Vinod Koul <vkoul@kernel.org>,
	 Sravanthi Kollukuduru <skolluku@codeaurora.org>
Cc: linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
	 freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	 Jordan Crouse <jordan@cosmicpenguin.net>,
	 Rajesh Yadav <ryadav@codeaurora.org>,
	 Jeykumar Sankaran <jsanka@codeaurora.org>,
	 ~postmarketos/upstreaming@lists.sr.ht,
	 AngeloGioacchino Del Regno
	<angelogioacchino.delregno@collabora.com>,
	 Konrad Dybcio <konrad.dybcio@linaro.org>,
	 Martin Botka <martin.botka@somainline.org>,
	 Jami Kettunen <jami.kettunen@somainline.org>,
	 Marijn Suijten <marijn.suijten@somainline.org>
Subject: [PATCH 4/7] drm/msm/dpu: Allow configuring multiple active DSC blocks
Date: Wed, 17 Apr 2024 01:57:44 +0200	[thread overview]
Message-ID: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-4-78ae3ee9a697@somainline.org> (raw)
In-Reply-To: <20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-0-78ae3ee9a697@somainline.org>

Just like the active interface and writeback block in ctl_intf_cfg_v1(),
and later the rest of the blocks in followup active-CTL fixes or
reworks, multiple calls to this function should enable additional DSC
blocks instead of overwriting the blocks that are enabled.

This pattern is observed in an active-CTL scenario since DPU 5.0.0 where
for example bonded-DSI uses a single CTL to drive multiple INTFs, and
each encoder calls this function individually with the INTF (hence the
pre-existing update instead of overwrite of this bitmask) and DSC blocks
it wishes to be enabled, and expects them to be OR'd into the bitmask.

The reverse already exists in reset_intf_cfg_v1() where only specified
DSC blocks are removed out of the CTL_DSC_ACTIVE bitmask (same for all
other blocks and ACTIVE bitmasks), leaving the rest enabled.

Fixes: 77f6da90487c ("drm/msm/disp/dpu1: Add DSC support in hw_ctl")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
index a06f69d0b257..2e50049f2f85 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_hw_ctl.c
@@ -545,6 +545,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
 {
 	struct dpu_hw_blk_reg_map *c = &ctx->hw;
 	u32 intf_active = 0;
+	u32 dsc_active = 0;
 	u32 wb_active = 0;
 	u32 mode_sel = 0;
 
@@ -560,6 +561,7 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
 
 	intf_active = DPU_REG_READ(c, CTL_INTF_ACTIVE);
 	wb_active = DPU_REG_READ(c, CTL_WB_ACTIVE);
+	dsc_active = DPU_REG_READ(c, CTL_DSC_ACTIVE);
 
 	if (cfg->intf)
 		intf_active |= BIT(cfg->intf - INTF_0);
@@ -567,17 +569,18 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx,
 	if (cfg->wb)
 		wb_active |= BIT(cfg->wb - WB_0);
 
+	if (cfg->dsc)
+		dsc_active |= cfg->dsc;
+
 	DPU_REG_WRITE(c, CTL_TOP, mode_sel);
 	DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active);
 	DPU_REG_WRITE(c, CTL_WB_ACTIVE, wb_active);
+	DPU_REG_WRITE(c, CTL_DSC_ACTIVE, dsc_active);
 
 	if (cfg->merge_3d)
 		DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE,
 			      BIT(cfg->merge_3d - MERGE_3D_0));
 
-	if (cfg->dsc)
-		DPU_REG_WRITE(c, CTL_DSC_ACTIVE, cfg->dsc);
-
 	if (cfg->cdm)
 		DPU_REG_WRITE(c, CTL_CDM_ACTIVE, cfg->cdm);
 }

-- 
2.44.0


  parent reply	other threads:[~2024-04-16 23:57 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-16 23:57 [PATCH 0/7] drm/msm: Initial fixes for DUALPIPE (+DSC) topology Marijn Suijten
2024-04-16 23:57 ` [PATCH 1/7] drm/msm/dsi: Print dual-DSI-adjusted pclk instead of original mode pclk Marijn Suijten
2024-04-17 11:56   ` Dmitry Baryshkov
2024-04-16 23:57 ` [PATCH 2/7] drm/msm/dsi: Pass bonded-DSI hdisplay/2 to DSC timing configuration Marijn Suijten
2024-04-17 11:58   ` Dmitry Baryshkov
2024-04-19 22:18     ` Marijn Suijten
2024-04-19 22:59       ` Dmitry Baryshkov
2024-04-16 23:57 ` [PATCH 3/7] drm/msm/dpu: Always flush the slave INTF on the CTL Marijn Suijten
2024-04-17 11:58   ` Dmitry Baryshkov
2024-04-23 18:40   ` Abhinav Kumar
2024-04-16 23:57 ` Marijn Suijten [this message]
2024-04-17 11:59   ` [PATCH 4/7] drm/msm/dpu: Allow configuring multiple active DSC blocks Dmitry Baryshkov
2024-04-16 23:57 ` [PATCH 5/7] drm/msm/dpu: Correct dual-ctl -> dual-intf typo in comment Marijn Suijten
2024-04-17 23:30   ` Dmitry Baryshkov
2024-04-28 21:06     ` Marijn Suijten
2024-04-16 23:57 ` [PATCH 6/7] drm/msm/dsi: Set PHY usescase before registering DSI host Marijn Suijten
2024-04-17  8:18   ` Dmitry Baryshkov
2024-04-17 12:50     ` Marijn Suijten
2024-04-16 23:57 ` [PATCH 7/7] drm/msm/dpu: Rename `ctx` parameter to `intf` to match other functions Marijn Suijten
2024-04-17 23:33   ` 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=20240417-drm-msm-initial-dualpipe-dsc-fixes-v1-4-78ae3ee9a697@somainline.org \
    --to=marijn.suijten@somainline.org \
    --cc=airlied@gmail.com \
    --cc=angelogioacchino.delregno@collabora.com \
    --cc=architt@codeaurora.org \
    --cc=chandanu@codeaurora.org \
    --cc=daniel@ffwll.ch \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=freedreno@lists.freedesktop.org \
    --cc=jami.kettunen@somainline.org \
    --cc=jordan@cosmicpenguin.net \
    --cc=jsanka@codeaurora.org \
    --cc=konrad.dybcio@linaro.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=martin.botka@somainline.org \
    --cc=quic_abhinavk@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=ryadav@codeaurora.org \
    --cc=sean@poorly.run \
    --cc=skolluku@codeaurora.org \
    --cc=vkoul@kernel.org \
    --cc=~postmarketos/upstreaming@lists.sr.ht \
    /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 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.