From: Kuogee Hsieh <quic_khsieh@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Rob Clark <robdclark@gmail.com>,
Abhinav Kumar <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>,
Stephen Boyd <swboyd@chromium.org>
Cc: <linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>,
Bjorn Andersson <andersson@kernel.org>,
Konrad Dybcio <konrad.dybcio@linaro.org>
Subject: Re: [PATCH RESEND v3 14/15] drm/msm/dp: move next_bridge handling to dp_display
Date: Fri, 26 Jan 2024 14:25:31 -0800 [thread overview]
Message-ID: <0baffdcb-80bd-63ff-e78c-c067d8df1bc9@quicinc.com> (raw)
In-Reply-To: <20240126-dp-power-parser-cleanup-v3-14-098d5f581dd3@linaro.org>
On 1/26/2024 10:26 AM, Dmitry Baryshkov wrote:
> Remove two levels of indirection and fetch next bridge directly in
> dp_display_probe_tail().
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> ---
> drivers/gpu/drm/msm/dp/dp_display.c | 43 ++++++++++++-------------------------
> drivers/gpu/drm/msm/dp/dp_parser.c | 14 ------------
> drivers/gpu/drm/msm/dp/dp_parser.h | 14 ------------
> 3 files changed, 14 insertions(+), 57 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index f19cb8c7e8cb..de1306a88748 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -1195,16 +1195,25 @@ static const struct msm_dp_desc *dp_display_get_desc(struct platform_device *pde
> return NULL;
> }
>
> -static int dp_display_get_next_bridge(struct msm_dp *dp);
> -
> static int dp_display_probe_tail(struct device *dev)
> {
> struct msm_dp *dp = dev_get_drvdata(dev);
> int ret;
>
> - ret = dp_display_get_next_bridge(dp);
> - if (ret)
> - return ret;
> + /*
> + * External bridges are mandatory for eDP interfaces: one has to
> + * provide at least an eDP panel (which gets wrapped into panel-bridge).
> + *
> + * For DisplayPort interfaces external bridges are optional, so
> + * silently ignore an error if one is not present (-ENODEV).
> + */
> + dp->next_bridge = devm_drm_of_get_bridge(&dp->pdev->dev, dp->pdev->dev.of_node, 1, 0);
> + if (IS_ERR(dp->next_bridge)) {
> + ret = PTR_ERR(dp->next_bridge);
> + dp->next_bridge = NULL;
> + if (dp->is_edp || ret != -ENODEV)
> + return ret;
> + }
>
> ret = component_add(dev, &dp_display_comp_ops);
> if (ret)
> @@ -1397,30 +1406,6 @@ void dp_display_debugfs_init(struct msm_dp *dp_display, struct dentry *root, boo
> }
> }
>
> -static int dp_display_get_next_bridge(struct msm_dp *dp)
> -{
> - int rc;
> - struct dp_display_private *dp_priv;
> -
> - dp_priv = container_of(dp, struct dp_display_private, dp_display);
> -
> - /*
> - * External bridges are mandatory for eDP interfaces: one has to
> - * provide at least an eDP panel (which gets wrapped into panel-bridge).
> - *
> - * For DisplayPort interfaces external bridges are optional, so
> - * silently ignore an error if one is not present (-ENODEV).
> - */
> - rc = devm_dp_parser_find_next_bridge(&dp->pdev->dev, dp_priv->parser);
> - if (!dp->is_edp && rc == -ENODEV)
> - return 0;
> -
> - if (!rc)
> - dp->next_bridge = dp_priv->parser->next_bridge;
> -
> - return rc;
> -}
> -
> int msm_dp_modeset_init(struct msm_dp *dp_display, struct drm_device *dev,
> struct drm_encoder *encoder)
> {
> diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c
> index aa135d5cedbd..f95ab3c5c72c 100644
> --- a/drivers/gpu/drm/msm/dp/dp_parser.c
> +++ b/drivers/gpu/drm/msm/dp/dp_parser.c
> @@ -24,20 +24,6 @@ static int dp_parser_ctrl_res(struct dp_parser *parser)
> return 0;
> }
>
> -int devm_dp_parser_find_next_bridge(struct device *dev, struct dp_parser *parser)
> -{
> - struct platform_device *pdev = parser->pdev;
> - struct drm_bridge *bridge;
> -
> - bridge = devm_drm_of_get_bridge(dev, pdev->dev.of_node, 1, 0);
> - if (IS_ERR(bridge))
> - return PTR_ERR(bridge);
> -
> - parser->next_bridge = bridge;
> -
> - return 0;
> -}
> -
> static int dp_parser_parse(struct dp_parser *parser)
> {
> int rc = 0;
> diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h
> index 21a66932e35e..38fd335d5950 100644
> --- a/drivers/gpu/drm/msm/dp/dp_parser.h
> +++ b/drivers/gpu/drm/msm/dp/dp_parser.h
> @@ -21,7 +21,6 @@
> struct dp_parser {
> struct platform_device *pdev;
> struct phy *phy;
> - struct drm_bridge *next_bridge;
> };
>
> /**
> @@ -37,17 +36,4 @@ struct dp_parser {
> */
> struct dp_parser *dp_parser_get(struct platform_device *pdev);
>
> -/**
> - * devm_dp_parser_find_next_bridge() - find an additional bridge to DP
> - *
> - * @dev: device to tie bridge lifetime to
> - * @parser: dp_parser data from client
> - *
> - * This function is used to find any additional bridge attached to
> - * the DP controller. The eDP interface requires a panel bridge.
> - *
> - * Return: 0 if able to get the bridge, otherwise negative errno for failure.
> - */
> -int devm_dp_parser_find_next_bridge(struct device *dev, struct dp_parser *parser);
> -
> #endif
>
next prev parent reply other threads:[~2024-01-26 22:25 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-26 18:26 [PATCH RESEND v3 00/15] drm/msm/dp: clear power and parser submodules away Dmitry Baryshkov
2024-01-26 18:26 ` [PATCH RESEND v3 01/15] drm/msm/dp: drop unused parser definitions Dmitry Baryshkov
2024-01-26 22:18 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 02/15] drm/msm/dp: drop unused fields from dp_power_private Dmitry Baryshkov
2024-01-26 22:19 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 03/15] drm/msm/dp: parse DT from dp_parser_get Dmitry Baryshkov
2024-01-26 22:19 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 04/15] drm/msm/dp: inline dp_power_(de)init Dmitry Baryshkov
2024-01-26 22:20 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 05/15] drm/msm/dp: fold dp_power into dp_ctrl module Dmitry Baryshkov
2024-01-26 22:20 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 06/15] drm/msm/dp: simplify stream clocks handling Dmitry Baryshkov
2024-01-26 22:21 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 07/15] drm/msm/dp: stop parsing clock names from DT Dmitry Baryshkov
2024-01-26 22:21 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 08/15] drm/msm/dp: split dp_ctrl_clk_enable into four functuions Dmitry Baryshkov
2024-01-26 22:22 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 09/15] drm/msm/dp: move phy_configure_opts to dp_ctrl Dmitry Baryshkov
2024-01-26 22:23 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 10/15] drm/msm/dp: remove PHY handling from dp_catalog.c Dmitry Baryshkov
2024-01-26 22:23 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 11/15] drm/msm/dp: handle PHY directly in dp_ctrl Dmitry Baryshkov
2024-01-26 22:23 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 12/15] drm/msm/dp: move all IO handling to dp_catalog Dmitry Baryshkov
2024-01-26 22:24 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 13/15] drm/msm/dp: move link property handling to dp_panel Dmitry Baryshkov
2024-01-26 22:24 ` Kuogee Hsieh
2024-01-26 18:26 ` [PATCH RESEND v3 14/15] drm/msm/dp: move next_bridge handling to dp_display Dmitry Baryshkov
2024-01-26 22:25 ` Kuogee Hsieh [this message]
2024-01-26 18:26 ` [PATCH RESEND v3 15/15] drm/msm/dp: drop dp_parser Dmitry Baryshkov
2024-01-26 22:25 ` Kuogee Hsieh
2024-01-26 20:23 ` [PATCH RESEND v3 00/15] drm/msm/dp: clear power and parser submodules away Dmitry Baryshkov
2024-02-19 12:30 ` 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=0baffdcb-80bd-63ff-e78c-c067d8df1bc9@quicinc.com \
--to=quic_khsieh@quicinc.com \
--cc=airlied@gmail.com \
--cc=andersson@kernel.org \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=konrad.dybcio@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=quic_abhinavk@quicinc.com \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.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