From: Jessica Zhang <quic_jesszhan@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: "Rob Clark" <robdclark@gmail.com>,
quic_abhinavk@quicinc.com, "Sean Paul" <sean@poorly.run>,
"Marijn Suijten" <marijn.suijten@somainline.org>,
"David Airlie" <airlied@gmail.com>,
"Daniel Vetter" <daniel@ffwll.ch>,
"Maarten Lankhorst" <maarten.lankhorst@linux.intel.com>,
"Maxime Ripard" <mripard@kernel.org>,
"Thomas Zimmermann" <tzimmermann@suse.de>,
quic_ebharadw@quicinc.com, linux-arm-msm@vger.kernel.org,
dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org,
linux-kernel@vger.kernel.org,
"Rob Clark" <robdclark@chromium.org>,
"Ville Syrjälä" <ville.syrjala@linux.intel.com>
Subject: Re: [PATCH v2 05/22] drm/msm/dpu: move resource allocation to CRTC
Date: Wed, 25 Sep 2024 13:38:51 -0700 [thread overview]
Message-ID: <24a11f4c-d848-4f1b-afbd-35b135fa3105@quicinc.com> (raw)
In-Reply-To: <dv5iij6v76ieprfckdjo4yksrjrgqw73v2lh7u4xffpu7rdrf3@zgjcp3a2hlxo>
On 9/24/2024 4:13 PM, Dmitry Baryshkov wrote:
> On Tue, Sep 24, 2024 at 03:59:21PM GMT, Jessica Zhang wrote:
>> From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>>
>> All resource allocation is centered around the LMs. Then other blocks
>> (except DSCs) are allocated basing on the LMs that was selected, and LM
>> powers up the CRTC rather than the encoder.
>>
>> Moreover if at some point the driver supports encoder cloning,
>> allocating resources from the encoder will be incorrect, as all clones
>> will have different encoder IDs, while LMs are to be shared by these
>> encoders.
>>
>> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
>> [quic_abhinavk@quicinc.com: Refactored resource allocation for CDM]
>> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>> [quic_jesszhan@quicinc.com: Changed to grabbing exising global state]
>> Signed-off-by: Jessica Zhang <quic_jesszhan@quicinc.com>
>> ---
>> drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c | 86 ++++++++++++
>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 201 +++++++++++-----------------
>> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.h | 19 +++
>> 3 files changed, 183 insertions(+), 123 deletions(-)
>>
>> @@ -544,159 +542,117 @@ void dpu_encoder_helper_split_config(
>> }
>> }
>>
>> -bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
>> +void dpu_encoder_update_topology(struct drm_encoder *drm_enc,
>> + struct msm_display_topology *topology,
>> + struct drm_atomic_state *state,
>> + const struct drm_display_mode *adj_mode)
>> {
>> struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc);
>> - int i, intf_count = 0, num_dsc = 0;
>> + struct drm_connector *connector;
>> + struct drm_connector_state *conn_state;
>> + struct msm_display_info *disp_info;
>> + struct drm_framebuffer *fb;
>> + struct msm_drm_private *priv;
>> + int i;
>>
>> for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++)
>> if (dpu_enc->phys_encs[i])
>> - intf_count++;
>> + topology->num_intf++;
>>
>> - /* See dpu_encoder_get_topology, we only support 2:2:1 topology */
>> + /* We only support 2 DSC mode (with 2 LM and 1 INTF) */
>> if (dpu_enc->dsc)
>> - num_dsc = 2;
>> + topology->num_dsc += 2;
>>
>> - return (num_dsc > 0) && (num_dsc > intf_count);
>> -}
>> + connector = drm_atomic_get_new_connector_for_encoder(state, drm_enc);
>> + if (!connector)
>> + return;
>> + conn_state = drm_atomic_get_new_connector_state(state, connector);
>> + if (!conn_state)
>> + return;
>>
>> -struct drm_dsc_config *dpu_encoder_get_dsc_config(struct drm_encoder *drm_enc)
>> -{
>> - struct msm_drm_private *priv = drm_enc->dev->dev_private;
>> - struct dpu_encoder_virt *dpu_enc = to_dpu_encoder_virt(drm_enc);
>> - int index = dpu_enc->disp_info.h_tile_instance[0];
>> + disp_info = &dpu_enc->disp_info;
>>
>> - if (dpu_enc->disp_info.intf_type == INTF_DSI)
>> - return msm_dsi_get_dsc_config(priv->dsi[index]);
>> + priv = drm_enc->dev->dev_private;
>>
>> - return NULL;
>> + /*
>> + * Use CDM only for writeback or DP at the moment as other interfaces cannot handle it.
>> + * If writeback itself cannot handle cdm for some reason it will fail in its atomic_check()
>> + * earlier.
>> + */
>> + if (disp_info->intf_type == INTF_WB && conn_state->writeback_job) {
>> + fb = conn_state->writeback_job->fb;
>> +
>> + if (fb && MSM_FORMAT_IS_YUV(msm_framebuffer_format(fb)))
>> + topology->needs_cdm = true;
>> + } else if (disp_info->intf_type == INTF_DP) {
>> + if (msm_dp_is_yuv_420_enabled(priv->dp[disp_info->h_tile_instance[0]], adj_mode))
>> + topology->needs_cdm = true;
>> + }
>
> Just to note, the needs_cdm is not enough once you introduce CWB
> support. E.g. DP/YUV420 + WB/YUV case requires two CDM blocks (which we
> don't have), but this doesn't get reflected in the topology.
Hi Dmitry,
Ack. I can add something to make atomic_check fail if the input FB is
YUV format and CWB is enabled.
Thanks,
Jessica Zhang
>
>> }
>>
> --
> With best wishes
> Dmitry
next prev parent reply other threads:[~2024-09-25 20:39 UTC|newest]
Thread overview: 64+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-24 22:59 [PATCH v2 00/22] drm/msm/dpu: Add Concurrent Writeback Support for DPU 10.x+ Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 01/22] drm: add clone mode check for CRTC Jessica Zhang
2024-09-24 23:06 ` Dmitry Baryshkov
2024-09-25 7:22 ` Maxime Ripard
2024-09-25 8:12 ` Jani Nikula
2024-09-25 20:47 ` Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 02/22] drm: Add valid clones check Jessica Zhang
2024-09-25 7:23 ` Maxime Ripard
2024-12-07 0:48 ` Jessica Zhang
2024-12-16 2:19 ` Abhinav Kumar
2024-12-16 14:27 ` Simona Vetter
2024-12-16 19:44 ` Jessica Zhang
2024-12-16 14:47 ` Maxime Ripard
2024-12-16 19:47 ` Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 03/22] drm/msm/dpu: get rid of struct dpu_rm_requirements Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 04/22] drm/msm/dpu: switch RM to use crtc_id rather than enc_id for allocation Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 05/22] drm/msm/dpu: move resource allocation to CRTC Jessica Zhang
2024-09-24 23:13 ` Dmitry Baryshkov
2024-09-25 20:38 ` Jessica Zhang [this message]
2024-09-25 21:11 ` Dmitry Baryshkov
2024-09-25 21:49 ` Abhinav Kumar
2024-09-26 7:12 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 06/22] drm/msm/dpu: fill CRTC resources in dpu_crtc.c Jessica Zhang
2024-09-24 23:16 ` Dmitry Baryshkov
2024-09-25 0:37 ` Jessica Zhang
2024-09-25 8:17 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 07/22] drm/msm/dpu: Add CWB entry to catalog for SM8650 Jessica Zhang
2024-09-24 23:17 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 08/22] drm/msm/dpu: Specify dedicated CWB pingpong blocks Jessica Zhang
2024-09-24 23:17 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 09/22] drm/msm/dpu: add devcoredumps for cwb registers Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 10/22] drm/msm/dpu: Add dpu_hw_cwb abstraction for CWB block Jessica Zhang
2024-09-24 23:19 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 11/22] drm/msm/dpu: add CWB support to dpu_hw_wb Jessica Zhang
2024-09-24 23:20 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 12/22] drm/msm/dpu: Add RM support for allocating CWB Jessica Zhang
2024-09-24 23:20 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 13/22] drm/msm/dpu: Add CWB to msm_display_topology Jessica Zhang
2024-09-24 23:22 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 14/22] drm/msm/dpu: Require modeset if clone mode status changes Jessica Zhang
2024-09-24 23:25 ` Dmitry Baryshkov
2024-09-25 0:05 ` Abhinav Kumar
2024-09-25 8:28 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 15/22] drm/msm/dpu: Reserve resources for CWB Jessica Zhang
2024-09-24 23:33 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 16/22] drm/msm/dpu: Configure CWB in writeback encoder Jessica Zhang
2024-09-24 23:41 ` Dmitry Baryshkov
2024-09-25 0:14 ` Jessica Zhang
2024-09-25 8:30 ` Dmitry Baryshkov
2024-09-30 14:17 ` neil.armstrong
2024-09-30 19:19 ` Jessica Zhang
2024-10-01 7:37 ` neil.armstrong
2024-10-08 8:00 ` Neil Armstrong
2024-10-08 8:18 ` Maxime Ripard
2024-10-08 12:25 ` Jessica Zhang
2024-10-09 7:46 ` neil.armstrong
2024-09-24 22:59 ` [PATCH v2 17/22] drm/msm/dpu: Support CWB in dpu_hw_ctl Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 18/22] drm/msm/dpu: Adjust writeback phys encoder setup for CWB Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 19/22] drm/msm/dpu: Start frame done timer after encoder kickoff Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 20/22] drm/msm/dpu: Skip trigger flush and start for CWB Jessica Zhang
2024-09-24 23:43 ` Dmitry Baryshkov
2024-09-24 22:59 ` [PATCH v2 21/22] drm/msm/dpu: Reorder encoder kickoff " Jessica Zhang
2024-09-24 22:59 ` [PATCH v2 22/22] drm/msm/dpu: Set possible clones for all encoders Jessica Zhang
2024-09-24 23:44 ` 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=24a11f4c-d848-4f1b-afbd-35b135fa3105@quicinc.com \
--to=quic_jesszhan@quicinc.com \
--cc=airlied@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=marijn.suijten@somainline.org \
--cc=mripard@kernel.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_ebharadw@quicinc.com \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
/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®