From: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
To: Kuogee Hsieh <quic_khsieh@quicinc.com>,
dri-devel@lists.freedesktop.org, robdclark@gmail.com,
sean@poorly.run, swboyd@chromium.org, dianders@chromium.org,
vkoul@kernel.org, daniel@ffwll.ch, airlied@gmail.com,
agross@kernel.org, andersson@kernel.org
Cc: quic_abhinavk@quicinc.com, quic_sbillaka@quicinc.com,
marijn.suijten@somainline.org, freedreno@lists.freedesktop.org,
linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2 6/7] drm/msm/dpu: save dpu topology configuration
Date: Sat, 29 Apr 2023 03:56:36 +0300 [thread overview]
Message-ID: <37b12f18-bf76-33c1-f5cc-e679bd215cf6@linaro.org> (raw)
In-Reply-To: <1682725511-18185-7-git-send-email-quic_khsieh@quicinc.com>
On 29/04/2023 02:45, Kuogee Hsieh wrote:
> At current implementation, topology configuration is thrown away after
> dpu_rm_reserve(). This patch save the topology so that it can be used
> for DSC related calculation later.
Even if we delay the virtual wide planes patchset, please don't save the
topology in the encoder. If we get cloned encoders support (e.g. for
CWB), the end topology will contain both WB and INTF entries and as such
it will not be useable by a single encoder. Thus this change is not
future-proof.
>
> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---
> drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c | 32 ++++++++++++++---------------
> 1 file changed, 16 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> index ecb87bc..2fdacf1 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_encoder.c
> @@ -542,13 +542,13 @@ bool dpu_encoder_use_dsc_merge(struct drm_encoder *drm_enc)
> return (num_dsc > 0) && (num_dsc > intf_count);
> }
>
> -static struct msm_display_topology dpu_encoder_get_topology(
> +static void dpu_encoder_get_topology(
> struct dpu_encoder_virt *dpu_enc,
> struct dpu_kms *dpu_kms,
> struct drm_display_mode *mode,
> - struct drm_crtc_state *crtc_state)
> + struct drm_crtc_state *crtc_state,
> + struct msm_display_topology *topology)
> {
> - struct msm_display_topology topology = {0};
> int i, intf_count = 0;
>
> for (i = 0; i < MAX_PHYS_ENCODERS_PER_VIRTUAL; i++)
> @@ -567,16 +567,16 @@ static struct msm_display_topology dpu_encoder_get_topology(
> * Add dspps to the reservation requirements if ctm is requested
> */
> if (intf_count == 2)
> - topology.num_lm = 2;
> + topology->num_lm = 2;
> else if (!dpu_kms->catalog->caps->has_3d_merge)
> - topology.num_lm = 1;
> + topology->num_lm = 1;
> else
> - topology.num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
> + topology->num_lm = (mode->hdisplay > MAX_HDISPLAY_SPLIT) ? 2 : 1;
>
> if (crtc_state->ctm)
> - topology.num_dspp = topology.num_lm;
> + topology->num_dspp = topology->num_lm;
>
> - topology.num_intf = intf_count;
> + topology->num_intf = intf_count;
>
> if (dpu_enc->dsc) {
> /*
> @@ -585,12 +585,10 @@ static struct msm_display_topology dpu_encoder_get_topology(
> * this is power optimal and can drive up to (including) 4k
> * screens
> */
> - topology.num_dsc = 2;
> - topology.num_lm = 2;
> - topology.num_intf = 1;
> + topology->num_dsc = 2;
> + topology->num_lm = 2;
> + topology->num_intf = 1;
> }
> -
> - return topology;
> }
>
> static int dpu_encoder_virt_atomic_check(
> @@ -602,7 +600,7 @@ static int dpu_encoder_virt_atomic_check(
> struct msm_drm_private *priv;
> struct dpu_kms *dpu_kms;
> struct drm_display_mode *adj_mode;
> - struct msm_display_topology topology;
> + struct msm_display_topology *topology;
> struct dpu_global_state *global_state;
> int i = 0;
> int ret = 0;
> @@ -639,7 +637,9 @@ static int dpu_encoder_virt_atomic_check(
> }
> }
>
> - topology = dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state);
> + topology = &dpu_enc->topology;
> + memset(topology, 0, sizeof (*topology));
> + dpu_encoder_get_topology(dpu_enc, dpu_kms, adj_mode, crtc_state, topology);
>
> /*
> * Release and Allocate resources on every modeset
> @@ -650,7 +650,7 @@ static int dpu_encoder_virt_atomic_check(
>
> if (!crtc_state->active_changed || crtc_state->enable)
> ret = dpu_rm_reserve(&dpu_kms->rm, global_state,
> - drm_enc, crtc_state, topology);
> + drm_enc, crtc_state, *topology);
> }
>
> trace_dpu_enc_atomic_check_flags(DRMID(drm_enc), adj_mode->flags);
--
With best wishes
Dmitry
next prev parent reply other threads:[~2023-04-29 0:56 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-28 23:45 [PATCH v2 0/7] add DSC 1.2 dpu supports Kuogee Hsieh
2023-04-28 23:45 ` [PATCH v2 1/7] drm/msm/dpu: add support for DSC encoder v1.2 engine Kuogee Hsieh
2023-04-29 0:30 ` Dmitry Baryshkov
2023-04-29 1:10 ` Abhinav Kumar
2023-04-29 1:11 ` Dmitry Baryshkov
2023-05-01 20:40 ` Kuogee Hsieh
2023-05-01 20:50 ` Dmitry Baryshkov
2023-05-01 23:12 ` Kuogee Hsieh
2023-04-28 23:45 ` [PATCH v2 2/7] drm/msm/dpu: separate DSC flush update out of interface Kuogee Hsieh
2023-04-29 0:31 ` Dmitry Baryshkov
2023-04-28 23:45 ` [PATCH v2 3/7] drm/msm/dpu: add DSC 1.2 hw blocks for relevant chipsets Kuogee Hsieh
2023-04-28 23:45 ` [PATCH v2 4/7] drm/msm/dpu: add dsc blocks for remaining chipsets in catalog Kuogee Hsieh
2023-04-29 0:35 ` Dmitry Baryshkov
2023-04-29 1:03 ` [Freedreno] " Abhinav Kumar
2023-04-29 1:04 ` Dmitry Baryshkov
2023-04-29 1:05 ` Abhinav Kumar
2023-04-28 23:45 ` [PATCH v2 5/7] drm/msm/dpu: add DPU_PINGPONG_DSC feature PP_BLK and PP_BLK_TE Kuogee Hsieh
2023-04-29 0:45 ` Dmitry Baryshkov
2023-04-29 1:08 ` Abhinav Kumar
2023-04-29 1:41 ` Dmitry Baryshkov
2023-04-29 2:49 ` Abhinav Kumar
2023-04-29 3:21 ` Dmitry Baryshkov
2023-04-29 4:04 ` [Freedreno] " Abhinav Kumar
2023-04-29 4:35 ` Dmitry Baryshkov
2023-04-29 8:43 ` Abhinav Kumar
2023-04-29 19:45 ` Dmitry Baryshkov
2023-04-29 20:23 ` Abhinav Kumar
2023-04-29 21:11 ` Dmitry Baryshkov
2023-04-28 23:45 ` [PATCH v2 6/7] drm/msm/dpu: save dpu topology configuration Kuogee Hsieh
2023-04-29 0:56 ` Dmitry Baryshkov [this message]
2023-04-28 23:45 ` [PATCH v2 7/7] drm/msm/dpu: calculate DSC encoder parameters dynamically Kuogee Hsieh
2023-04-29 0:52 ` Dmitry Baryshkov
2023-04-29 1:22 ` Abhinav Kumar
2023-04-29 1:35 ` Dmitry Baryshkov
2023-04-29 0:29 ` [PATCH v2 0/7] add DSC 1.2 dpu supports Dmitry Baryshkov
2023-04-29 2:46 ` Dmitry Baryshkov
2023-04-29 2:50 ` Abhinav Kumar
2023-04-29 3:12 ` Dmitry Baryshkov
2023-04-29 3:30 ` Abhinav Kumar
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=37b12f18-bf76-33c1-f5cc-e679bd215cf6@linaro.org \
--to=dmitry.baryshkov@linaro.org \
--cc=agross@kernel.org \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dianders@chromium.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=marijn.suijten@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=quic_khsieh@quicinc.com \
--cc=quic_sbillaka@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.org \
--cc=vkoul@kernel.org \
/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