Skip to contentSkip to conversation

drm/amdgpu/display: add dc feature mask for psr enablement

PATCH In review [email protected] 2 participants 4 messages Oct 21, 2019 – Oct 22, 2019 3 messages not in the archive

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

PATCH 1/1 drm/amdgpu/display: add dc feature mask for psr enablement

From: Roman Li <[email protected]>

[Why]
Adding psr mask to dc features allows selectively disable/enable psr. Current psr implementation may not work with non-pageflipping application. Until resolved it should be disabled by default.

[How]
Add dcfeaturemask for psr enablement. Disable by default. To enable set amdgpu.dcfeaturemask=0x8 in grub kernel command line.

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
 drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index 1cf4beb..0f08879 100644
@@ -2424,7 +2424,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 		} else if (dc_link_detect(link, DETECT_REASON_BOOT)) {
 			amdgpu_dm_update_connector_after_detect(aconnector);
 			register_backlight_device(dm, link);
-			amdgpu_dm_set_psr_caps(link);
+			if (amdgpu_dc_feature_mask & DC_PSR_MASK)
+				amdgpu_dm_set_psr_caps(link);
 		}
 
 
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
index 8889aac..1daa221 100644
@@ -143,6 +143,7 @@ enum PP_FEATURE_MASK {
 enum DC_FEATURE_MASK {
 	DC_FBC_MASK = 0x1,
 	DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,
+	DC_PSR_MASK = 0x8,
 };
 
 enum amd_dpm_forced_level;
Signature · 6 lines
2.7.4

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 1571694305-14820-1-git-send-email-Roman.Li-5C7GfCeVMHo@public.gmane.org

Reviewed-by Nicholas Kazlauskas
#2 lore raw
Quoted 36 lines · On 2019-10-21 5:45 p.m., [email protected] wrote:

From: Roman Li <[email protected]>

[Why]
Adding psr mask to dc features allows selectively disable/enable psr. Current psr implementation may not work with non-pageflipping application. Until resolved it should be disabled by default.

[How]
Add dcfeaturemask for psr enablement. Disable by default. To enable set amdgpu.dcfeaturemask=0x8 in grub kernel command line.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index 1cf4beb..0f08879 100644
@@ -2424,7 +2424,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
  		} else if (dc_link_detect(link, DETECT_REASON_BOOT)) {
  			amdgpu_dm_update_connector_after_detect(aconnector);
  			register_backlight_device(dm, link);
-			amdgpu_dm_set_psr_caps(link);
+			if (amdgpu_dc_feature_mask & DC_PSR_MASK)
+				amdgpu_dm_set_psr_caps(link);
  		}
 
 
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 8889aac..1daa221 100644

