* [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
* RE: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 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 11:37 ` Michel Dänzer 1 sibling, 1 reply; 11+ messages in thread From: Feng, Kenneth @ 2021-03-17 1:44 UTC (permalink / raw) To: R, Bindu, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Lakha, Bhawanpreet, R, Bindu [AMD Official Use Only - Internal Distribution Only] Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> -----Original Message----- From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Bindu Ramamurthy Sent: Wednesday, March 17, 2021 7:50 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; R, Bindu <Bindu.R@amd.com> Subject: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [CAUTION: External Email] [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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7CKenneth.Feng%40amd.com%7Cf2f2166bfb314e1ad12408d8e8d63f5f%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515354195323551%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=l88hqOHfw7IpxeDnWN0St7FdMFaj7xo2jiIu0xv9kn8%3D&reserved=0 _______________________________________________ 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
* RE: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-17 1:44 ` Feng, Kenneth @ 2021-03-17 3:32 ` Chen, Guchun 2021-03-17 13:31 ` R, Bindu 0 siblings, 1 reply; 11+ messages in thread From: Chen, Guchun @ 2021-03-17 3:32 UTC (permalink / raw) To: Feng, Kenneth, R, Bindu, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Lakha, Bhawanpreet, R, Bindu [AMD Public Use] + /* 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); + Above part needs to be guarded by CONFIG_DRM_AMD_DC_DCN? Regards, Guchun -----Original Message----- From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Feng, Kenneth Sent: Wednesday, March 17, 2021 9:45 AM To: R, Bindu <Bindu.R@amd.com>; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; R, Bindu <Bindu.R@amd.com> Subject: RE: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [AMD Official Use Only - Internal Distribution Only] Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> -----Original Message----- From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Bindu Ramamurthy Sent: Wednesday, March 17, 2021 7:50 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; R, Bindu <Bindu.R@amd.com> Subject: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [CAUTION: External Email] [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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cguchun.chen%40amd.com%7Cb53f164f787e4da3725a08d8e8e6472c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515423028336026%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xZouQssY4uo%2FohKAZBCdej9gKFsggBExTfQ3Ddz8D%2BQ%3D&reserved=0 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cguchun.chen%40amd.com%7Cb53f164f787e4da3725a08d8e8e6472c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515423028336026%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xZouQssY4uo%2FohKAZBCdej9gKFsggBExTfQ3Ddz8D%2BQ%3D&reserved=0 _______________________________________________ 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
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-17 3:32 ` Chen, Guchun @ 2021-03-17 13:31 ` R, Bindu 0 siblings, 0 replies; 11+ messages in thread From: R, Bindu @ 2021-03-17 13:31 UTC (permalink / raw) To: Chen, Guchun, Feng, Kenneth, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Lakha, Bhawanpreet [-- Attachment #1.1: Type: text/plain, Size: 4489 bytes --] [AMD Public Use] Thanks Guchun, yes this would require CONFIG_DRM_AMD_DC_DCN flag, will update it. Regards, Bindu ________________________________ From: Chen, Guchun <Guchun.Chen@amd.com> Sent: Tuesday, March 16, 2021 11:32 PM To: Feng, Kenneth <Kenneth.Feng@amd.com>; R, Bindu <Bindu.R@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; R, Bindu <Bindu.R@amd.com> Subject: RE: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [AMD Public Use] + /* 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); + Above part needs to be guarded by CONFIG_DRM_AMD_DC_DCN? Regards, Guchun -----Original Message----- From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Feng, Kenneth Sent: Wednesday, March 17, 2021 9:45 AM To: R, Bindu <Bindu.R@amd.com>; amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; R, Bindu <Bindu.R@amd.com> Subject: RE: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [AMD Official Use Only - Internal Distribution Only] Reviewed-by: Kenneth Feng <kenneth.feng@amd.com> -----Original Message----- From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Bindu Ramamurthy Sent: Wednesday, March 17, 2021 7:50 AM To: amd-gfx@lists.freedesktop.org Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; R, Bindu <Bindu.R@amd.com> Subject: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [CAUTION: External Email] [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://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cguchun.chen%40amd.com%7Cb53f164f787e4da3725a08d8e8e6472c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515423028336026%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xZouQssY4uo%2FohKAZBCdej9gKFsggBExTfQ3Ddz8D%2BQ%3D&reserved=0 _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cguchun.chen%40amd.com%7Cb53f164f787e4da3725a08d8e8e6472c%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515423028336026%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=xZouQssY4uo%2FohKAZBCdej9gKFsggBExTfQ3Ddz8D%2BQ%3D&reserved=0 [-- Attachment #1.2: Type: text/html, Size: 8256 bytes --] [-- Attachment #2: Type: text/plain, Size: 154 bytes --] _______________________________________________ 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
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 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 11:37 ` Michel Dänzer 2021-03-17 17:02 ` Lakha, Bhawanpreet 1 sibling, 1 reply; 11+ messages in thread From: Michel Dänzer @ 2021-03-17 11:37 UTC (permalink / raw) To: Bindu Ramamurthy, amd-gfx Cc: alexander.deucher, kenneth.feng, tao.zhou1, Bhawanpreet.Lakha On 2021-03-17 12:49 a.m., Bindu Ramamurthy wrote: > [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--; The commit log should explain why this part is needed. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-17 11:37 ` Michel Dänzer @ 2021-03-17 17:02 ` Lakha, Bhawanpreet 2021-03-19 0:44 ` R, Bindu 0 siblings, 1 reply; 11+ messages in thread From: Lakha, Bhawanpreet @ 2021-03-17 17:02 UTC (permalink / raw) To: Michel Dänzer, R, Bindu, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Feng, Kenneth [-- Attachment #1.1: Type: text/plain, Size: 2856 bytes --] [AMD Official Use Only - Internal Distribution Only] Hi Bindu, dc_allow_idle_optimizations() should be called within mutex_lock(&dm->dc_lock). Please call it right after WARN_ON(!dc_commit_state(dm->dc, dc_state)) but before unlock(). Bhawan ________________________________ From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Michel Dänzer <michel@daenzer.net> Sent: March 17, 2021 7:37 AM To: R, Bindu <Bindu.R@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com> Subject: Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. On 2021-03-17 12:49 a.m., Bindu Ramamurthy wrote: > [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--; The commit log should explain why this part is needed. -- Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=04%7C01%7Cbhawanpreet.lakha%40amd.com%7C11fd0779679742148e2a08d8e938fe34%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515778296313590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2BPsyjDxRCTdR9HL1QSlCraWo7YpFg%2FJT8i%2BSsG%2BQvZE%3D&reserved=0 Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cbhawanpreet.lakha%40amd.com%7C11fd0779679742148e2a08d8e938fe34%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515778296313590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=L4fr6qPeO5rcMi0zg9bk9xLRTKtyVRTJ3LcSPd3Qlyw%3D&reserved=0 [-- Attachment #1.2: Type: text/html, Size: 6076 bytes --] [-- Attachment #2: Type: text/plain, Size: 154 bytes --] _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-17 17:02 ` Lakha, Bhawanpreet @ 2021-03-19 0:44 ` R, Bindu 2021-03-19 10:31 ` Michel Dänzer 0 siblings, 1 reply; 11+ messages in thread From: R, Bindu @ 2021-03-19 0:44 UTC (permalink / raw) To: Lakha, Bhawanpreet, Michel Dänzer, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Feng, Kenneth [-- Attachment #1.1: Type: text/plain, Size: 3490 bytes --] [AMD Official Use Only - Internal Distribution Only] Hi All, Thanks for the inputs, have updated the patch to include these changes. Regards, Bindu ________________________________ From: Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com> Sent: Wednesday, March 17, 2021 1:02 PM To: Michel Dänzer <michel@daenzer.net>; R, Bindu <Bindu.R@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com> Subject: Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [AMD Official Use Only - Internal Distribution Only] Hi Bindu, dc_allow_idle_optimizations() should be called within mutex_lock(&dm->dc_lock). Please call it right after WARN_ON(!dc_commit_state(dm->dc, dc_state)) but before unlock(). Bhawan ________________________________ From: amd-gfx <amd-gfx-bounces@lists.freedesktop.org> on behalf of Michel Dänzer <michel@daenzer.net> Sent: March 17, 2021 7:37 AM To: R, Bindu <Bindu.R@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com> Subject: Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. On 2021-03-17 12:49 a.m., Bindu Ramamurthy wrote: > [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--; The commit log should explain why this part is needed. -- Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=04%7C01%7Cbhawanpreet.lakha%40amd.com%7C11fd0779679742148e2a08d8e938fe34%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515778296313590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=%2BPsyjDxRCTdR9HL1QSlCraWo7YpFg%2FJT8i%2BSsG%2BQvZE%3D&reserved=0 Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&data=04%7C01%7Cbhawanpreet.lakha%40amd.com%7C11fd0779679742148e2a08d8e938fe34%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637515778296313590%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=L4fr6qPeO5rcMi0zg9bk9xLRTKtyVRTJ3LcSPd3Qlyw%3D&reserved=0 [-- Attachment #1.2: Type: text/html, Size: 7598 bytes --] [-- Attachment #2: Type: text/plain, Size: 154 bytes --] _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-19 0:44 ` R, Bindu @ 2021-03-19 10:31 ` Michel Dänzer 2021-03-20 0:31 ` R, Bindu 0 siblings, 1 reply; 11+ messages in thread From: Michel Dänzer @ 2021-03-19 10:31 UTC (permalink / raw) To: R, Bindu, Lakha, Bhawanpreet, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Feng, Kenneth On 2021-03-19 1:44 a.m., R, Bindu wrote: > > Hi All, > Thanks for the inputs, have updated the patch to include these changes. Updated where? I can't find an updated patch. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-19 10:31 ` Michel Dänzer @ 2021-03-20 0:31 ` R, Bindu 2021-03-22 9:32 ` Michel Dänzer 0 siblings, 1 reply; 11+ messages in thread From: R, Bindu @ 2021-03-20 0:31 UTC (permalink / raw) To: Michel Dänzer, Lakha, Bhawanpreet, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Feng, Kenneth [-- Attachment #1.1: Type: text/plain, Size: 1292 bytes --] [AMD Official Use Only - Internal Distribution Only] The Update patch has been submitted. Regards, Bindu ________________________________ From: Michel Dänzer <michel@daenzer.net> Sent: Friday, March 19, 2021 6:31 AM To: R, Bindu <Bindu.R@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com> Subject: Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. On 2021-03-19 1:44 a.m., R, Bindu wrote: > > Hi All, > Thanks for the inputs, have updated the patch to include these changes. Updated where? I can't find an updated patch. -- Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=04%7C01%7CBindu.R%40amd.com%7Cbc31225c76884a58559a08d8eac22531%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637517466881726765%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&sdata=q9%2BGxePhTKfpQkLZnZ%2B5jV1gSb0hYpAeijoLehJvn4A%3D&reserved=0 Libre software enthusiast | Mesa and X developer [-- Attachment #1.2: Type: text/html, Size: 3410 bytes --] [-- Attachment #2: Type: text/plain, Size: 154 bytes --] _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-20 0:31 ` R, Bindu @ 2021-03-22 9:32 ` Michel Dänzer 2021-03-22 22:00 ` R, Bindu 0 siblings, 1 reply; 11+ messages in thread From: Michel Dänzer @ 2021-03-22 9:32 UTC (permalink / raw) To: R, Bindu, Lakha, Bhawanpreet, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Feng, Kenneth On 2021-03-20 1:31 a.m., R, Bindu wrote: > > The Update patch has been submitted. Submitted where? Still can't see it. -- Earthling Michel Dänzer | https://redhat.com Libre software enthusiast | Mesa and X developer _______________________________________________ amd-gfx mailing list amd-gfx@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/amd-gfx ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. 2021-03-22 9:32 ` Michel Dänzer @ 2021-03-22 22:00 ` R, Bindu 0 siblings, 0 replies; 11+ messages in thread From: R, Bindu @ 2021-03-22 22:00 UTC (permalink / raw) To: Michel Dänzer, Lakha, Bhawanpreet, amd-gfx Cc: Deucher, Alexander, Zhou1, Tao, Feng, Kenneth [-- Attachment #1.1: Type: text/plain, Size: 1446 bytes --] [AMD Official Use Only - Internal Distribution Only] Hi, The updated patch has been merged and is available with commit ID "ef5c594461650de0a18aa0bfd240189991790d7e". Somehow missed to mail the updated version, attached is the updated patch, please review and let me know if any changes required. Thanks, Bindu ________________________________ From: Michel Dänzer <michel@daenzer.net> Sent: Monday, March 22, 2021 5:32 AM To: R, Bindu <Bindu.R@amd.com>; Lakha, Bhawanpreet <Bhawanpreet.Lakha@amd.com>; amd-gfx@lists.freedesktop.org <amd-gfx@lists.freedesktop.org> Cc: Deucher, Alexander <Alexander.Deucher@amd.com>; Zhou1, Tao <Tao.Zhou1@amd.com>; Feng, Kenneth <Kenneth.Feng@amd.com> Subject: Re: [PATCH] drm/amd/display: Allow idle optimization based on vblank. On 2021-03-20 1:31 a.m., R, Bindu wrote: > > The Update patch has been submitted. Submitted where? Still can't see it. -- Earthling Michel Dänzer | https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fredhat.com%2F&data=04%7C01%7CBindu.R%40amd.com%7C5ecbf65b60ec491fbc4408d8ed156b10%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637520023540798291%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0&sdata=VcoJRCxTATVs8JZZU%2FzcYxM1yfFFq1Z8perrtVU1PKE%3D&reserved=0 Libre software enthusiast | Mesa and X developer [-- Attachment #1.2: Type: text/html, Size: 4226 bytes --] [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #2: 0001-drm-amd-display-Allow-idle-optimization-based-on-vbl.patch --] [-- Type: text/x-patch; name="0001-drm-amd-display-Allow-idle-optimization-based-on-vbl.patch", Size: 1791 bytes --] From ef5c594461650de0a18aa0bfd240189991790d7e Mon Sep 17 00:00:00 2001 From: Bindu Ramamurthy <bindu.r@amd.com> Date: Tue, 16 Mar 2021 17:08:47 -0400 Subject: [PATCH] drm/amd/display: Allow idle optimization based on vblank. [Why] idle optimization was being disabled after commit. [How] check vblank count for display off and enable idle optimization based on this count. Also,check added to ensure vblank count does not decrement, when count reaches 0. Signed-off-by: Bindu Ramamurthy <bindu.r@amd.com> --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 9 +++++++-- 1 file changed, 7 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 6e7a333abbe0..f455fc3aa561 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( @@ -8705,9 +8705,14 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) dm_enable_per_frame_crtc_master_sync(dc_state); mutex_lock(&dm->dc_lock); WARN_ON(!dc_commit_state(dm->dc, dc_state)); +#if defined(CONFIG_DRM_AMD_DC_DCN) + /* 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); +#endif mutex_unlock(&dm->dc_lock); } - + for_each_new_crtc_in_state(state, crtc, new_crtc_state, i) { struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc); -- 2.25.1 [-- Attachment #3: Type: text/plain, Size: 154 bytes --] _______________________________________________ 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.