Skip to contentSkip to conversation

drm/amd/display: explicitly disable psr_feature_enable appropriately

PATCH In review Shirish S 3 participants 3 messages Oct 7, 2022

Subsystems (3)
lore
Share & tools
lore

Shirish S

author
#0 lore raw

PATCH 1/1 drm/amd/display: explicitly disable psr_feature_enable appropriately

[Why]
If psr_feature_enable is set to true by default, it continues to be enabled for non capable links.

[How]
explicitly disable the feature on links that are not capable of the same.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +6 -2
index 8ca10ab3dfc1..26291db0a3cf 100644
@@ -60,11 +60,15 @@ static bool link_supports_psrsu(struct dc_link *link)
  */
 void amdgpu_dm_set_psr_caps(struct dc_link *link)
 {
-	if (!(link->connector_signal & SIGNAL_TYPE_EDP))
+	if (!(link->connector_signal & SIGNAL_TYPE_EDP)) {
+		link->psr_settings.psr_feature_enabled = false;
 		return;
+	}
 
-	if (link->type == dc_connection_none)
+	if (link->type == dc_connection_none) {
+		link->psr_settings.psr_feature_enabled = false;
 		return;
+	}
 
 	if (link->dpcd_caps.psr_info.psr_version == 0) {
 		link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED;
Signature · 1 line
2.17.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Shirish S

[Why]
If psr_feature_enable is set to true by default, it continues to be enabled for non capable links.

[How]
explicitly disable the feature on links that are not capable of the same.

Thanks!

Quoted 26 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +6 -2
index 8ca10ab3dfc1..26291db0a3cf 100644
@@ -60,11 +60,15 @@ static bool link_supports_psrsu(struct dc_link *link)
   */
  void amdgpu_dm_set_psr_caps(struct dc_link *link)
  {
-	if (!(link->connector_signal & SIGNAL_TYPE_EDP))
+	if (!(link->connector_signal & SIGNAL_TYPE_EDP)) {
+		link->psr_settings.psr_feature_enabled = false;
  		return;
+	}
 
-	if (link->type == dc_connection_none)
+	if (link->type == dc_connection_none) {
+		link->psr_settings.psr_feature_enabled = false;
  		return;
+	}
 
  	if (link->dpcd_caps.psr_info.psr_version == 0) {
  		link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED;
Reviewed-by on v1 1/1
#2 lore raw
In reply to Shirish S
Quoted 9 lines · Shirish S

[Why]
If psr_feature_enable is set to true by default, it continues to be enabled for non capable links.

[How]
explicitly disable the feature on links that are not capable of the same.

This has been a problem potentially all the way to when PSR was first added.

I think this should probably go back to stable. The commit that last touched it (f4594cd1fa556) was in 5.13, but this could at least be fixed in the 5.15 LTS kernel and newer.

Fixes 8c322309e48e9 ("drm/amd/display: Enable PSR")
Quoted 26 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 ++++++--
  1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +6 -2
index 8ca10ab3dfc1..26291db0a3cf 100644
@@ -60,11 +60,15 @@ static bool link_supports_psrsu(struct dc_link *link)
   */
  void amdgpu_dm_set_psr_caps(struct dc_link *link)
  {
-	if (!(link->connector_signal & SIGNAL_TYPE_EDP))
+	if (!(link->connector_signal & SIGNAL_TYPE_EDP)) {
+		link->psr_settings.psr_feature_enabled = false;
  		return;
+	}
 
-	if (link->type == dc_connection_none)
+	if (link->type == dc_connection_none) {
+		link->psr_settings.psr_feature_enabled = false;
  		return;
+	}
 
  	if (link->dpcd_caps.psr_info.psr_version == 0) {
  		link->psr_settings.psr_version = DC_PSR_VERSION_UNSUPPORTED;