All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Boyd <swboyd@chromium.org>
To: Kuogee Hsieh <quic_khsieh@quicinc.com>,
	agross@kernel.org, airlied@linux.ie, bjorn.andersson@linaro.org,
	daniel@ffwll.ch, dianders@chromium.org,
	dmitry.baryshkov@linaro.org, dri-devel@lists.freedesktop.org,
	robdclark@gmail.com, sean@poorly.run, vkoul@kernel.org
Cc: quic_abhinavk@quicinc.com, quic_aravindh@quicinc.com,
	quic_sbillaka@quicinc.com, freedreno@lists.freedesktop.org,
	linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v1 2/3] drm/msm/dp: decoupling dp->id out of dp controller_id at scxxxx_dp_cfg table
Date: Fri, 24 Jun 2022 15:19:11 -0700	[thread overview]
Message-ID: <CAE-0n51g-EVsC-i9=sJV-ySa8VnE+yT7cg=b-TNMi9+3uBiOVA@mail.gmail.com> (raw)
In-Reply-To: <fa7f8bf1-33cd-5515-0143-6596df2bd740@quicinc.com>

Quoting Kuogee Hsieh (2022-06-24 14:49:57)
>
> On 6/24/2022 2:40 PM, Stephen Boyd wrote:
> > Quoting Kuogee Hsieh (2022-06-24 14:17:50)
> >> On 6/24/2022 1:00 PM, Stephen Boyd wrote:
> >>> Quoting Kuogee Hsieh (2022-06-24 10:15:11)
> >>>> Current the index (dp->id) of DP descriptor table (scxxxx_dp_cfg[]) are tightly
> >>>> coupled with DP controller_id. This means DP use controller id 0 must be placed
> >>>> at first entry of DP descriptor table (scxxxx_dp_cfg[]). Otherwise the internal
> >>>> INTF will mismatch controller_id. This will cause controller kickoff wrong
> >>>> interface timing engine and cause dpu_encoder_phys_vid_wait_for_commit_done
> >>>> vblank timeout error.
> >>>>
> >>>> This patch add controller_id field into struct msm_dp_desc to break the tightly
> >>>> coupled relationship between index (dp->id) of DP descriptor table with DP
> >>>> controller_id.
> >>> Please no. This reverts the intention of commit bb3de286d992
> >>> ("drm/msm/dp: Support up to 3 DP controllers")
> >>>
> >>>       A new enum is introduced to document the connection between the
> >>>       instances referenced in the dpu_intf_cfg array and the controllers in
> >>>       the DP driver and sc7180 is updated.
> >>>
> >>> It sounds like the intent of that commit failed to make a strong enough
> >>> connection. Now it needs to match the INTF number as well? I can't
> >>> really figure out what is actually wrong, because this patch undoes that
> >>> intentional tight coupling. Is the next patch the important part that
> >>> flips the order of the two interfaces?
> >> The commit bb3de286d992have two problems,
> >>
> >> 1)  The below sc7280_dp_cfg will not work, if eDP use
> >> MSM_DP_CONTROLLER_2 instead of  MSM_DP_CONTROLLER_1
> > Why would we use three indices for an soc that only has two indices
> > possible? This is not a real problem?
>
> I do not what will happen at future, it may have more dp controller use
> late.
>
> at current soc, below table has only one eDP will not work either.
>
> static const struct msm_dp_config sc7280_dp_cfg = {
>           .descs = (const struct msm_dp_desc[]) {
>                   [MSM_DP_CONTROLLER_1] = { .io_start = 0x0aea0000,
> .connector_type = DRM_MODE_CONNECTOR_eDP, .wide_bus_en = true },
>
>           .num_descs = 1,

So the MSM_DP_CONTROLLER_* number needs to match what exactly?

>
> >
> >> since it have num_descs =2 but eDP is at index 2 (CONTROLLER_2) which
> >> never be reached.
> >>
> >> static const struct msm_dp_config sc7280_dp_cfg = {
> >>           .descs = (const struct msm_dp_desc[]) {
> >>                   [MSM_DP_CONTROLLER_2] = { .io_start = 0x0aea0000,
> >> .connector_type = DRM_MODE_CONNECTOR_eDP, .wide_bus_en = true },
> >>                   [MSM_DP_CONTROLLER_0] = { .io_start = 0x0ae90000,
> >> .connector_type = DRM_MODE_CONNECTOR_DisplayPort, .wide_bus_en = true },
> >>           },
> >>           .num_descs = 2,
> >> };
> >>
> >> 2)  DP always has index of 0 (dp->id = 0) and the first one to call
> >> msm_dp_modeset_init(). This make DP always place at head of bridge chain.
> > What does this mean? Are you talking about the list of bridges in drm
> > core, i.e. 'bridge_list'?
> yes,

I changed the drm_bridge_add() API and that doesn't make any difference.
The corruption is still seen. That would imply it is not the order of
the list of bridges.

---8<---
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index e275b4ca344b..e3518101b65e 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -165,7 +165,7 @@ void drm_bridge_add(struct drm_bridge *bridge)
 	mutex_init(&bridge->hpd_mutex);

 	mutex_lock(&bridge_lock);
-	list_add_tail(&bridge->list, &bridge_list);
+	list_add(&bridge->list, &bridge_list);
 	mutex_unlock(&bridge_lock);
 }
 EXPORT_SYMBOL(drm_bridge_add);

