From: Stephen Boyd <swboyd@chromium.org>
To: Abhinav Kumar <abhinavk@codeaurora.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Daniel Vetter <daniel@ffwll.ch>, David Airlie <airlied@linux.ie>,
Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Kalyan Thota <kalyan_t@codeaurora.org>,
Kuogee Hsieh <khsieh@codeaurora.org>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>
Cc: Rob Herring <robh+dt@kernel.org>,
linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org,
freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 3/5] drm/msm/dp: Support up to 3 DP controllers
Date: Mon, 4 Oct 2021 20:58:03 -0400 [thread overview]
Message-ID: <CAE-0n50=EWg1GKuTnRi=zA0ufO1Xg4mucYaqNUZ+wgYNDRcWLA@mail.gmail.com> (raw)
In-Reply-To: <20211001180058.1021913-4-bjorn.andersson@linaro.org>
Quoting Bjorn Andersson (2021-10-01 11:00:56)
> Based on the removal of the g_dp_display and the movement of the
> priv->dp lookup into the DP code it's now possible to have multiple
> DP instances.
>
> In line with the other controllers in the MSM driver, introduce a
> per-compatible list of base addresses which is used to resolve the
> "instance id" for the given DP controller. This instance id is used as
> index in the priv->dp[] array.
>
> Then extend the initialization code to initialize struct drm_encoder for
> each of the registered priv->dp[] and update the logic for associating
> each struct msm_dp with the struct dpu_encoder_virt.
>
> Lastly, bump the number of struct msm_dp instances carries by priv->dp
> to 3, the currently known maximum number of controllers found in a
> Qualcomm SoC.
>
> Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
> ---
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Some nits below.
>
> Changes since v2:
> - Added MSM_DRM_DP_COUNT to link the two 3s
> - Moved NULL check for msm_dp_debugfs_init() to the call site
> - Made struct dp_display_private->id unsigned
>
> I also implemented added connector_type to each of the DP instances and
> propagated this to dp_drm_connector_init() but later dropped this again per
> Doug's suggestion that we'll base this on the presence/absence of a associated
> drm bridge or panel.
Sad but OK. We can take up that topic in another patch.
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> index f655adbc2421..875b07e7183d 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c
> @@ -203,8 +204,10 @@ static int dpu_kms_debugfs_init(struct msm_kms *kms, struct drm_minor *minor)
> dpu_debugfs_vbif_init(dpu_kms, entry);
> dpu_debugfs_core_irq_init(dpu_kms, entry);
>
> - if (priv->dp)
> - msm_dp_debugfs_init(priv->dp, minor);
> + for (i = 0; i < ARRAY_SIZE(priv->dp); i++) {
> + if (priv->dp[i])
> + msm_dp_debugfs_init(priv->dp[i], minor);
This seems to cause a bunch of debugfs warnings when there are multiple
nodes created with the same name.
> + }
>
> return dpu_core_perf_debugfs_init(dpu_kms, entry);
> }
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 5d3ee5ef07c2..ff3477474c5d 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1180,10 +1192,31 @@ int dp_display_request_irq(struct msm_dp *dp_display)
> return 0;
> }
>
> +static int dp_display_find_id(struct platform_device *pdev)
> +{
> + const struct msm_dp_config *cfg = of_device_get_match_data(&pdev->dev);
> + struct resource *res;
> + int i;
> +
> +
Nitpick: Remove a newline here.
> + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> + if (!res)
> + return -EINVAL;
> +
> + for (i = 0; i < cfg->num_descs; i++) {
> + if (cfg->io_start[i] == res->start)
> + return i;
> + }
Nitpick: Drop braces on single line if inside for loop.
> +
> + dev_err(&pdev->dev, "unknown displayport instance\n");
> + return -EINVAL;
> +}
> +
next prev parent reply other threads:[~2021-10-05 0:58 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-01 18:00 [PATCH v3 0/5] drm/msm/dp: Support multiple DP instances and add sc8180x Bjorn Andersson
2021-10-01 18:00 ` [PATCH v3 1/5] drm/msm/dp: Remove global g_dp_display variable Bjorn Andersson
2021-10-05 20:11 ` [Freedreno] " abhinavk
2021-10-01 18:00 ` [PATCH v3 2/5] drm/msm/dp: Modify prototype of encoder based API Bjorn Andersson
2021-10-05 20:13 ` [Freedreno] " abhinavk
2021-10-01 18:00 ` [PATCH v3 3/5] drm/msm/dp: Support up to 3 DP controllers Bjorn Andersson
2021-10-05 0:58 ` Stephen Boyd [this message]
2021-10-05 1:15 ` Bjorn Andersson
2021-10-05 1:17 ` Stephen Boyd
2021-10-05 20:16 ` [Freedreno] " abhinavk
2021-10-05 20:19 ` abhinavk
2021-10-01 18:00 ` [PATCH v3 4/5] dt-bindings: msm/dp: Add SC8180x compatibles Bjorn Andersson
2021-10-05 20:20 ` abhinavk
2021-10-01 18:00 ` [PATCH v3 5/5] drm/msm/dp: Add sc8180x DP controllers Bjorn Andersson
2021-10-05 20:20 ` [Freedreno] " abhinavk
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='CAE-0n50=EWg1GKuTnRi=zA0ufO1Xg4mucYaqNUZ+wgYNDRcWLA@mail.gmail.com' \
--to=swboyd@chromium.org \
--cc=abhinavk@codeaurora.org \
--cc=airlied@linux.ie \
--cc=bjorn.andersson@linaro.org \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=kalyan_t@codeaurora.org \
--cc=khsieh@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=robdclark@gmail.com \
--cc=robh+dt@kernel.org \
--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).