<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<p style="font-family:Arial;font-size:10pt;color:#008000;margin:15pt;" align="Left">
[Public]<br>
</p>
<br>
<div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Acked-by: Alex Deucher <alexander.deucher@amd.com><br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
<b>Sent:</b> Tuesday, November 30, 2021 9:53 AM<br>
<b>To:</b> amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org><br>
<b>Cc:</b> Kazlauskas, Nicholas <Nicholas.Kazlauskas@amd.com>; Wentland, Harry <Harry.Wentland@amd.com>; Deucher, Alexander <Alexander.Deucher@amd.com><br>
<b>Subject:</b> [PATCH] drm/amdgpu/display: Only set vblank_disable_immediate when PSR is not enabled</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">[Why]<br>
PSR currently relies on the kernel's delayed vblank on/off mechanism<br>
as an implicit bufferring mechanism to prevent excessive entry/exit.<br>
<br>
Without this delay the user experience is impacted since it can take<br>
a few frames to enter/exit.<br>
<br>
[How]<br>
Only allow vblank disable immediate for DC when psr is not supported.<br>
<br>
Leave a TODO indicating that this support should be extended in the<br>
future to delay independent of the vblank interrupt.<br>
<br>
Fixes: 3d1508b73ff1 ("drm/amdgpu/display: set vblank_disable_immediate for DC")<br>
<br>
Cc: Harry Wentland <harry.wentland@amd.com><br>
Cc: Alex Deucher <alexander.deucher@amd.com><br>
Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com><br>
---<br>
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 11 ++++++++---<br>
1 file changed, 8 insertions(+), 3 deletions(-)<br>
<br>
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
index 0747dc7922c2..d582d44c02ad 100644<br>
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c<br>
@@ -1599,9 +1599,6 @@ static int amdgpu_dm_init(struct amdgpu_device *adev)<br>
adev_to_drm(adev)->mode_config.cursor_width = adev->dm.dc->caps.max_cursor_size;<br>
adev_to_drm(adev)->mode_config.cursor_height = adev->dm.dc->caps.max_cursor_size;<br>
<br>
- /* Disable vblank IRQs aggressively for power-saving */<br>
- adev_to_drm(adev)->vblank_disable_immediate = true;<br>
-<br>
if (drm_vblank_init(adev_to_drm(adev), adev->dm.display_indexes_num)) {<br>
DRM_ERROR(<br>
"amdgpu: failed to initialize sw for display support.\n");<br>
@@ -4264,6 +4261,14 @@ static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)<br>
<br>
}<br>
<br>
+ /*<br>
+ * Disable vblank IRQs aggressively for power-saving.<br>
+ *<br>
+ * TODO: Fix vblank control helpers to delay PSR entry to allow this when PSR<br>
+ * is also supported.<br>
+ */<br>
+ adev_to_drm(adev)->vblank_disable_immediate = !psr_feature_enabled;<br>
+<br>
/* Software is initialized. Now we can register interrupt handlers. */<br>
switch (adev->asic_type) {<br>
#if defined(CONFIG_DRM_AMD_DC_SI)<br>
-- <br>
2.25.1<br>
<br>
</div>
</span></font></div>
</div>
</body>
</html>