> >
> >> At next patch eDP must be placed at head of bridge chain to fix eDP
> >> corruption issue. This is the purpose of this patch. I will revise the
> >> commit text.
> >>
> > Wouldn't that be "broken" again if we decided to change drm_bridge_add()
> > to add to the list head instead of list tail? Or if somehow
> > msm_dp_modeset_init() was called in a different order so that the DP
> > bridge was added before the eDP bridge?
>
> we have no control of drm_bridge_add().
>
> Since drm perform screen update following bridge chain sequentially, we
> have to make sure primary always update first.
>

WARNING: multiple messages have this Message-ID (diff)
From: Stephen Boyd <swboyd@chromium.org>
To: Kuogee Hsieh <quic_khsieh@quicinc.com>,
	agross@kernel.org, airlied@linux.ie, bjorn.andersson@linaro.org,
	daniel@ffwll.ch, dianders@chromium.org,
	 dmitry.baryshkov@linaro.org, dri-devel@lists.freedesktop.org,
	 robdclark@gmail.com, sean@poorly.run, vkoul@kernel.org
Cc: quic_sbillaka@quicinc.com, linux-arm-msm@vger.kernel.org,
	quic_abhinavk@quicinc.com, linux-kernel@vger.kernel.org,
	quic_aravindh@quicinc.com, freedreno@lists.freedesktop.org
Subject: Re: [PATCH v1 2/3] drm/msm/dp: decoupling dp->id out of dp controller_id at scxxxx_dp_cfg table
Date: Fri, 24 Jun 2022 15:19:11 -0700	[thread overview]
Message-ID: <CAE-0n51g-EVsC-i9=sJV-ySa8VnE+yT7cg=b-TNMi9+3uBiOVA@mail.gmail.com> (raw)
In-Reply-To: <fa7f8bf1-33cd-5515-0143-6596df2bd740@quicinc.com>

