Linux ARM-MSM sub-architecture
 help / color / mirror / Atom feed
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 11/15] drm/msm/dp: handle PHY directly in dp_ctrl
Date: Fri, 26 Jan 2024 14:23:46 -0800	[thread overview]
Message-ID: <edfc04f2-d7d5-0d04-6c8d-4f17f9bb6a32@quicinc.com> (raw)
In-Reply-To: <20240126-dp-power-parser-cleanup-v3-11-098d5f581dd3@linaro.org>


On 1/26/2024 10:26 AM, Dmitry Baryshkov wrote:
> There is little point in going trough dp_parser->io indirection each
> time the driver needs to access the PHY. Store the pointer directly in
> dp_ctrl_private.
>
> 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_ctrl.c    | 37 +++++++++++++------------------------
>   drivers/gpu/drm/msm/dp/dp_ctrl.h    |  2 +-
>   drivers/gpu/drm/msm/dp/dp_display.c |  3 ++-
>   3 files changed, 16 insertions(+), 26 deletions(-)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> index 4aea72a2b8e8..fc7ce315ae41 100644
> --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
> +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
> @@ -76,9 +76,10 @@ struct dp_ctrl_private {
>   	struct drm_dp_aux *aux;
>   	struct dp_panel *panel;
>   	struct dp_link *link;
> -	struct dp_parser *parser;
>   	struct dp_catalog *catalog;
>   
> +	struct phy *phy;
> +
>   	unsigned int num_core_clks;
>   	struct clk_bulk_data *core_clks;
>   
> @@ -1028,7 +1029,7 @@ static int dp_ctrl_set_vx_px(struct dp_ctrl_private *ctrl,
>   	phy_opts->dp.voltage[0] = v_level;
>   	phy_opts->dp.pre[0] = p_level;
>   	phy_opts->dp.set_voltages = 1;
> -	phy_configure(ctrl->parser->io.phy, phy_opts);
> +	phy_configure(ctrl->phy, phy_opts);
>   	phy_opts->dp.set_voltages = 0;
>   
>   	return 0;
> @@ -1442,7 +1443,7 @@ static void dp_ctrl_link_clk_disable(struct dp_ctrl *dp_ctrl)
>   static int dp_ctrl_enable_mainlink_clocks(struct dp_ctrl_private *ctrl)
>   {
>   	int ret = 0;
> -	struct phy *phy = ctrl->parser->io.phy;
> +	struct phy *phy = ctrl->phy;
>   	const u8 *dpcd = ctrl->panel->dpcd;
>   
>   	ctrl->phy_opts.dp.lanes = ctrl->link->link_params.num_lanes;
> @@ -1540,12 +1541,10 @@ void dp_ctrl_set_psr(struct dp_ctrl *dp_ctrl, bool enter)
>   void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl)
>   {
>   	struct dp_ctrl_private *ctrl;
> -	struct dp_io *dp_io;
>   	struct phy *phy;
>   
>   	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
> -	dp_io = &ctrl->parser->io;
> -	phy = dp_io->phy;
> +	phy = ctrl->phy;
>   
>   	dp_catalog_ctrl_phy_reset(ctrl->catalog);
>   	phy_init(phy);
> @@ -1557,12 +1556,10 @@ void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl)
>   void dp_ctrl_phy_exit(struct dp_ctrl *dp_ctrl)
>   {
>   	struct dp_ctrl_private *ctrl;
> -	struct dp_io *dp_io;
>   	struct phy *phy;
>   
>   	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
> -	dp_io = &ctrl->parser->io;
> -	phy = dp_io->phy;
> +	phy = ctrl->phy;
>   
>   	dp_catalog_ctrl_phy_reset(ctrl->catalog);
>   	phy_exit(phy);
> @@ -1587,7 +1584,7 @@ static bool dp_ctrl_use_fixed_nvid(struct dp_ctrl_private *ctrl)
>   
>   static int dp_ctrl_reinitialize_mainlink(struct dp_ctrl_private *ctrl)
>   {
> -	struct phy *phy = ctrl->parser->io.phy;
> +	struct phy *phy = ctrl->phy;
>   	int ret = 0;
>   
>   	dp_catalog_ctrl_mainlink_ctrl(ctrl->catalog, false);
> @@ -1617,11 +1614,9 @@ static int dp_ctrl_reinitialize_mainlink(struct dp_ctrl_private *ctrl)
>   
>   static int dp_ctrl_deinitialize_mainlink(struct dp_ctrl_private *ctrl)
>   {
> -	struct dp_io *dp_io;
>   	struct phy *phy;
>   
> -	dp_io = &ctrl->parser->io;
> -	phy = dp_io->phy;
> +	phy = ctrl->phy;
>   
>   	dp_catalog_ctrl_mainlink_ctrl(ctrl->catalog, false);
>   
> @@ -2047,12 +2042,10 @@ int dp_ctrl_on_stream(struct dp_ctrl *dp_ctrl, bool force_link_train)
>   void dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl)
>   {
>   	struct dp_ctrl_private *ctrl;
> -	struct dp_io *dp_io;
>   	struct phy *phy;
>   
>   	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
> -	dp_io = &ctrl->parser->io;
> -	phy = dp_io->phy;
> +	phy = ctrl->phy;
>   
>   	/* set dongle to D3 (power off) mode */
>   	dp_link_psm_config(ctrl->link, &ctrl->panel->link_info, true);
> @@ -2080,12 +2073,10 @@ void dp_ctrl_off_link_stream(struct dp_ctrl *dp_ctrl)
>   void dp_ctrl_off_link(struct dp_ctrl *dp_ctrl)
>   {
>   	struct dp_ctrl_private *ctrl;
> -	struct dp_io *dp_io;
>   	struct phy *phy;
>   
>   	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
> -	dp_io = &ctrl->parser->io;
> -	phy = dp_io->phy;
> +	phy = ctrl->phy;
>   
>   	dp_catalog_ctrl_mainlink_ctrl(ctrl->catalog, false);
>   
> @@ -2103,12 +2094,10 @@ void dp_ctrl_off_link(struct dp_ctrl *dp_ctrl)
>   void dp_ctrl_off(struct dp_ctrl *dp_ctrl)
>   {
>   	struct dp_ctrl_private *ctrl;
> -	struct dp_io *dp_io;
>   	struct phy *phy;
>   
>   	ctrl = container_of(dp_ctrl, struct dp_ctrl_private, dp_ctrl);
> -	dp_io = &ctrl->parser->io;
> -	phy = dp_io->phy;
> +	phy = ctrl->phy;
>   
>   	dp_catalog_ctrl_mainlink_ctrl(ctrl->catalog, false);
>   
> @@ -2225,7 +2214,7 @@ static int dp_ctrl_clk_init(struct dp_ctrl *dp_ctrl)
>   struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link,
>   			struct dp_panel *panel,	struct drm_dp_aux *aux,
>   			struct dp_catalog *catalog,
> -			struct dp_parser *parser)
> +			struct phy *phy)
>   {
>   	struct dp_ctrl_private *ctrl;
>   	int ret;
> @@ -2259,12 +2248,12 @@ struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link,
>   	init_completion(&ctrl->video_comp);
>   
>   	/* in parameters */
> -	ctrl->parser   = parser;
>   	ctrl->panel    = panel;
>   	ctrl->aux      = aux;
>   	ctrl->link     = link;
>   	ctrl->catalog  = catalog;
>   	ctrl->dev      = dev;
> +	ctrl->phy      = phy;
>   
>   	ret = dp_ctrl_clk_init(&ctrl->dp_ctrl);
>   	if (ret) {
> diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.h b/drivers/gpu/drm/msm/dp/dp_ctrl.h
> index 023f14d0b021..6e9f375b856a 100644
> --- a/drivers/gpu/drm/msm/dp/dp_ctrl.h
> +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.h
> @@ -28,7 +28,7 @@ void dp_ctrl_handle_sink_request(struct dp_ctrl *dp_ctrl);
>   struct dp_ctrl *dp_ctrl_get(struct device *dev, struct dp_link *link,
>   			struct dp_panel *panel,	struct drm_dp_aux *aux,
>   			struct dp_catalog *catalog,
> -			struct dp_parser *parser);
> +			struct phy *phy);
>   
>   void dp_ctrl_reset_irq_ctrl(struct dp_ctrl *dp_ctrl, bool enable);
>   void dp_ctrl_phy_init(struct dp_ctrl *dp_ctrl);
> diff --git a/drivers/gpu/drm/msm/dp/dp_display.c b/drivers/gpu/drm/msm/dp/dp_display.c
> index c1a51c498e01..b8388e04bd0f 100644
> --- a/drivers/gpu/drm/msm/dp/dp_display.c
> +++ b/drivers/gpu/drm/msm/dp/dp_display.c
> @@ -760,7 +760,8 @@ static int dp_init_sub_modules(struct dp_display_private *dp)
>   	}
>   
>   	dp->ctrl = dp_ctrl_get(dev, dp->link, dp->panel, dp->aux,
> -			       dp->catalog, dp->parser);
> +			       dp->catalog,
> +			       dp->parser->io.phy);
>   	if (IS_ERR(dp->ctrl)) {
>   		rc = PTR_ERR(dp->ctrl);
>   		DRM_ERROR("failed to initialize ctrl, rc = %d\n", rc);
>

  reply	other threads:[~2024-01-26 22:23 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 [this message]
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
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=edfc04f2-d7d5-0d04-6c8d-4f17f9bb6a32@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