All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Allow idle optimization based on vblank.
@ 2021-03-16 23:49 Bindu Ramamurthy
  2021-03-17  1:44 ` Feng, Kenneth
  2021-03-17 11:37 ` Michel Dänzer
  0 siblings, 2 replies; 11+ messages in thread
From: Bindu Ramamurthy @ 2021-03-16 23:49 UTC (permalink / raw)
  To: amd-gfx
  Cc: alexander.deucher, Bhawanpreet.Lakha, tao.zhou1, kenneth.feng,
	Bindu Ramamurthy

[Why]
idle optimization was being disabled after commit.

[How]
check vblank count for display off and enable idle optimization based on this count.

Signed-off-by: Bindu Ramamurthy <bindu.r@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index 553e39f9538c..56a55143ad2d 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -987,7 +987,7 @@ static void event_mall_stutter(struct work_struct *work)
 
 	if (vblank_work->enable)
 		dm->active_vblank_irq_count++;
-	else
+	else if(dm->active_vblank_irq_count)
 		dm->active_vblank_irq_count--;
 
 	dc_allow_idle_optimizations(
@@ -8694,7 +8694,10 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)
 		WARN_ON(!dc_commit_state(dm->dc, dc_state));
 		mutex_unlock(&dm->dc_lock);
 	}
-
+    /* Allow idle optimization when vblank count is 0 for display off */
+    if (dm->active_vblank_irq_count == 0)
+               dc_allow_idle_optimizations(dm->dc,true);
+			   
 	for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) {
 		struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
 
-- 
2.25.1

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

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

end of thread, other threads:[~2021-03-22 22:00 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-16 23:49 [PATCH] drm/amd/display: Allow idle optimization based on vblank Bindu Ramamurthy
2021-03-17  1:44 ` Feng, Kenneth
2021-03-17  3:32   ` Chen, Guchun
2021-03-17 13:31     ` R, Bindu
2021-03-17 11:37 ` Michel Dänzer
2021-03-17 17:02   ` Lakha, Bhawanpreet
2021-03-19  0:44     ` R, Bindu
2021-03-19 10:31       ` Michel Dänzer
2021-03-20  0:31         ` R, Bindu
2021-03-22  9:32           ` Michel Dänzer
2021-03-22 22:00             ` R, Bindu

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.