Quoting Kuogee Hsieh (2022-06-24 14:49:57)
>
> On 6/24/2022 2:40 PM, Stephen Boyd wrote:
> > Quoting Kuogee Hsieh (2022-06-24 14:17:50)
> >> On 6/24/2022 1:00 PM, Stephen Boyd wrote:
> >>> Quoting Kuogee Hsieh (2022-06-24 10:15:11)
> >>>> Current the index (dp->id) of DP descriptor table (scxxxx_dp_cfg[]) are tightly
> >>>> coupled with DP controller_id. This means DP use controller id 0 must be placed
> >>>> at first entry of DP descriptor table (scxxxx_dp_cfg[]). Otherwise the internal
> >>>> INTF will mismatch controller_id. This will cause controller kickoff wrong
> >>>> interface timing engine and cause dpu_encoder_phys_vid_wait_for_commit_done
> >>>> vblank timeout error.
> >>>>
> >>>> This patch add controller_id field into struct msm_dp_desc to break the tightly
> >>>> coupled relationship between index (dp->id) of DP descriptor table with DP
> >>>> controller_id.
> >>> Please no. This reverts the intention of commit bb3de286d992
> >>> ("drm/msm/dp: Support up to 3 DP controllers")
> >>>
> >>>       A new enum is introduced to document the connection between the
> >>>       instances referenced in the dpu_intf_cfg array and the controllers in
> >>>       the DP driver and sc7180 is updated.
> >>>
> >>> It sounds like the intent of that commit failed to make a strong enough
> >>> connection. Now it needs to match the INTF number as well? I can't
> >>> really figure out what is actually wrong, because this patch undoes that
> >>> intentional tight coupling. Is the next patch the important part that
> >>> flips the order of the two interfaces?
> >> The commit bb3de286d992have two problems,
> >>
> >> 1)  The below sc7280_dp_cfg will not work, if eDP use
> >> MSM_DP_CONTROLLER_2 instead of  MSM_DP_CONTROLLER_1
> > Why would we use three indices for an soc that only has two indices
> > possible? This is not a real problem?
>
> I do not what will happen at future, it may have more dp controller use
> late.
>
> at current soc, below table has only one eDP will not work either.
>
> static const struct msm_dp_config sc7280_dp_cfg = {
>           .descs = (const struct msm_dp_desc[]) {
>                   [MSM_DP_CONTROLLER_1] = { .io_start = 0x0aea0000,
> .connector_type = DRM_MODE_CONNECTOR_eDP, .wide_bus_en = true },
>
>           .num_descs = 1,

So the MSM_DP_CONTROLLER_* number needs to match what exactly?

>
> >
> >> since it have num_descs =2 but eDP is at index 2 (CONTROLLER_2) which
> >> never be reached.
> >>
> >> static const struct msm_dp_config sc7280_dp_cfg = {
> >>           .descs = (const struct msm_dp_desc[]) {
> >>                   [MSM_DP_CONTROLLER_2] = { .io_start = 0x0aea0000,
> >> .connector_type = DRM_MODE_CONNECTOR_eDP, .wide_bus_en = true },
> >>                   [MSM_DP_CONTROLLER_0] = { .io_start = 0x0ae90000,
> >> .connector_type = DRM_MODE_CONNECTOR_DisplayPort, .wide_bus_en = true },
> >>           },
> >>           .num_descs = 2,
> >> };
> >>
> >> 2)  DP always has index of 0 (dp->id = 0) and the first one to call
> >> msm_dp_modeset_init(). This make DP always place at head of bridge chain.
> > What does this mean? Are you talking about the list of bridges in drm
> > core, i.e. 'bridge_list'?
> yes,

I changed the drm_bridge_add() API and that doesn't make any difference.
The corruption is still seen. That would imply it is not the order of
the list of bridges.

---8<---
diff --git a/drivers/gpu/drm/drm_bridge.c b/drivers/gpu/drm/drm_bridge.c
index e275b4ca344b..e3518101b65e 100644
--- a/drivers/gpu/drm/drm_bridge.c
+++ b/drivers/gpu/drm/drm_bridge.c
@@ -165,7 +165,7 @@ void drm_bridge_add(struct drm_bridge *bridge)
 	mutex_init(&bridge->hpd_mutex);

 	mutex_lock(&bridge_lock);
-	list_add_tail(&bridge->list, &bridge_list);
+	list_add(&bridge->list, &bridge_list);
 	mutex_unlock(&bridge_lock);
 }
 EXPORT_SYMBOL(drm_bridge_add);

