diff mbox series

drm/msm/dp: always add fail-safe mode into connector mode list

Message ID 1643057170-10413-1-git-send-email-quic_khsieh@quicinc.com (mailing list archive)
State New, archived
Headers show
Series drm/msm/dp: always add fail-safe mode into connector mode list | expand

Commit Message

Kuogee Hsieh Jan. 24, 2022, 8:46 p.m. UTC
Some of DP link compliant test expects to return fail-safe mode
if prefer detailed timing mode can not be supported by mainlink's
lane and rate after link training. Therefore add fail-safe mode
into connector mode list as backup mode. This patch fixes test
case 4.2.2.1.

Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
---
 drivers/gpu/drm/msm/dp/dp_panel.c | 5 +++++
 1 file changed, 5 insertions(+)

Comments

Stephen Boyd Jan. 24, 2022, 9:04 p.m. UTC | #1
Quoting Kuogee Hsieh (2022-01-24 12:46:10)
> Some of DP link compliant test expects to return fail-safe mode
> if prefer detailed timing mode can not be supported by mainlink's
> lane and rate after link training. Therefore add fail-safe mode
> into connector mode list as backup mode. This patch fixes test
> case 4.2.2.1.
>
> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>

Any Fixes tag? I also wonder why this isn't pushed into the DP core code
somehow. Wouldn't every device need to add a 640x480 mode by default?

> ---
>  drivers/gpu/drm/msm/dp/dp_panel.c | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
> index 3b02922..7743b45 100644
> --- a/drivers/gpu/drm/msm/dp/dp_panel.c
> +++ b/drivers/gpu/drm/msm/dp/dp_panel.c
> @@ -221,6 +221,11 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
>                 if (drm_add_modes_noedid(connector, 640, 480))
>                         drm_set_preferred_mode(connector, 640, 480);
>                 mutex_unlock(&connector->dev->mode_config.mutex);
> +       } else {
> +               /* always add fail-safe mode as backup mode */
> +               mutex_lock(&connector->dev->mode_config.mutex);
> +               drm_add_modes_noedid(connector, 640, 480);
> +               mutex_unlock(&connector->dev->mode_config.mutex);
>         }
>
>         if (panel->aux_cfg_update_done) {
> --
> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
> a Linux Foundation Collaborative Project
>
Kuogee Hsieh Jan. 24, 2022, 9:24 p.m. UTC | #2
On 1/24/2022 1:04 PM, Stephen Boyd wrote:
> Quoting Kuogee Hsieh (2022-01-24 12:46:10)
>> Some of DP link compliant test expects to return fail-safe mode
>> if prefer detailed timing mode can not be supported by mainlink's
>> lane and rate after link training. Therefore add fail-safe mode
>> into connector mode list as backup mode. This patch fixes test
>> case 4.2.2.1.
>>
>> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> Any Fixes tag? I also wonder why this isn't pushed into the DP core code
> somehow. Wouldn't every device need to add a 640x480 mode by default?

Original test case 4.2.2.1 always passed until we did firmware upgrade 
of our compliance test tester (Unigraph) recently.

The new firmware of tester use newer edid contains 1080p with 145.7 mhz 
which can not be supported by 2 lanes with 1.6G rate. Hence we failed 
this test case.

After discuss with Vendor, they claims we have to return fail-safe mode 
if prefer detailed timing mode can not be supported.

I think would be good to add fail-safe mode into connector mode list.




> we just run into this problem recently.
>> ---
>>   drivers/gpu/drm/msm/dp/dp_panel.c | 5 +++++
>>   1 file changed, 5 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
>> index 3b02922..7743b45 100644
>> --- a/drivers/gpu/drm/msm/dp/dp_panel.c
>> +++ b/drivers/gpu/drm/msm/dp/dp_panel.c
>> @@ -221,6 +221,11 @@ int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
>>                  if (drm_add_modes_noedid(connector, 640, 480))
>>                          drm_set_preferred_mode(connector, 640, 480);
>>                  mutex_unlock(&connector->dev->mode_config.mutex);
>> +       } else {
>> +               /* always add fail-safe mode as backup mode */
>> +               mutex_lock(&connector->dev->mode_config.mutex);
>> +               drm_add_modes_noedid(connector, 640, 480);
>> +               mutex_unlock(&connector->dev->mode_config.mutex);
>>          }
>>
>>          if (panel->aux_cfg_update_done) {
>> --
>> The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
>> a Linux Foundation Collaborative Project
>>
Stephen Boyd Jan. 24, 2022, 10:07 p.m. UTC | #3
Quoting Kuogee Hsieh (2022-01-24 13:24:25)
>
> On 1/24/2022 1:04 PM, Stephen Boyd wrote:
> > Quoting Kuogee Hsieh (2022-01-24 12:46:10)
> >> Some of DP link compliant test expects to return fail-safe mode
> >> if prefer detailed timing mode can not be supported by mainlink's
> >> lane and rate after link training. Therefore add fail-safe mode
> >> into connector mode list as backup mode. This patch fixes test
> >> case 4.2.2.1.
> >>
> >> Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com>
> > Any Fixes tag? I also wonder why this isn't pushed into the DP core code
> > somehow. Wouldn't every device need to add a 640x480 mode by default?
>
> Original test case 4.2.2.1 always passed until we did firmware upgrade
> of our compliance test tester (Unigraph) recently.

Ok. So the Fixes tag should be the introduction of the driver or at
least whenever compliance testing support was added.

>
> The new firmware of tester use newer edid contains 1080p with 145.7 mhz
> which can not be supported by 2 lanes with 1.6G rate. Hence we failed
> this test case.

Interesting. So the test case wouldn't fail unless the number of lanes
were limited by the hardware? Seems that the test isn't thorough.

>
> After discuss with Vendor, they claims we have to return fail-safe mode
> if prefer detailed timing mode can not be supported.
>
> I think would be good to add fail-safe mode into connector mode list.
>
>
>
>
> > we just run into this problem recently.


Sure I'm not saying it's incorrect, just wondering why a connector
that's DP wouldn't have the 640x480 resolution by default somewhere in
the drm core.
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/dp/dp_panel.c b/drivers/gpu/drm/msm/dp/dp_panel.c
index 3b02922..7743b45 100644
--- a/drivers/gpu/drm/msm/dp/dp_panel.c
+++ b/drivers/gpu/drm/msm/dp/dp_panel.c
@@ -221,6 +221,11 @@  int dp_panel_read_sink_caps(struct dp_panel *dp_panel,
 		if (drm_add_modes_noedid(connector, 640, 480))
 			drm_set_preferred_mode(connector, 640, 480);
 		mutex_unlock(&connector->dev->mode_config.mutex);
+	} else {
+		/* always add fail-safe mode as backup mode */
+		mutex_lock(&connector->dev->mode_config.mutex);
+		drm_add_modes_noedid(connector, 640, 480);
+		mutex_unlock(&connector->dev->mode_config.mutex);
 	}
 
 	if (panel->aux_cfg_update_done) {