Skip to contentSkip to conversation

drm/amd/display: For vblank_disable_immediate, check PSR is really used

PATCH Applied Michel Dänzer 3 participants 3 messages Feb 15, 2022

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

PATCH 1/1 drm/amd/display: For vblank_disable_immediate, check PSR is really used

From: Michel Dänzer <[email protected]>

Even if PSR is allowed for a present GPU, there might be no eDP link which supports PSR.

Fixes 9b510908e420 ("drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled")
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c   | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9 -8
index cd8b0d9eb19c..df86517dd532 100644
@@ -4256,6 +4256,9 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 	}
 #endif
 
+	/* Disable vblank IRQs aggressively for power-saving. */
+	adev_to_drm(adev)->vblank_disable_immediate = true;
+
 	/* loops over all connectors on the board */
 	for (i = 0; i < link_cnt; i++) {
 		struct dc_link *link = NULL;
@@ -4301,19 +4304,17 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 				update_connector_ext_caps(aconnector);
 			if (psr_feature_enabled)
 				amdgpu_dm_set_psr_caps(link);
+
+			/* TODO: Fix vblank control helpers to delay PSR entry to allow this when
+			 * PSR is also supported.
+			 */
+			if (link->psr_settings.psr_feature_enabled)
+				adev_to_drm(adev)->vblank_disable_immediate = false;
 		}
 
 
 	}
 
-	/*
-	 * Disable vblank IRQs aggressively for power-saving.
-	 *
-	 * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR
-	 * is also supported.
-	 */
-	adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;
-
 	/* Software is initialized. Now we can register interrupt handlers. */
 	switch (adev->asic_type) {
 #if defined(CONFIG_DRM_AMD_DC_SI)
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

Even if PSR is allowed for a present GPU, there might be no eDP link which supports PSR.

Fixes 9b510908e420 ("drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled")

Looks reasonable to me.

Harry

Quoted 44 lines
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c   | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9 -8
index cd8b0d9eb19c..df86517dd532 100644
@@ -4256,6 +4256,9 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 	}
 #endif
 
+	/* Disable vblank IRQs aggressively for power-saving. */
+	adev_to_drm(adev)->vblank_disable_immediate = true;
+
 	/* loops over all connectors on the board */
 	for (i = 0; i < link_cnt; i++) {
 		struct dc_link *link = NULL;
@@ -4301,19 +4304,17 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
 				update_connector_ext_caps(aconnector);
 			if (psr_feature_enabled)
 				amdgpu_dm_set_psr_caps(link);
+
+			/* TODO: Fix vblank control helpers to delay PSR entry to allow this when
+			 * PSR is also supported.
+			 */
+			if (link->psr_settings.psr_feature_enabled)
+				adev_to_drm(adev)->vblank_disable_immediate = false;
 		}
 
 
 	}
 
-	/*
-	 * Disable vblank IRQs aggressively for power-saving.
-	 *
-	 * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR
-	 * is also supported.
-	 */
-	adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;
-
 	/* Software is initialized. Now we can register interrupt handlers. */
 	switch (adev->asic_type) {
 #if defined(CONFIG_DRM_AMD_DC_SI)
Applied
#2 lore raw

Applied. Thanks!

Alex

Quoted 61 lines · Harry Wentland
Quoted 7 lines · Michel Dänzer

From: Michel Dänzer <[email protected]>

Even if PSR is allowed for a present GPU, there might be no eDP link which supports PSR.

Fixes 9b510908e420 ("drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled")

Looks reasonable to me.

Harry

Quoted 44 lines
---
 .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c   | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +9 -8
index cd8b0d9eb19c..df86517dd532 100644
@@ -4256,6 +4256,9 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
      }
 #endif
 
+     /* Disable vblank IRQs aggressively for power-saving. */
+     adev_to_drm(adev)->vblank_disable_immediate = true;
+
      /* loops over all connectors on the board */
      for (i = 0; i < link_cnt; i++) {
              struct dc_link *link = NULL;
@@ -4301,19 +4304,17 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
                              update_connector_ext_caps(aconnector);
                      if (psr_feature_enabled)
                              amdgpu_dm_set_psr_caps(link);
+
+                     /* TODO: Fix vblank control helpers to delay PSR entry to allow this when
+                      * PSR is also supported.
+                      */
+                     if (link->psr_settings.psr_feature_enabled)
+                             adev_to_drm(adev)->vblank_disable_immediate = false;
              }
 
 
      }
 
-     /*
-      * Disable vblank IRQs aggressively for power-saving.
-      *
-      * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR
-      * is also supported.
-      */
-     adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;
-
      /* Software is initialized. Now we can register interrupt handlers. */
      switch (adev->asic_type) {
 #if defined(CONFIG_DRM_AMD_DC_SI)