mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>,
	Kuogee Hsieh <quic_khsieh@quicinc.com>,
	<dri-devel@lists.freedesktop.org>, <robdclark@gmail.com>,
	<sean@poorly.run>, <swboyd@chromium.org>, <dianders@chromium.org>,
	<vkoul@kernel.org>, <daniel@ffwll.ch>, <airlied@linux.ie>,
	<agross@kernel.org>, <bjorn.andersson@linaro.org>
Cc: <quic_sbillaka@quicinc.com>, <freedreno@lists.freedesktop.org>,
	<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v5 1/3] drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training
Date: Thu, 29 Sep 2022 18:36:53 -0700	[thread overview]
Message-ID: <36e191e0-9ddc-80b8-7f59-e002d5d458c1@quicinc.com> (raw)
In-Reply-To: <47f661b6-b5b9-9f28-10cf-1e7bbb8b282a@linaro.org>



On 9/12/2022 12:25 PM, Dmitry Baryshkov wrote:
> On 12/09/2022 22:21, Kuogee Hsieh wrote:
>>
>> On 9/12/2022 11:39 AM, Dmitry Baryshkov wrote:
>>> On 12/09/2022 19:23, Kuogee Hsieh wrote:
>>>> DOWNSPREAD_CTRL (0x107) shall be cleared to 0 upon power-on reset or an
>>>> upstream device disconnect. This patch will enforce this rule by always
>>>> cleared DOWNSPREAD_CTRL register to 0 before start link training. At 
>>>> rare
>>>> case that DP MSA timing parameters may be mis-interpreted by the sink
>>>> which causes audio sampling rate be calculated wrongly and cause audio
>>>> did not work at sink if DOWNSPREAD_CTRL register is not cleared to 0.
>>>>
>>>> Changes in v2:
>>>> 1) fix spelling at commit text
>>>> 2) merge ssc variable into encoding[0]
>>>>
>>>> Changes in v3:
>>>> -- correct spelling of DOWNSPREAD_CTRL
>>>> -- replace err with len of ssize_t
>>>>
>>>> Changes in v4:
>>>> -- split into 2 patches
>>>>
>>>> Fixes: 154b5a7da0fd ("drm/msm/dp: add displayPort driver support")

Fixes tag is wrong here. It should be:

Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support")

>>>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
>>>> ---
>>>>   drivers/gpu/drm/msm/dp/dp_ctrl.c | 13 +++++--------
>>>>   1 file changed, 5 insertions(+), 8 deletions(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/msm/dp/dp_ctrl.c 
>>>> b/drivers/gpu/drm/msm/dp/dp_ctrl.c
>>>> index ab6aa13..2c74c59 100644
>>>> --- a/drivers/gpu/drm/msm/dp/dp_ctrl.c
>>>> +++ b/drivers/gpu/drm/msm/dp/dp_ctrl.c
>>>> @@ -1245,8 +1245,7 @@ static int dp_ctrl_link_train(struct 
>>>> dp_ctrl_private *ctrl,
>>>>   {
>>>>       int ret = 0;
>>>>       const u8 *dpcd = ctrl->panel->dpcd;
>>>> -    u8 encoding = DP_SET_ANSI_8B10B;
>>>> -    u8 ssc;
>>>> +    u8 encoding[] = { 0, DP_SET_ANSI_8B10B };
>>>>       u8 assr;
>>>>       struct dp_link_info link_info = {0};
>>>>   @@ -1258,13 +1257,11 @@ static int dp_ctrl_link_train(struct 
>>>> dp_ctrl_private *ctrl,
>>>>         dp_aux_link_configure(ctrl->aux, &link_info);
>>>>   -    if (drm_dp_max_downspread(dpcd)) {
>>>> -        ssc = DP_SPREAD_AMP_0_5;
>>>> -        drm_dp_dpcd_write(ctrl->aux, DP_DOWNSPREAD_CTRL, &ssc, 1);
>>>> -    }
>>>> +    if (drm_dp_max_downspread(dpcd))
>>>> +        encoding[0] |= DP_SPREAD_AMP_0_5;
>>>
>>> It would be simpler to call drm_dp_dpcd_write(ssc, 
>>> DP_DOWNSPREAD_CTRL, 1) unconditionally here. You won't have to change 
>>> the encoding/DP_MAIN_LINK_CHANNEL_CODING_SET/etc.
>>
>> The difference is one write with 2 bytes against two writes with one 
>> byte each.
>>
>> I think it is more efficient to combine two bytes into one write since 
>> these two bytes are consecutive address.
> 
> I probably wouldn't do so, nevertheless:
> 
> Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
> 
>>
>>>
>>>>   -    drm_dp_dpcd_write(ctrl->aux, DP_MAIN_LINK_CHANNEL_CODING_SET,
>>>> -                &encoding, 1);
>>>> +    /* config DOWNSPREAD_CTRL and MAIN_LINK_CHANNEL_CODING_SET */
>>>> +    drm_dp_dpcd_write(ctrl->aux, DP_DOWNSPREAD_CTRL, encoding, 2);
>>>>         if (drm_dp_alternate_scrambler_reset_cap(dpcd)) {
>>>>           assr = DP_ALTERNATE_SCRAMBLER_RESET_ENABLE;
>>>
> 

  reply	other threads:[~2022-09-30  1:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-12 16:23 [PATCH v5 0/3] cleared DP_DOWNSPREAD_CTRL register Kuogee Hsieh
2022-09-12 16:23 ` [PATCH v5 1/3] drm/msm/dp: cleared DP_DOWNSPREAD_CTRL register before start link training Kuogee Hsieh
2022-09-12 18:39   ` Dmitry Baryshkov
2022-09-12 19:21     ` Kuogee Hsieh
2022-09-12 19:25       ` Dmitry Baryshkov
2022-09-30  1:36         ` Abhinav Kumar [this message]
2022-09-12 16:23 ` [PATCH v5 2/3] drm/msm/dp: replace variable err with len at dp_aux_link_power_up() Kuogee Hsieh
2022-09-12 18:34   ` Dmitry Baryshkov
2022-09-12 16:23 ` [PATCH v5 3/3] drm/msm/dp: retry 3 times if set sink to D0 poweer state failed Kuogee Hsieh
2022-09-12 18:37   ` Dmitry Baryshkov
2022-09-12 19:26     ` Kuogee Hsieh
2022-11-02 15:51       ` 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=36e191e0-9ddc-80b8-7f59-e002d5d458c1@quicinc.com \
    --to=quic_abhinavk@quicinc.com \
    --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_khsieh@quicinc.com \
    --cc=quic_sbillaka@quicinc.com \
    --cc=robdclark@gmail.com \
    --cc=sean@poorly.run \
    --cc=swboyd@chromium.org \
    --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 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®