From: Abhinav Kumar <quic_abhinavk@quicinc.com>
To: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Cc: <freedreno@lists.freedesktop.org>,
Rob Clark <robdclark@gmail.com>, "Sean Paul" <sean@poorly.run>,
Marijn Suijten <marijn.suijten@somainline.org>,
"David Airlie" <airlied@gmail.com>,
Daniel Vetter <daniel@ffwll.ch>,
Guenter Roeck <groeck@chromium.org>,
Tanmay Shah <tanmay@codeaurora.org>,
Vara Reddy <quic_varar@quicinc.com>,
Stephen Boyd <swboyd@chromium.org>,
<dri-devel@lists.freedesktop.org>, <quic_jesszhan@quicinc.com>,
<neil.armstrong@linaro.org>, <abel.vesa@linaro.org>,
<quic_khsieh@quicinc.com>, Rob Clark <robdclark@chromium.org>,
"Chandan Uddaraju" <chandanu@codeaurora.org>,
<linux-arm-msm@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm/msm/dp: fix the max supported bpp logic
Date: Mon, 29 Jul 2024 11:38:27 -0700 [thread overview]
Message-ID: <5f2983ea-d694-44c3-8231-78c0de6db856@quicinc.com> (raw)
In-Reply-To: <CAA8EJpoYqHnG_=jt6Lo6v7a7h3CdF66bKqRf63RCmvqHWb4kFQ@mail.gmail.com>
On 7/27/2024 5:51 AM, Dmitry Baryshkov wrote:
> On Fri, 26 Jul 2024 at 01:04, Abhinav Kumar <quic_abhinavk@quicinc.com> wrote:
>>
>> Currently the DP driver hard-codes the max supported bpp to 30.
>> This is incorrect because the number of lanes and max data rate
>> supported by the lanes need to be taken into account.
>>
>> Replace the hardcoded limit with the appropriate math which accounts
>> for the accurate number of lanes and max data rate.
>>
>> Fixes: c943b4948b58 ("drm/msm/dp: add displayPort driver support")
>> Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com>
>> ---
>> drivers/gpu/drm/msm/dp/dp_panel.c | 7 +++++--
>> 1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
>> index a916b5f3b317..56ce5e4008f8 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_panel.c
>> +++ b/drivers/gpu/drm/msm/dp/dp_panel.c
>> @@ -397,6 +397,7 @@ int dp_panel_init_panel_info(struct dp_panel *dp_panel)
>> {
>> struct drm_display_mode *drm_mode;
>> struct dp_panel_private *panel;
>> + u32 max_supported_bpp;
>>
>> drm_mode = &dp_panel->dp_mode.drm_mode;
>>
>> @@ -423,8 +424,10 @@ int dp_panel_init_panel_info(struct dp_panel *dp_panel)
>> drm_mode->clock);
>> drm_dbg_dp(panel->drm_dev, "bpp = %d\n", dp_panel->dp_mode.bpp);
>>
>> - dp_panel->dp_mode.bpp = max_t(u32, 18,
>> - min_t(u32, dp_panel->dp_mode.bpp, 30));
>> + max_supported_bpp = dp_panel_get_mode_bpp(dp_panel, dp_panel->dp_mode.bpp,
>> + dp_panel->dp_mode.drm_mode.clock);
>> + dp_panel->dp_mode.bpp = max_t(u32, 18, max_supported_bpp);
>
> I think that in mode_valid() the driver should filter out modes that
> result in BPP being less than 18. Then the max_t can be dropped
> completely.
>
With Stephen's suggested change, dp_panel_get_supported_bpp() will not
return anything below min_supported_bpp which is 18 so we can absorb
that part and drop the max_t part here.
> Nevertheless this indeed fixes an issue with the screen corruption,
> this is great!
>
> Tested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org> # SM8350-HDK
>
Thanks for reporting and testing this. I need to give you Reported-by
credits as well.
>> +
>> drm_dbg_dp(panel->drm_dev, "updated bpp = %d\n",
>> dp_panel->dp_mode.bpp);
>>
>> --
>> 2.44.0
>>
>
>
prev parent reply other threads:[~2024-07-29 18:39 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 22:03 Abhinav Kumar
2024-07-27 0:24 ` Stephen Boyd
2024-07-29 18:28 ` Abhinav Kumar
2024-07-29 20:08 ` Stephen Boyd
2024-07-30 17:58 ` Abhinav Kumar
2024-07-27 12:51 ` Dmitry Baryshkov
2024-07-29 18:38 ` Abhinav Kumar [this message]
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=5f2983ea-d694-44c3-8231-78c0de6db856@quicinc.com \
--to=quic_abhinavk@quicinc.com \
--cc=abel.vesa@linaro.org \
--cc=airlied@gmail.com \
--cc=chandanu@codeaurora.org \
--cc=daniel@ffwll.ch \
--cc=dmitry.baryshkov@linaro.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=freedreno@lists.freedesktop.org \
--cc=groeck@chromium.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marijn.suijten@somainline.org \
--cc=neil.armstrong@linaro.org \
--cc=quic_jesszhan@quicinc.com \
--cc=quic_khsieh@quicinc.com \
--cc=quic_varar@quicinc.com \
--cc=robdclark@chromium.org \
--cc=robdclark@gmail.com \
--cc=sean@poorly.run \
--cc=swboyd@chromium.org \
--cc=tanmay@codeaurora.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®