> >
> >> At next patch eDP must be placed at head of bridge chain to fix eDP
> >> corruption issue. This is the purpose of this patch. I will revise the
> >> commit text.
> >>
> > Wouldn't that be "broken" again if we decided to change drm_bridge_add()
> > to add to the list head instead of list tail? Or if somehow
> > msm_dp_modeset_init() was called in a different order so that the DP
> > bridge was added before the eDP bridge?
>
> we have no control of drm_bridge_add().
>
> Since drm perform screen update following bridge chain sequentially, we
> have to make sure primary always update first.
>

  reply	other threads:[~2022-06-24 22:19 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-24 17:15 [PATCH v1 0/3] fix primary corruption issue Kuogee Hsieh
2022-06-24 17:15 ` Kuogee Hsieh
2022-06-24 17:15 ` [PATCH v1 1/3] drm/msm/dp: move struc of msm_display_info to msm_drv.h Kuogee Hsieh
2022-06-24 17:15   ` Kuogee Hsieh
2022-06-24 21:40   ` Doug Anderson
2022-06-24 21:40     ` Doug Anderson
2022-06-24 21:50     ` Kuogee Hsieh
2022-06-24 21:50       ` Kuogee Hsieh
2022-06-24 23:45       ` Dmitry Baryshkov
2022-06-24 23:45         ` Dmitry Baryshkov
2022-06-24 23:41   ` Dmitry Baryshkov
2022-06-24 23:41     ` Dmitry Baryshkov
2022-06-24 17:15 ` [PATCH v1 2/3] drm/msm/dp: decoupling dp->id out of dp controller_id at scxxxx_dp_cfg table Kuogee Hsieh
2022-06-24 17:15   ` Kuogee Hsieh
2022-06-24 20:00   ` Stephen Boyd
2022-06-24 20:00     ` Stephen Boyd
2022-06-24 21:17     ` Kuogee Hsieh
2022-06-24 21:17       ` Kuogee Hsieh
2022-06-24 21:40       ` Stephen Boyd
2022-06-24 21:40         ` Stephen Boyd
2022-06-24 21:49         ` Kuogee Hsieh
2022-06-24 21:49           ` Kuogee Hsieh
2022-06-24 22:19           ` Stephen Boyd [this message]
2022-06-24 22:19             ` Stephen Boyd
2022-06-24 22:53             ` Kuogee Hsieh
2022-06-24 22:53               ` Kuogee Hsieh
2022-06-24 23:12               ` Stephen Boyd
2022-06-24 23:12                 ` Stephen Boyd
2022-06-24 23:30                 ` Kuogee Hsieh
2022-06-24 23:30                   ` Kuogee Hsieh
2022-06-24 23:45                   ` Stephen Boyd
2022-06-24 23:45                     ` Stephen Boyd
2022-06-24 23:53                     ` Dmitry Baryshkov
2022-06-24 23:53                       ` Dmitry Baryshkov
2022-06-24 23:56                     ` Kuogee Hsieh
2022-06-24 23:56                       ` Kuogee Hsieh
2022-06-25  0:03                       ` Abhinav Kumar
2022-06-25  0:03                         ` Abhinav Kumar
2022-06-25  0:11                         ` Stephen Boyd
2022-06-25  0:11                           ` Stephen Boyd
2022-06-25  0:23                           ` Stephen Boyd
2022-06-25  0:23                             ` Stephen Boyd
2022-06-25  1:15                             ` Abhinav Kumar
2022-06-25  1:15                               ` Abhinav Kumar
2022-06-25  0:11                         ` Dmitry Baryshkov
2022-06-25  0:11                           ` Dmitry Baryshkov
2022-06-25  0:19                           ` Kuogee Hsieh
2022-06-25  0:19                             ` Kuogee Hsieh
2022-06-25  0:21                             ` Dmitry Baryshkov
2022-06-25  0:21                               ` Dmitry Baryshkov
2022-06-25  0:23                               ` Kuogee Hsieh
2022-06-25  0:23                                 ` Kuogee Hsieh
2022-06-25  0:28                                 ` Dmitry Baryshkov
2022-06-25  0:28                                   ` Dmitry Baryshkov
2022-06-25  0:46                                   ` Dmitry Baryshkov
2022-06-25  0:46                                     ` Dmitry Baryshkov
2022-06-25  1:02                                     ` Kuogee Hsieh
2022-06-25  1:02                                       ` Kuogee Hsieh
2022-06-25  1:15                                       ` Stephen Boyd
2022-06-25  1:15                                         ` Stephen Boyd
2022-06-27 15:33                                         ` Kuogee Hsieh
2022-06-27 15:33                                           ` Kuogee Hsieh
2022-06-27 15:38                                           ` Dmitry Baryshkov
2022-06-27 15:38                                             ` Dmitry Baryshkov
2022-06-27 15:49                                             ` Kuogee Hsieh
2022-06-27 15:49                                               ` Kuogee Hsieh
2022-06-25  1:23                           ` Abhinav Kumar
2022-06-25  1:23                             ` Abhinav Kumar
2022-06-25  8:48                             ` Dmitry Baryshkov
2022-06-25  8:48                               ` Dmitry Baryshkov
2022-06-27 23:20                               ` Doug Anderson
2022-06-27 23:20                                 ` Doug Anderson
2022-06-28 15:22                                 ` Kuogee Hsieh
2022-06-28 15:22                                   ` Kuogee Hsieh
2022-06-24 23:25       ` Dmitry Baryshkov
2022-06-24 23:25         ` Dmitry Baryshkov
2022-06-24 17:15 ` [PATCH v1 3/3] drm/msm/dp: place edp at head of drm bridge chain to fix screen corruption Kuogee Hsieh
2022-06-24 17:15   ` Kuogee Hsieh
2022-06-24 23:56   ` Dmitry Baryshkov
2022-06-24 23:56     ` 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='CAE-0n51g-EVsC-i9=sJV-ySa8VnE+yT7cg=b-TNMi9+3uBiOVA@mail.gmail.com' \
    --to=swboyd@chromium.org \
    --cc=agross@kernel.org \
    --cc=airlied@linux.ie \
    --cc=bjorn.andersson@linaro.org \
    --cc=daniel@ffwll.ch \
    --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_khsieh@quicinc.com \
    --cc=quic_sbillaka@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=vkoul@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.