From: Kuogee Hsieh <quic_khsieh@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Rob Clark <robdclark@gmail.com>, Sean Paul <sean@poorly.run>,
Abhinav Kumar <quic_abhinavk@quicinc.com>
Cc: Stephen Boyd <swboyd@chromium.org>,
David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
<linux-arm-msm@vger.kernel.org>,
<dri-devel@lists.freedesktop.org>,
<freedreno@lists.freedesktop.org>
Subject: Re: [RFC PATCH v2 2/5] drm/msm/dp: support attaching bridges to the DP encoder
Date: Wed, 23 Feb 2022 09:47:54 -0800 [thread overview]
Message-ID: <2e253aa8-d405-c4b9-fd11-6797503c9d44@quicinc.com> (raw)
In-Reply-To: <20220211224006.1797846-3-dmitry.baryshkov@linaro.org>
On 2/11/2022 2:40 PM, Dmitry Baryshkov wrote:
> Currently DP driver will allocate panel bridge for eDP panels. This
> supports only the following topology:
>
> - eDP encoder ⇒ eDP panel (wrapped using panel-bridge)
>
> Simplify this code to just check if there is any next bridge in the
> chain (be it a panel bridge or regular bridge). Rename panel_bridge
> field to next_bridge accordingly.
>
> This allows one to use e.g. one of the following display topologies:
>
> - eDP encoder ⇒ ptn3460 ⇒ fixed LVDS panel
> - eDP encoder ⇒ ptn3460 ⇒ LVDS connector with EDID lines for panel autodetect
> - eDP encoder ⇒ ptn3460 ⇒ THC63LVD1024 ⇒ DPI panel.
> - eDP encoder ⇒ LT8912 ⇒ DSI panel
>
> Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> ---
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> drivers/gpu/drm/msm/dp/dp_display.c | 2 +-
> drivers/gpu/drm/msm/dp/dp_display.h | 2 +-
> drivers/gpu/drm/msm/dp/dp_drm.c | 4 ++--
> drivers/gpu/drm/msm/dp/dp_parser.c | 31 +++++++++++++++--------------
> drivers/gpu/drm/msm/dp/dp_parser.h | 2 +-
> 5 files changed, 21 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index 44d42c76c2a3..45f9a912ecc5 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -266,7 +266,7 @@ static int dp_display_bind(struct device *dev, struct device *master,
> goto end;
> }
>
> - dp->dp_display.panel_bridge = dp->parser->panel_bridge;
> + dp->dp_display.next_bridge = dp->parser->next_bridge;
>
> dp->aux->drm_dev = drm;
> rc = dp_aux_register(dp->aux);
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.h b/drivers/gpu/drm/msm/dp/dp_display.h
> index e3adcd578a90..7af2b186d2d9 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.h
> +++ b/drivers/gpu/drm/msm/dp/dp_display.h
> @@ -16,7 +16,7 @@ struct msm_dp {
> struct drm_bridge *bridge;
> struct drm_connector *connector;
> struct drm_encoder *encoder;
> - struct drm_bridge *panel_bridge;
> + struct drm_bridge *next_bridge;
> bool is_connected;
> bool audio_enabled;
> bool power_on;
> diff --git a/drivers/gpu/drm/msm/dp/dp_drm.c b/drivers/gpu/drm/msm/dp/dp_drm.c
> index 26ef41a4c1b6..80f59cf99089 100644
> --- a/drivers/gpu/drm/msm/dp/dp_drm.c
> +++ b/drivers/gpu/drm/msm/dp/dp_drm.c
> @@ -236,9 +236,9 @@ struct drm_bridge *msm_dp_bridge_init(struct msm_dp *dp_display, struct drm_devi
> return ERR_PTR(rc);
> }
>
> - if (dp_display->panel_bridge) {
> + if (dp_display->next_bridge) {
> rc = drm_bridge_attach(dp_display->encoder,
> - dp_display->panel_bridge, bridge,
> + dp_display->next_bridge, bridge,
> DRM_BRIDGE_ATTACH_NO_CONNECTOR);
> if (rc < 0) {
> DRM_ERROR("failed to attach panel bridge: %d\n", rc);
> diff --git a/drivers/gpu/drm/msm/dp/dp_parser.c b/drivers/gpu/drm/msm/dp/dp_parser.c
> index a7acc23f742b..901d7967370f 100644
> --- a/drivers/gpu/drm/msm/dp/dp_parser.c
> +++ b/drivers/gpu/drm/msm/dp/dp_parser.c
> @@ -265,23 +265,16 @@ static int dp_parser_clock(struct dp_parser *parser)
> return 0;
> }
>
> -static int dp_parser_find_panel(struct dp_parser *parser)
> +static int dp_parser_find_next_bridge(struct dp_parser *parser)
> {
> struct device *dev = &parser->pdev->dev;
> - struct drm_panel *panel;
> - int rc;
> + struct drm_bridge *bridge;
>
> - rc = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL);
> - if (rc) {
> - DRM_ERROR("failed to acquire DRM panel: %d\n", rc);
> - return rc;
> - }
> + bridge = devm_drm_of_get_bridge(dev, dev->of_node, 1, 0);
> + if (IS_ERR(bridge))
> + return PTR_ERR(bridge);
>
> - parser->panel_bridge = devm_drm_panel_bridge_add(dev, panel);
> - if (IS_ERR(parser->panel_bridge)) {
> - DRM_ERROR("failed to create panel bridge\n");
> - return PTR_ERR(parser->panel_bridge);
> - }
> + parser->next_bridge = bridge;
>
> return 0;
> }
> @@ -307,10 +300,18 @@ static int dp_parser_parse(struct dp_parser *parser, int connector_type)
> if (rc)
> return rc;
>
> + /*
> + * Currently we support external bridges only for eDP connectors.
> + *
> + * No external bridges are expected for the DisplayPort connector,
> + * it is physically present in a form of a DP or USB-C connector.
> + */
> if (connector_type == DRM_MODE_CONNECTOR_eDP) {
> - rc = dp_parser_find_panel(parser);
> - if (rc)
> + rc = dp_parser_find_next_bridge(parser);
> + if (rc) {
> + DRM_ERROR("DP: failed to find next bridge\n");
> return rc;
> + }
> }
>
> /* Map the corresponding regulator information according to
> diff --git a/drivers/gpu/drm/msm/dp/dp_parser.h b/drivers/gpu/drm/msm/dp/dp_parser.h
> index 3172da089421..4cec851e38d9 100644
> --- a/drivers/gpu/drm/msm/dp/dp_parser.h
> +++ b/drivers/gpu/drm/msm/dp/dp_parser.h
> @@ -123,7 +123,7 @@ struct dp_parser {
> struct dp_display_data disp_data;
> const struct dp_regulator_cfg *regulator_cfg;
> u32 max_dp_lanes;
> - struct drm_bridge *panel_bridge;
> + struct drm_bridge *next_bridge;
>
> int (*parse)(struct dp_parser *parser, int connector_type);
> };
next prev parent reply other threads:[~2022-02-23 17:48 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-11 22:40 [RFC PATCH v2 0/5] Simplify and correct msm/dp bridge implementation Dmitry Baryshkov
2022-02-11 22:40 ` [RFC PATCH v2 1/5] drm/msm/dp: fix panel bridge attachment Dmitry Baryshkov
2022-02-18 21:14 ` Kuogee Hsieh
2022-02-18 23:56 ` Stephen Boyd
2022-02-19 2:26 ` Dmitry Baryshkov
2022-02-24 18:25 ` [Freedreno] " Abhinav Kumar
2022-02-24 20:41 ` Dmitry Baryshkov
2022-02-25 2:01 ` Abhinav Kumar
2022-02-25 4:22 ` Dmitry Baryshkov
2022-02-25 4:45 ` Abhinav Kumar
2022-02-25 9:04 ` Dmitry Baryshkov
2022-02-25 17:11 ` Abhinav Kumar
2022-02-25 17:25 ` Dmitry Baryshkov
2022-02-11 22:40 ` [RFC PATCH v2 2/5] drm/msm/dp: support attaching bridges to the DP encoder Dmitry Baryshkov
2022-02-18 21:28 ` Kuogee Hsieh
2022-02-18 21:31 ` Dmitry Baryshkov
2022-02-18 23:38 ` Stephen Boyd
2022-02-23 17:47 ` Kuogee Hsieh [this message]
2022-02-24 19:56 ` Abhinav Kumar
2022-02-11 22:40 ` [RFC PATCH v2 3/5] drm/msm/dp: support finding next bridge even for DP interfaces Dmitry Baryshkov
2022-02-18 21:29 ` Kuogee Hsieh
2022-02-19 0:34 ` Stephen Boyd
2022-02-24 20:13 ` Abhinav Kumar
2022-02-24 20:49 ` Dmitry Baryshkov
2022-02-24 21:09 ` Abhinav Kumar
2022-02-11 22:40 ` [RFC PATCH v2 4/5] drm/msm/dp: replace dp_connector with drm_bridge_connector Dmitry Baryshkov
2022-02-18 21:31 ` Kuogee Hsieh
2022-02-18 21:52 ` Dmitry Baryshkov
2022-02-18 22:32 ` Dmitry Baryshkov
2022-02-19 0:55 ` Stephen Boyd
2022-02-19 2:22 ` Dmitry Baryshkov
2022-02-23 17:21 ` Kuogee Hsieh
2022-02-23 18:22 ` Dmitry Baryshkov
2022-02-23 18:27 ` Kuogee Hsieh
2022-02-23 18:45 ` Dmitry Baryshkov
2022-02-23 21:33 ` Stephen Boyd
2022-02-24 0:40 ` Kuogee Hsieh
[not found] ` <64a5ae1a-df65-b0a5-5d0d-cfb1d4da3bf7@quicinc.com>
2022-03-16 16:45 ` Sankeerth Billakanti (QUIC)
2022-04-14 20:17 ` Abhinav Kumar
2022-02-11 22:40 ` [RFC PATCH v2 5/5] drm/msm/dp: remove extra wrappers and public functions Dmitry Baryshkov
[not found] ` <26549f55-6195-a7ec-5896-de5f986ad716@quicinc.com>
2022-03-16 16:31 ` Sankeerth Billakanti (QUIC)
2022-04-14 20:17 ` 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=2e253aa8-d405-c4b9-fd11-6797503c9d44@quicinc.com \
--to=quic_khsieh@quicinc.com \
--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=linux-arm-msm@vger.kernel.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