drivers/gpu/drm/amd/include/amd_shared.h enum PP_FEATURE_MASK { · line 146

Quoted 4 lines
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
@@ -143,6 +143,7 @@ enum PP_FEATURE_MASK {
  enum DC_FEATURE_MASK {
  	DC_FBC_MASK = 0x1,
  	DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,
+	DC_PSR_MASK = 0x8,

Can this just be 0x4 instead? Any reason why we're skipping a flag here going from 0x2 to 0x8?

You can still have my:

but my preference would be on fixing this up to a 0x4 first in the commit message / DC_FEATURE_MASK.

Nicholas Kazlauskas

drivers/gpu/drm/amd/include/amd_shared.h enum PP_FEATURE_MASK { · line 149

Quoted 4 lines
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
  };
 
  enum amd_dpm_forced_level;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): f446a637-23b0-a876-7e6d-899483d0bdc6-5C7GfCeVMHo@public.gmane.org

author Reviewed-by Nicholas Kazlauskas
#4 lore raw
Quoted 1 line

Any reason why we're skipping a flag here going from 0x2 to 0x8?

0x4 is reserved for fractional pwm mask:
https://patchwork.freedesktop.org/patch/336923/

Thank you Nicholas for the review.

-----Original Message-----
From: Kazlauskas, Nicholas <[email protected]>
Sent: Tuesday, October 22, 2019 8:39 AM
To: Li, Roman <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>
Cc: Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Li, Sun peng (Leo) <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/display: add dc feature mask for psr enablement

Quoted 38 lines · On 2019-10-21 5:45 p.m., [email protected] wrote:

From: Roman Li <[email protected]>

[Why]
Adding psr mask to dc features allows selectively disable/enable psr. Current psr implementation may not work with non-pageflipping application. Until resolved it should be disabled by default.

[How]
Add dcfeaturemask for psr enablement. Disable by default. To enable set amdgpu.dcfeaturemask=0x8 in grub kernel command line.

---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
  drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
  2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index 1cf4beb..0f08879 100644
@@ -2424,7 +2424,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
  		} else if (dc_link_detect(link, DETECT_REASON_BOOT)) {
  			amdgpu_dm_update_connector_after_detect(aconnector);
  			register_backlight_device(dm, link);
-			amdgpu_dm_set_psr_caps(link);
+			if (amdgpu_dc_feature_mask & DC_PSR_MASK)
+				amdgpu_dm_set_psr_caps(link);
  		}
 
 
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 8889aac..1daa221 100644

drivers/gpu/drm/amd/include/amd_shared.h enum PP_FEATURE_MASK { · line 146

Quoted 4 lines
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
@@ -143,6 +143,7 @@ enum PP_FEATURE_MASK {
  enum DC_FEATURE_MASK {
  	DC_FBC_MASK = 0x1,
  	DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,
+	DC_PSR_MASK = 0x8,

Can this just be 0x4 instead? Any reason why we're skipping a flag here going from 0x2 to 0x8?

You can still have my:

but my preference would be on fixing this up to a 0x4 first in the commit message / DC_FEATURE_MASK.

Nicholas Kazlauskas

drivers/gpu/drm/amd/include/amd_shared.h enum PP_FEATURE_MASK { · line 149

Quoted 4 lines
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
  };
 
  enum amd_dpm_forced_level;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BL0PR12MB28204625E85855DA3144096F89680-b4cIHhjg/p+sXtSDH/[email protected]

#6 lore raw
Quoted 4 lines · Roman
Quoted 1 line

Any reason why we're skipping a flag here going from 0x2 to 0x8?

0x4 is reserved for fractional pwm mask:
https://patchwork.freedesktop.org/patch/336923/

Ah, missed that patch. No problem then, feel free to go ahead with this.

Nicholas Kazlauskas

Quoted 56 lines

Thank you Nicholas for the review.

-----Original Message-----
From: Kazlauskas, Nicholas <[email protected]>
Sent: Tuesday, October 22, 2019 8:39 AM
To: Li, Roman <[email protected]>; [email protected]; Deucher, Alexander <[email protected]>
Cc: Wentland, Harry <[email protected]>; Lakha, Bhawanpreet <[email protected]>; Li, Sun peng (Leo) <[email protected]>
Subject: Re: [PATCH] drm/amdgpu/display: add dc feature mask for psr enablement

Quoted 38 lines · On 2019-10-21 5:45 p.m., [email protected] wrote:

From: Roman Li <[email protected]>

[Why]
Adding psr mask to dc features allows selectively disable/enable psr. Current psr implementation may not work with non-pageflipping application. Until resolved it should be disabled by default.

[How]
Add dcfeaturemask for psr enablement. Disable by default. To enable set amdgpu.dcfeaturemask=0x8 in grub kernel command line.

---
   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 ++-
   drivers/gpu/drm/amd/include/amd_shared.h          | 1 +
   2 files changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
index 1cf4beb..0f08879 100644
@@ -2424,7 +2424,8 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
   		} else if (dc_link_detect(link, DETECT_REASON_BOOT)) {
   			amdgpu_dm_update_connector_after_detect(aconnector);
   			register_backlight_device(dm, link);
-			amdgpu_dm_set_psr_caps(link);
+			if (amdgpu_dc_feature_mask & DC_PSR_MASK)
+				amdgpu_dm_set_psr_caps(link);
   		}
 
 
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
index 8889aac..1daa221 100644

drivers/gpu/drm/amd/include/amd_shared.h enum PP_FEATURE_MASK { · line 146

Quoted 4 lines
drivers/gpu/drm/amd/include/amd_shared.h +1 -0
@@ -143,6 +143,7 @@ enum PP_FEATURE_MASK {
   enum DC_FEATURE_MASK {
   	DC_FBC_MASK = 0x1,
   	DC_MULTI_MON_PP_MCLK_SWITCH_MASK = 0x2,
+	DC_PSR_MASK = 0x8,

Can this just be 0x4 instead? Any reason why we're skipping a flag here going from 0x2 to 0x8?

Quoted 13 lines

You can still have my:

but my preference would be on fixing this up to a 0x4 first in the commit message / DC_FEATURE_MASK.

Nicholas Kazlauskas

Quoted 4 lines
drivers/gpu/drm/amd/include/amd_shared.h +0 -0
   };
 
   enum amd_dpm_forced_level;

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx