mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Sankeerth Billakanti (QUIC)" <quic_sbillaka@quicinc.com>
To: Stephen Boyd <swboyd@chromium.org>,
	"Sankeerth Billakanti (QUIC)" <quic_sbillaka@quicinc.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"dri-devel@lists.freedesktop.org"
	<dri-devel@lists.freedesktop.org>,
	"freedreno@lists.freedesktop.org"
	<freedreno@lists.freedesktop.org>,
	"linux-arm-msm@vger.kernel.org" <linux-arm-msm@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: "robdclark@gmail.com" <robdclark@gmail.com>,
	"seanpaul@chromium.org" <seanpaul@chromium.org>,
	quic_kalyant <quic_kalyant@quicinc.com>,
	"Abhinav Kumar (QUIC)" <quic_abhinavk@quicinc.com>,
	"dianders@chromium.org" <dianders@chromium.org>,
	"Kuogee Hsieh (QUIC)" <quic_khsieh@quicinc.com>,
	"bjorn.andersson@linaro.org" <bjorn.andersson@linaro.org>,
	"sean@poorly.run" <sean@poorly.run>,
	"airlied@linux.ie" <airlied@linux.ie>,
	"daniel@ffwll.ch" <daniel@ffwll.ch>,
	"dmitry.baryshkov@linaro.org" <dmitry.baryshkov@linaro.org>,
	quic_vproddut <quic_vproddut@quicinc.com>,
	"Aravind Venkateswaran (QUIC)" <quic_aravindh@quicinc.com>,
	"steev@kali.org" <steev@kali.org>
Subject: RE: [PATCH v9 1/4] drm/msm/dp: Add eDP support via aux_bus
Date: Mon, 25 Apr 2022 09:39:43 +0000	[thread overview]
Message-ID: <MW4PR02MB7186108BA0131C8BFC46A219E1F89@MW4PR02MB7186.namprd02.prod.outlook.com> (raw)
In-Reply-To: <CAE-0n51VBDmOOworjpuB1nqVD-7055yqvn2Er5H13qgFC5R2AQ@mail.gmail.com>

Hi Stephen,

>Quoting Sankeerth Billakanti (2022-04-22 02:11:03)
>> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c
>> b/drivers/gpu/drm/msm/dp/dp_display.c
>> index d7a19d6..055681a 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_display.c
>> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
>
>Some nitpicks
>
>Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>
>> @@ -1508,7 +1509,8 @@ void msm_dp_irq_postinstall(struct msm_dp
>> *dp_display)
>>
>>         dp_hpd_event_setup(dp);
>>
>> -       dp_add_event(dp, EV_HPD_INIT_SETUP, 0, 100);
>> +       if (!dp_display->is_edp)
>> +               dp_add_event(dp, EV_HPD_INIT_SETUP, 0, 100);
>
>Did it turn out that in fact DP isn't ready still to setup even after delaying the
>irq?
>

The host_init, config_hpd, phy_init and enable_irq are happening in modeset_init already for eDP.
So, I am not scheduling the EV_HPD_INIT_SETUP event for eDP. I am not modifying the delay for DP.

>>  }
>>
>>  void msm_dp_debugfs_init(struct msm_dp *dp_display, struct drm_minor
>> *minor) @@ -1530,6 +1532,65 @@ void msm_dp_debugfs_init(struct
>msm_dp *dp_display, struct drm_minor *minor)
>>         }
>>  }
>>
>> +static int dp_display_get_next_bridge(struct msm_dp *dp) {
>> +       int rc;
>> +       struct dp_display_private *dp_priv;
>> +       struct device_node *aux_bus;
>> +       struct device *dev;
>> +
>> +       dp_priv = container_of(dp, struct dp_display_private, dp_display);
>> +       dev = &dp_priv->pdev->dev;
>> +       aux_bus = of_get_child_by_name(dev->of_node, "aux-bus");
>> +
>> +       if (aux_bus && dp->is_edp) {
>> +               dp_display_host_init(dp_priv);
>> +               dp_catalog_ctrl_hpd_config(dp_priv->catalog);
>> +               dp_display_host_phy_init(dp_priv);
>> +               enable_irq(dp_priv->irq);
>> +
>> +               /*
>> +                * The code below assumes that the panel will finish probing
>> +                * by the time devm_of_dp_aux_populate_ep_devices() returns.
>> +                * This isn't a great assumption since it will fail if the
>> +                * panel driver is probed asynchronously but is the best we
>> +                * can do without a bigger driver reorganization.
>> +                */
>> +               rc = devm_of_dp_aux_populate_ep_devices(dp_priv->aux);
>> +               of_node_put(aux_bus);
>> +               if (rc)
>> +                       goto error;
>> +       } else if (dp->is_edp) {
>> +               DRM_ERROR("eDP aux_bus not found\n");
>> +               return -ENODEV;
>> +       }
>> +
>> +       /*
>> +        * 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 = dp_parser_find_next_bridge(dp_priv->parser);
>> +       if (!dp->is_edp && rc == -ENODEV)
>> +               return 0;
>> +       else if (rc)
>
>Just an if because there's a return above.
>

Okay

>> +               goto error;
>> +
>> +       dp->next_bridge = dp_priv->parser->next_bridge;
>
>In which case it almost feels like it could be written
>
>	if (!dp->is_edp && rc == -ENODEV)
>		return 0;
>	if (!rc) {
>		dp->next_bridge = dp_priv->parser->next_bridge;
>		return 0;
>	}
>error:
>	if (dp->is_edp) {
>
>but I'm not worried either way, besides removing the else from the else-if.
>

Okay

>> +
>> +       return 0;
>> +
>> +error:
>> +       if (dp->is_edp) {
>> +               disable_irq(dp_priv->irq);
>> +               dp_display_host_phy_exit(dp_priv);
>> +               dp_display_host_deinit(dp_priv);
>> +       }
>> +       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.h
>> b/drivers/gpu/drm/msm/dp/dp_parser.h
>> index d371bae..950416c 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_parser.h
>> +++ b/drivers/gpu/drm/msm/dp/dp_parser.h
>> @@ -125,7 +125,7 @@ struct dp_parser {
>>         u32 max_dp_lanes;
>>         struct drm_bridge *next_bridge;
>>
>> -       int (*parse)(struct dp_parser *parser, int connector_type);
>> +       int (*parse)(struct dp_parser *parser);
>>  };
>>
>>  /**
>> @@ -141,4 +141,15 @@ struct dp_parser {
>>   */
>>  struct dp_parser *dp_parser_get(struct platform_device *pdev);
>>
>> +/**
>> + * dp_parser_find_next_bridge() - find an additional bridge to DP
>> + *
>> + * @parser: dp_parser data from client
>> + * return: 0 if able to get the bridge else return an error code
>
>return comes after the description below. Also should be capitalized.
>You can check this by compiling with W=1 I believe, or run the kernel doc
>format script on the file..
>

Okay

>> + *
>> + * 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
>

Okay

>> + */
>> +int dp_parser_find_next_bridge(struct dp_parser *parser);
>> +

  reply	other threads:[~2022-04-25  9:40 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-22  9:11 [PATCH v9 0/4] Add support for the eDP panel over aux_bus Sankeerth Billakanti
2022-04-22  9:11 ` [PATCH v9 1/4] drm/msm/dp: Add eDP support via aux_bus Sankeerth Billakanti
2022-04-22 14:03   ` Doug Anderson
2022-04-23  0:13   ` Stephen Boyd
2022-04-25  9:39     ` Sankeerth Billakanti (QUIC) [this message]
2022-04-25 20:26       ` Stephen Boyd
2022-04-25 21:12         ` Dmitry Baryshkov
2022-04-26  1:58           ` Sankeerth Billakanti (QUIC)
2022-04-22  9:11 ` [PATCH v9 2/4] drm/msm/dp: Support only IRQ_HPD and REPLUG interrupts for eDP Sankeerth Billakanti
2022-04-22 14:03   ` Doug Anderson
2022-04-22 15:55   ` Doug Anderson
2022-04-22 16:04     ` Abhinav Kumar
2022-04-22 16:10       ` Doug Anderson
2022-04-22 17:35         ` Abhinav Kumar
2022-04-23  0:29   ` Stephen Boyd
2022-04-25  2:55     ` Sankeerth Billakanti (QUIC)
2022-04-25 20:27       ` Stephen Boyd
2022-04-26  3:45         ` Sankeerth Billakanti (QUIC)
2022-04-22  9:11 ` [PATCH v9 3/4] drm/msm/dp: wait for hpd high before aux transaction Sankeerth Billakanti
2022-04-23  1:38   ` Stephen Boyd
2022-04-22  9:11 ` [PATCH v9 4/4] drm/msm/dp: Support the eDP modes given by panel Sankeerth Billakanti
2022-04-23  1:39   ` Stephen Boyd

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=MW4PR02MB7186108BA0131C8BFC46A219E1F89@MW4PR02MB7186.namprd02.prod.outlook.com \
    --to=quic_sbillaka@quicinc.com \
    --cc=airlied@linux.ie \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel@ffwll.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=dianders@chromium.org \
    --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=quic_abhinavk@quicinc.com \
    --cc=quic_aravindh@quicinc.com \
    --cc=quic_kalyant@quicinc.com \
    --cc=quic_khsieh@quicinc.com \
    --cc=quic_vproddut@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=seanpaul@chromium.org \
    --cc=steev@kali.org \
    --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

all inboxes | Powered by JetHome®