All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: explicitly disable psr_feature_enable appropriately
@ 2022-10-07  4:28 Shirish S
  2022-10-07 13:51 ` Leo Li
  2022-10-07 16:13 ` Limonciello, Mario
  0 siblings, 2 replies; 4+ messages in thread
From: Shirish S @ 2022-10-07  4:28 UTC (permalink / raw)
  To: Leo Li, Harry Wentland, Roman Li, Alex Deucher; +Cc: amd-gfx, 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.

Signed-off-by: Shirish S <shirish.s@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
index 8ca10ab3dfc1..26291db0a3cf 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
@@ -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;
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] drm/amd/display: explicitly disable psr_feature_enable appropriately
  2022-10-07  4:28 [PATCH] drm/amd/display: explicitly disable psr_feature_enable appropriately Shirish S
@ 2022-10-07 13:51 ` Leo Li
  2022-10-07 16:13 ` Limonciello, Mario
  1 sibling, 0 replies; 4+ messages in thread
From: Leo Li @ 2022-10-07 13:51 UTC (permalink / raw)
  To: Shirish S, Harry Wentland, Roman Li, Alex Deucher; +Cc: amd-gfx



On 2022-10-07 00:28, Shirish S wrote:
> [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.
> 
> Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>

Thanks!
> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> index 8ca10ab3dfc1..26291db0a3cf 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> @@ -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;

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: drm/amd/display: explicitly disable psr_feature_enable appropriately
  2022-10-07  4:28 [PATCH] drm/amd/display: explicitly disable psr_feature_enable appropriately Shirish S
  2022-10-07 13:51 ` Leo Li
@ 2022-10-07 16:13 ` Limonciello, Mario
  1 sibling, 0 replies; 4+ messages in thread
From: Limonciello, Mario @ 2022-10-07 16:13 UTC (permalink / raw)
  To: Shirish S, Leo Li, Harry Wentland, Roman Li, Alex Deucher; +Cc: amd-gfx

On 10/6/2022 23:28, Shirish S wrote:
> [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.
> 
> Signed-off-by: Shirish S <shirish.s@amd.com>
> Reviewed-by: Leo Li <sunpeng.li@amd.com>

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.

Cc: stable@vger.kernel.org # 5.15+
Fixes: 8c322309e48e9 ("drm/amd/display: Enable PSR")
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 ++++++--
>   1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> index 8ca10ab3dfc1..26291db0a3cf 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
> @@ -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;


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] drm/amd/display: explicitly disable psr_feature_enable appropriately
@ 2022-10-25  1:40 Mario Limonciello
  0 siblings, 0 replies; 4+ messages in thread
From: Mario Limonciello @ 2022-10-25  1:40 UTC (permalink / raw)
  To: stable; +Cc: Mario Limonciello, Shirish S, Leo Li, Alex Deucher

[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.

Fixes: 8c322309e48e9 ("drm/amd/display: Enable PSR")
Signed-off-by: Shirish S <shirish.s@amd.com>
Reviewed-by: Leo Li <sunpeng.li@amd.com>
Reviewed-by: Mario Limonciello <mario.limonciello@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org # 5.15+
(cherry-picked from 6094b9136ca9038b61e9c4b5d25cd5512ce50b34)
Signed-off-by: Mario Limonciello <mario.limonciello@amd.com>
---
This did not apply to 5.15.y due to missing contextual dependencies, so this
is hand modified to meet the intent of the original commit.

This is *only* for 5.15.y.
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
index 7072fb2ec07f..278ff281a1bd 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c
@@ -36,10 +36,14 @@ void amdgpu_dm_set_psr_caps(struct dc_link *link)
 {
 	uint8_t dpcd_data[EDP_PSR_RECEIVER_CAP_SIZE];
 
-	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 (dm_helpers_dp_read_dpcd(NULL, link, DP_PSR_SUPPORT,
 					dpcd_data, sizeof(dpcd_data))) {
 		link->dpcd_caps.psr_caps.psr_version = dpcd_data[0];
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-10-25  1:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-07  4:28 [PATCH] drm/amd/display: explicitly disable psr_feature_enable appropriately Shirish S
2022-10-07 13:51 ` Leo Li
2022-10-07 16:13 ` Limonciello, Mario
2022-10-25  1:40 [PATCH] " Mario Limonciello

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.