From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: Marijn Suijten <marijn.suijten@somainline.org>,
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>,
Vinod Koul <vkoul@kernel.org>, Simona Vetter <simona@ffwll.ch>
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>,
<~postmarketos/upstreaming@lists.sr.ht>,
AngeloGioacchino Del Regno
<angelogioacchino.delregno@collabora.com>,
"Martin Botka" <martin.botka@somainline.org>,
Jami Kettunen <jami.kettunen@somainline.org>,
Konrad Dybcio <konrad.dybcio@oss.qualcomm.com>
Subject: Re: [PATCH v2 1/3] drm/msm/dsi: Use existing per-interface slice count in DSC timing
Date: Mon, 10 Feb 2025 17:51:07 -0800 [thread overview]
Message-ID: <887a8c60-ef53-4f46-9dd1-c74f266f8bb2@quicinc.com> (raw)
In-Reply-To: <20250209-drm-msm-initial-dualpipe-dsc-fixes-v2-1-9a60184fdc36@somainline.org>
On 2/9/2025 1:42 PM, Marijn Suijten wrote:
> When configuring the timing of DSI hosts (interfaces) in
> dsi_timing_setup() all values written to registers are taking
> bonded-mode into account by dividing the original mode width by 2
> (half the data is sent over each of the two DSI hosts), but the full
> width instead of the interface width is passed as hdisplay parameter to
> dsi_update_dsc_timing().
>
> Currently only msm_dsc_get_slices_per_intf() is called within
> dsi_update_dsc_timing() with the `hdisplay` argument which clearly
> documents that it wants the width of a single interface (which, again,
> in bonded DSI mode is half the total width of the mode) resulting in all
> subsequent values to be completely off.
>
> However, as soon as we start to pass the halved hdisplay
> into dsi_update_dsc_timing() we might as well discard
> msm_dsc_get_slices_per_intf() since the value it calculates is already
> available in dsc->slice_count which is per-interface by the current
> design of MSM DPU/DSI implementations and their use of the DRM DSC
> helpers.
>
> Fixes: 08802f515c3c ("drm/msm/dsi: Add support for DSC configuration")
> Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org>
Hi Marijn,
Reviewed-by: Jessica Zhang <quic_jesszhan@quicinc.com>
Thanks,
Jessica Zhang
> ---
> drivers/gpu/drm/msm/dsi/dsi_host.c | 8 ++++----
> drivers/gpu/drm/msm/msm_dsc_helper.h | 11 -----------
> 2 files changed, 4 insertions(+), 15 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
> index 007311c21fdaa0462b05d53cd8a2aad0269b1727..42e100a8adca09d7b55afce0e2553e76d898744f 100644
> --- a/drivers/gpu/drm/msm/dsi/dsi_host.c
> +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
> @@ -846,7 +846,7 @@ static void dsi_ctrl_enable(struct msm_dsi_host *msm_host,
> dsi_write(msm_host, REG_DSI_CPHY_MODE_CTRL, BIT(0));
> }
>
> -static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mode, u32 hdisplay)
> +static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mode)
> {
> struct drm_dsc_config *dsc = msm_host->dsc;
> u32 reg, reg_ctrl, reg_ctrl2;
> @@ -858,7 +858,7 @@ static void dsi_update_dsc_timing(struct msm_dsi_host *msm_host, bool is_cmd_mod
> /* first calculate dsc parameters and then program
> * compress mode registers
> */
> - slice_per_intf = msm_dsc_get_slices_per_intf(dsc, hdisplay);
> + slice_per_intf = dsc->slice_count;
>
> total_bytes_per_intf = dsc->slice_chunk_size * slice_per_intf;
> bytes_per_pkt = dsc->slice_chunk_size; /* * slice_per_pkt; */
> @@ -991,7 +991,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
>
> if (msm_host->mode_flags & MIPI_DSI_MODE_VIDEO) {
> if (msm_host->dsc)
> - dsi_update_dsc_timing(msm_host, false, mode->hdisplay);
> + dsi_update_dsc_timing(msm_host, false);
>
> dsi_write(msm_host, REG_DSI_ACTIVE_H,
> DSI_ACTIVE_H_START(ha_start) |
> @@ -1012,7 +1012,7 @@ static void dsi_timing_setup(struct msm_dsi_host *msm_host, bool is_bonded_dsi)
> DSI_ACTIVE_VSYNC_VPOS_END(vs_end));
> } else { /* command mode */
> if (msm_host->dsc)
> - dsi_update_dsc_timing(msm_host, true, mode->hdisplay);
> + dsi_update_dsc_timing(msm_host, true);
>
> /* image data and 1 byte write_memory_start cmd */
> if (!msm_host->dsc)
> diff --git a/drivers/gpu/drm/msm/msm_dsc_helper.h b/drivers/gpu/drm/msm/msm_dsc_helper.h
> index b9049fe1e2790703a6f42dd7e6cd3fa5eea29389..63f95523b2cbb48f822210ac47cdd3526f231a89 100644
> --- a/drivers/gpu/drm/msm/msm_dsc_helper.h
> +++ b/drivers/gpu/drm/msm/msm_dsc_helper.h
> @@ -12,17 +12,6 @@
> #include <linux/math.h>
> #include <drm/display/drm_dsc_helper.h>
>
> -/**
> - * msm_dsc_get_slices_per_intf() - calculate number of slices per interface
> - * @dsc: Pointer to drm dsc config struct
> - * @intf_width: interface width in pixels
> - * Returns: Integer representing the number of slices for the given interface
> - */
> -static inline u32 msm_dsc_get_slices_per_intf(const struct drm_dsc_config *dsc, u32 intf_width)
> -{
> - return DIV_ROUND_UP(intf_width, dsc->slice_width);
> -}
> -
> /**
> * msm_dsc_get_bytes_per_line() - calculate bytes per line
> * @dsc: Pointer to drm dsc config struct
>
> --
> 2.48.1
>
>
next prev parent reply other threads:[~2025-02-11 1:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-09 21:42 [PATCH v2 0/3] drm/msm: Initial fixes for DUALPIPE (+DSC) topology Marijn Suijten
2025-02-09 21:42 ` [PATCH v2 1/3] drm/msm/dsi: Use existing per-interface slice count in DSC timing Marijn Suijten
2025-02-11 1:51 ` Jessica Zhang [this message]
2025-02-11 3:42 ` Dmitry Baryshkov
2025-02-09 21:42 ` [PATCH v2 2/3] drm/msm/dsi: Set PHY usescase (and mode) before registering DSI host Marijn Suijten
2025-02-09 23:11 ` Dmitry Baryshkov
2025-02-10 12:54 ` Marijn Suijten
2025-02-10 14:24 ` Dmitry Baryshkov
2025-02-10 22:17 ` Abhinav Kumar
2025-02-13 1:13 ` Abhinav Kumar
2025-02-13 2:13 ` Dmitry Baryshkov
2025-02-16 23:06 ` Marijn Suijten
2025-02-17 0:48 ` Dmitry Baryshkov
2025-02-09 23:28 ` Abhinav Kumar
2025-02-09 21:42 ` [PATCH v2 3/3] drm/msm/dpu: Remove arbitrary limit of 1 interface in DSC topology Marijn Suijten
2025-02-09 23:13 ` Dmitry Baryshkov
2025-02-11 1:54 ` Jessica Zhang
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=887a8c60-ef53-4f46-9dd1-c74f266f8bb2@quicinc.com \
--to=quic_jesszhan@quicinc.com \
--cc=airlied@gmail.com \
--cc=angelogioacchino.delregno@collabora.com \
--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=konrad.dybcio@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=martin.botka@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=simona@ffwll.ch \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®