Skip to contentSkip to conversation

drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

PATCH In review Rajib Mahapatra 4 participants 7 messages Jan 10, 2022 – Jan 20, 2022

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

[Why]
During resume path, dpcd_set_source_specific_data is taking extra time when core_link_write_dpcd fails on DP_SOURCE_OUI+0x03 and DP_SOURCE_MINIMUM_HBLANK_SUPPORTED. Here,aux->transfer fails with multiple retries and consume sigficantamount time during S0i3 resume.

[How]
Not to call dpcd_set_source_specific_data during resume path when there is no oled panel connected and achieve faster resume during S0i3.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
index c0bdc23702c8..04086c199dbb 100644
@@ -892,7 +892,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
 		(!link->dc->config.allow_edp_hotplug_detection)) &&
 		link->local_sink) {
 		// need to re-write OUI and brightness in resume case
-		if (link->connector_signal == SIGNAL_TYPE_EDP) {
+		if (link->connector_signal == SIGNAL_TYPE_EDP &&
+			(link->dpcd_sink_ext_caps.bits.oled == 1)) {
 			dpcd_set_source_specific_data(link);
 			msleep(post_oui_delay);
 			dc_link_set_default_brightness_aux(link);
Signature · 1 line
2.25.1
maintainer Acked-by on v1 1/1
#1 lore raw

[Public]

Seems reasonable.

________________________________
From: Mahapatra, Rajib <[email protected]>
Sent: Monday, January 10, 2022 4:06 AM
To: Wu, Hersen <[email protected]>; Wentland, Harry <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected] <[email protected]>; S, Shirish <[email protected]>; Mahapatra, Rajib <[email protected]>
Subject: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

[Why]
During resume path, dpcd_set_source_specific_data is taking extra time when core_link_write_dpcd fails on DP_SOURCE_OUI+0x03 and DP_SOURCE_MINIMUM_HBLANK_SUPPORTED. Here,aux->transfer fails with multiple retries and consume sigficantamount time during S0i3 resume.

[How]
Not to call dpcd_set_source_specific_data during resume path when there is no oled panel connected and achieve faster resume during S0i3.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
index c0bdc23702c8..04086c199dbb 100644
@@ -892,7 +892,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
                 (!link->dc->config.allow_edp_hotplug_detection)) &&
                 link->local_sink) {
                 // need to re-write OUI and brightness in resume case
-               if (link->connector_signal == SIGNAL_TYPE_EDP) {
+               if (link->connector_signal == SIGNAL_TYPE_EDP &&
+                       (link->dpcd_sink_ext_caps.bits.oled == 1)) {
                         dpcd_set_source_specific_data(link);
                         msleep(post_oui_delay);
                         dc_link_set_default_brightness_aux(link);

--
2.25.1

maintainer
#2 lore raw
In reply to Rajib Mahapatra
Quoted 22 lines · Rajib Mahapatra

[Why]
During resume path, dpcd_set_source_specific_data is taking extra time when core_link_write_dpcd fails on DP_SOURCE_OUI+0x03 and DP_SOURCE_MINIMUM_HBLANK_SUPPORTED. Here,aux->transfer fails with multiple retries and consume sigficantamount time during S0i3 resume.

[How]
Not to call dpcd_set_source_specific_data during resume path when there is no oled panel connected and achieve faster resume during S0i3.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index c0bdc23702c8..04086c199dbb 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool dc_link_detect_helper(struct dc_link *link, · line 896

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
@@ -892,7 +892,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
 		(!link->dc->config.allow_edp_hotplug_detection)) &&
 		link->local_sink) {
 		// need to re-write OUI and brightness in resume case
-		if (link->connector_signal == SIGNAL_TYPE_EDP) {
+		if (link->connector_signal == SIGNAL_TYPE_EDP &&
+			(link->dpcd_sink_ext_caps.bits.oled == 1)) {

Is the source specific data only used by OLED panels?

Do we know that this won't lead to regressions with any features on non-OLED panels?

Harry

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
 			dpcd_set_source_specific_data(link);
 			msleep(post_oui_delay);
 			dc_link_set_default_brightness_aux(link);
#3 lore raw

dpcd_set_source_specific_data is not specific to OLED panel. It is called from boot-up path also. Hersen Wu introduced it in resume-path while enabling OLED panel for Linux in below commit.

So here, I guard it by calling source specific data only for OLED panel, and I can get advantage of around 100ms for non-oled panel during resume. Hersen night have answer about the issue related to regression for other panels, waiting for his reply about this change.

commit 96577cf82a1331732a71199522398120c649f1cf

Author: Hersen Wu <[email protected]>
Date:   Tue Jan 14 15:39:07 2020 -0500

drm/amd/display: linux enable oled panel support dc part

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Monday, January 10, 2022 10:03 PM
To: Mahapatra, Rajib <[email protected]>; Wu, Hersen <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

Quoted 23 lines · Rajib Mahapatra

[Why]
During resume path, dpcd_set_source_specific_data is taking extra time when core_link_write_dpcd fails on DP_SOURCE_OUI+0x03 and DP_SOURCE_MINIMUM_HBLANK_SUPPORTED. Here,aux->transfer fails with multiple retries and consume sigficantamount time during S0i3 resume.

[How]
Not to call dpcd_set_source_specific_data during resume path when there is no oled panel connected and achieve faster resume during S0i3.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index c0bdc23702c8..04086c199dbb 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool dc_link_detect_helper(struct dc_link *link, · line 896

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
@@ -892,7 +892,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
 		(!link->dc->config.allow_edp_hotplug_detection)) &&
 		link->local_sink) {
 		// need to re-write OUI and brightness in resume case
-		if (link->connector_signal == SIGNAL_TYPE_EDP) {
+		if (link->connector_signal == SIGNAL_TYPE_EDP &&
+			(link->dpcd_sink_ext_caps.bits.oled == 1)) {

Is the source specific data only used by OLED panels?

Do we know that this won't lead to regressions with any features on non-OLED panels?

Harry

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
 			dpcd_set_source_specific_data(link);
 			msleep(post_oui_delay);
 			dc_link_set_default_brightness_aux(link);
maintainer
#4 lore raw
Quoted 3 lines · Rajib

dpcd_set_source_specific_data is not specific to OLED panel. It is called from boot-up path also. Hersen Wu introduced it in resume-path while enabling OLED panel for Linux in below commit.

If we set it in the boot-up path we'll probably want to set it on resume as well. Though I'll let Hersen comment since he knows this part much better than me.

Harry

Quoted 58 lines

So here, I guard it by calling source specific data only for OLED panel, and I can get advantage of around 100ms for non-oled panel during resume. Hersen night have answer about the issue related to regression for other panels, waiting for his reply about this change.

commit 96577cf82a1331732a71199522398120c649f1cf

Author: Hersen Wu <[email protected]>
Date:   Tue Jan 14 15:39:07 2020 -0500

drm/amd/display: linux enable oled panel support dc part

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Monday, January 10, 2022 10:03 PM
To: Mahapatra, Rajib <[email protected]>; Wu, Hersen <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

Quoted 23 lines · Rajib Mahapatra

[Why]
During resume path, dpcd_set_source_specific_data is taking extra time when core_link_write_dpcd fails on DP_SOURCE_OUI+0x03 and DP_SOURCE_MINIMUM_HBLANK_SUPPORTED. Here,aux->transfer fails with multiple retries and consume sigficantamount time during S0i3 resume.

[How]
Not to call dpcd_set_source_specific_data during resume path when there is no oled panel connected and achieve faster resume during S0i3.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index c0bdc23702c8..04086c199dbb 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool dc_link_detect_helper(struct dc_link *link, · line 896

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
@@ -892,7 +892,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
 		(!link->dc->config.allow_edp_hotplug_detection)) &&
 		link->local_sink) {
 		// need to re-write OUI and brightness in resume case
-		if (link->connector_signal == SIGNAL_TYPE_EDP) {
+		if (link->connector_signal == SIGNAL_TYPE_EDP &&
+			(link->dpcd_sink_ext_caps.bits.oled == 1)) {

Is the source specific data only used by OLED panels?

Do we know that this won't lead to regressions with any features on non-OLED panels?

Harry

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
 			dpcd_set_source_specific_data(link);
 			msleep(post_oui_delay);
 			dc_link_set_default_brightness_aux(link);
#5 lore raw

Hi Hersen,
I am waiting for your comments here.
I think we can take this change for resume path at this moment. For bootup, we can have separate patch for resume optimization.

Thanks
-Rajib

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Tuesday, January 11, 2022 9:47 PM
To: Mahapatra, Rajib <[email protected]>; Wu, Hersen <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

Quoted 3 lines · Rajib

dpcd_set_source_specific_data is not specific to OLED panel. It is called from boot-up path also. Hersen Wu introduced it in resume-path while enabling OLED panel for Linux in below commit.

If we set it in the boot-up path we'll probably want to set it on resume as well. Though I'll let Hersen comment since he knows this part much better than me.

Harry

Quoted 59 lines

So here, I guard it by calling source specific data only for OLED panel, and I can get advantage of around 100ms for non-oled panel during resume. Hersen night have answer about the issue related to regression for other panels, waiting for his reply about this change.

commit 96577cf82a1331732a71199522398120c649f1cf

Author: Hersen Wu <[email protected]>
Date:   Tue Jan 14 15:39:07 2020 -0500

drm/amd/display: linux enable oled panel support dc part

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Monday, January 10, 2022 10:03 PM
To: Mahapatra, Rajib <[email protected]>; Wu, Hersen <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

Quoted 23 lines · Rajib Mahapatra

[Why]
During resume path, dpcd_set_source_specific_data is taking extra time when core_link_write_dpcd fails on DP_SOURCE_OUI+0x03 and DP_SOURCE_MINIMUM_HBLANK_SUPPORTED. Here,aux->transfer fails with multiple retries and consume sigficantamount time during S0i3 resume.

[How]
Not to call dpcd_set_source_specific_data during resume path when there is no oled panel connected and achieve faster resume during S0i3.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index c0bdc23702c8..04086c199dbb 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool dc_link_detect_helper(struct dc_link *link, · line 896

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
@@ -892,7 +892,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
 		(!link->dc->config.allow_edp_hotplug_detection)) &&
 		link->local_sink) {
 		// need to re-write OUI and brightness in resume case
-		if (link->connector_signal == SIGNAL_TYPE_EDP) {
+		if (link->connector_signal == SIGNAL_TYPE_EDP &&
+			(link->dpcd_sink_ext_caps.bits.oled == 1)) {

Is the source specific data only used by OLED panels?

Do we know that this won't lead to regressions with any features on non-OLED panels?

Harry

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
 			dpcd_set_source_specific_data(link);
 			msleep(post_oui_delay);
 			dc_link_set_default_brightness_aux(link);
Reviewed-by
#6 lore raw

[AMD Official Use Only]

Hi Rajib,

For resume from s3 or si03, the change should work.

For boot up, at the location of your change, link->dpcd_sink_ext_caps.bits.oled = 0. OLED caps is read by dpcd_read_sink_ext_caps which is called within detect_edp_sink_caps.

For boot up, we need another change.

Thanks!
Hersen

-----Original Message-----
From: Mahapatra, Rajib <[email protected]>
Sent: Thursday, January 20, 2022 2:33 PM
To: Wentland, Harry <[email protected]>; Wu, Hersen <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: RE: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

Hi Hersen,
I am waiting for your comments here.
I think we can take this change for resume path at this moment. For bootup, we can have separate patch for resume optimization.

Thanks
-Rajib

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Tuesday, January 11, 2022 9:47 PM
To: Mahapatra, Rajib <[email protected]>; Wu, Hersen <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

Quoted 3 lines · Rajib

dpcd_set_source_specific_data is not specific to OLED panel. It is called from boot-up path also. Hersen Wu introduced it in resume-path while enabling OLED panel for Linux in below commit.

If we set it in the boot-up path we'll probably want to set it on resume as well. Though I'll let Hersen comment since he knows this part much better than me.

Harry

Quoted 59 lines

So here, I guard it by calling source specific data only for OLED panel, and I can get advantage of around 100ms for non-oled panel during resume. Hersen night have answer about the issue related to regression for other panels, waiting for his reply about this change.

commit 96577cf82a1331732a71199522398120c649f1cf

Author: Hersen Wu <[email protected]>
Date:   Tue Jan 14 15:39:07 2020 -0500

drm/amd/display: linux enable oled panel support dc part

-----Original Message-----
From: Wentland, Harry <[email protected]>
Sent: Monday, January 10, 2022 10:03 PM
To: Mahapatra, Rajib <[email protected]>; Wu, Hersen <[email protected]>; Deucher, Alexander <[email protected]>
Cc: [email protected]; S, Shirish <[email protected]>
Subject: Re: [PATCH] drm/amd/display: Not to call dpcd_set_source_specific_data during resume.

Quoted 23 lines · Rajib Mahapatra

[Why]
During resume path, dpcd_set_source_specific_data is taking extra time when core_link_write_dpcd fails on DP_SOURCE_OUI+0x03 and DP_SOURCE_MINIMUM_HBLANK_SUPPORTED. Here,aux->transfer fails with multiple retries and consume sigficantamount time during S0i3 resume.

[How]
Not to call dpcd_set_source_specific_data during resume path when there is no oled panel connected and achieve faster resume during S0i3.

---
 drivers/gpu/drm/amd/display/dc/core/dc_link.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
index c0bdc23702c8..04086c199dbb 100644

drivers/gpu/drm/amd/display/dc/core/dc_link.c static bool dc_link_detect_helper(struct dc_link *link, · line 896

Quoted 6 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +2 -1
@@ -892,7 +892,8 @@ static bool dc_link_detect_helper(struct dc_link *link,
 		(!link->dc->config.allow_edp_hotplug_detection)) &&
 		link->local_sink) {
 		// need to re-write OUI and brightness in resume case
-		if (link->connector_signal == SIGNAL_TYPE_EDP) {
+		if (link->connector_signal == SIGNAL_TYPE_EDP &&
+			(link->dpcd_sink_ext_caps.bits.oled == 1)) {

Is the source specific data only used by OLED panels?

Do we know that this won't lead to regressions with any features on non-OLED panels?

Harry

Quoted 3 lines
drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 -0
 			dpcd_set_source_specific_data(link);
 			msleep(post_oui_delay);
 			dc_link_set_default_brightness_aux(link);