From: Leo Liu Subject: Re: [PATCH] drm/amdgpu: remove unused power control for vcn Date: Thu, 27 Jul 2017 11:58:54 -0400 Message-ID: <1a151b41-e78d-e0c9-ecad-0b90130947c4@amd.com> References: <1501096057-10197-1-git-send-email-leo.liu@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1692673812==" Return-path: In-Reply-To: Content-Language: en-GB List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: "Deucher, Alexander" , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" This is a multi-part message in MIME format. --===============1692673812== Content-Type: multipart/alternative; boundary="------------25D2E2E914B173C375E7A321" Content-Language: en-GB This is a multi-part message in MIME format. --------------25D2E2E914B173C375E7A321 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 07/26/2017 10:44 PM, Deucher, Alexander wrote: > > -----Original Message----- > > From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf > > Of Leo Liu > > Sent: Wednesday, July 26, 2017 3:08 PM > > To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > > Cc: Liu, Leo > > Subject: [PATCH] drm/amdgpu: remove unused power control for vcn > > > > The power control for vcn has been moved to firmware, kernel'll spins > > "amdgpu: [powerplay] pp_dpm_powergate_uvd was not implemented", > > each > > time when application runs, so let's remove it. > > > > Signed-off-by: Leo Liu > > Does firmware cover powergating/clockgating as well or just dpm? No. dpm only. > I think we may still need to handle clock and powergating manually. I will keep the function and comment it out till pg/cg, since it's annoying to spin that error message. The new patch will follow shortly. Leo > > Alex > > > --- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 23 +---------------------- > > drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h | 1 - > > drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c | 4 ++-- > > 3 files changed, 3 insertions(+), 25 deletions(-) > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c > > index 09190fa..4186f45 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c > > @@ -207,29 +207,8 @@ static void amdgpu_vcn_idle_work_handler(struct > > work_struct *work) > > container_of(work, struct amdgpu_device, > > vcn.idle_work.work); > > unsigned fences = amdgpu_fence_count_emitted(&adev- > > >vcn.ring_dec); > > > > - if (fences == 0) { > > - if (adev->pm.dpm_enabled) { > > - amdgpu_dpm_enable_uvd(adev, false); > > - } else { > > - amdgpu_asic_set_uvd_clocks(adev, 0, 0); > > - } > > - } else { > > + if (fences != 0) > > schedule_delayed_work(&adev->vcn.idle_work, > > VCN_IDLE_TIMEOUT); > > - } > > -} > > - > > -void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring) > > -{ > > - struct amdgpu_device *adev = ring->adev; > > - bool set_clocks = !cancel_delayed_work_sync(&adev- > > >vcn.idle_work); > > - > > - if (set_clocks) { > > - if (adev->pm.dpm_enabled) { > > - amdgpu_dpm_enable_uvd(adev, true); > > - } else { > > - amdgpu_asic_set_uvd_clocks(adev, 53300, 40000); > > - } > > - } > > } > > > > void amdgpu_vcn_ring_end_use(struct amdgpu_ring *ring) > > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h > > b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h > > index d50ba06..930903d 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h > > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h > > @@ -65,7 +65,6 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev); > > int amdgpu_vcn_sw_fini(struct amdgpu_device *adev); > > int amdgpu_vcn_suspend(struct amdgpu_device *adev); > > int amdgpu_vcn_resume(struct amdgpu_device *adev); > > -void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring); > > void amdgpu_vcn_ring_end_use(struct amdgpu_ring *ring); > > > > int amdgpu_vcn_dec_ring_test_ring(struct amdgpu_ring *ring); > > diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c > > b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c > > index 21e7b88..94814f0 100644 > > --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c > > +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c > > @@ -1122,7 +1122,7 @@ static const struct amdgpu_ring_funcs > > vcn_v1_0_dec_ring_vm_funcs = { > > .insert_start = vcn_v1_0_dec_ring_insert_start, > > .insert_end = vcn_v1_0_dec_ring_insert_end, > > .pad_ib = amdgpu_ring_generic_pad_ib, > > - .begin_use = amdgpu_vcn_ring_begin_use, > > + .begin_use = NULL, > > .end_use = amdgpu_vcn_ring_end_use, > > }; > > > > @@ -1148,7 +1148,7 @@ static const struct amdgpu_ring_funcs > > vcn_v1_0_enc_ring_vm_funcs = { > > .insert_nop = amdgpu_ring_insert_nop, > > .insert_end = vcn_v1_0_enc_ring_insert_end, > > .pad_ib = amdgpu_ring_generic_pad_ib, > > - .begin_use = amdgpu_vcn_ring_begin_use, > > + .begin_use = NULL, > > .end_use = amdgpu_vcn_ring_end_use, > > }; > > > > -- > > 2.7.4 > > > > _______________________________________________ > > amd-gfx mailing list > > amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > > https://lists.freedesktop.org/mailman/listinfo/amd-gfx --------------25D2E2E914B173C375E7A321 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit



On 07/26/2017 10:44 PM, Deucher, Alexander wrote:
> -----Original Message-----
> From: amd-gfx [mailto:amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org] On Behalf
> Of Leo Liu
> Sent: Wednesday, July 26, 2017 3:08 PM
> To: amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> Cc: Liu, Leo
> Subject: [PATCH] drm/amdgpu: remove unused power control for vcn
>
> The power control for vcn has been moved to firmware, kernel'll spins
> "amdgpu: [powerplay] pp_dpm_powergate_uvd was not implemented",
> each
> time when application runs, so let's remove it.
>
> Signed-off-by: Leo Liu <leo.liu-5C7GfCeVMHo@public.gmane.org>

Does firmware cover powergating/clockgating as well or just dpm?
No. dpm only.

I think we may still need to handle clock and powergating  manually.
I will keep the function and comment it out till pg/cg, since it's annoying to spin that error message.

The new patch will follow shortly.

Leo


Alex

> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c | 23 +----------------------
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h |  1 -
>  drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c   |  4 ++--
>  3 files changed, 3 insertions(+), 25 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> index 09190fa..4186f45 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c
> @@ -207,29 +207,8 @@ static void amdgpu_vcn_idle_work_handler(struct
> work_struct *work)
>                container_of(work, struct amdgpu_device,
> vcn.idle_work.work);
>        unsigned fences = amdgpu_fence_count_emitted(&adev-
> >vcn.ring_dec);
>
> -     if (fences == 0) {
> -             if (adev->pm.dpm_enabled) {
> -                     amdgpu_dpm_enable_uvd(adev, false);
> -             } else {
> -                     amdgpu_asic_set_uvd_clocks(adev, 0, 0);
> -             }
> -     } else {
> +     if (fences != 0)
>                schedule_delayed_work(&adev->vcn.idle_work,
> VCN_IDLE_TIMEOUT);
> -     }
> -}
> -
> -void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring)
> -{
> -     struct amdgpu_device *adev = ring->adev;
> -     bool set_clocks = !cancel_delayed_work_sync(&adev-
> >vcn.idle_work);
> -
> -     if (set_clocks) {
> -             if (adev->pm.dpm_enabled) {
> -                     amdgpu_dpm_enable_uvd(adev, true);
> -             } else {
> -                     amdgpu_asic_set_uvd_clocks(adev, 53300, 40000);
> -             }
> -     }
>  }
>
>  void amdgpu_vcn_ring_end_use(struct amdgpu_ring *ring)
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
> index d50ba06..930903d 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h
> @@ -65,7 +65,6 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev);
>  int amdgpu_vcn_sw_fini(struct amdgpu_device *adev);
>  int amdgpu_vcn_suspend(struct amdgpu_device *adev);
>  int amdgpu_vcn_resume(struct amdgpu_device *adev);
> -void amdgpu_vcn_ring_begin_use(struct amdgpu_ring *ring);
>  void amdgpu_vcn_ring_end_use(struct amdgpu_ring *ring);
>
>  int amdgpu_vcn_dec_ring_test_ring(struct amdgpu_ring *ring);
> diff --git a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> index 21e7b88..94814f0 100644
> --- a/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/vcn_v1_0.c
> @@ -1122,7 +1122,7 @@ static const struct amdgpu_ring_funcs
> vcn_v1_0_dec_ring_vm_funcs = {
>        .insert_start = vcn_v1_0_dec_ring_insert_start,
>        .insert_end = vcn_v1_0_dec_ring_insert_end,
>        .pad_ib = amdgpu_ring_generic_pad_ib,
> -     .begin_use = amdgpu_vcn_ring_begin_use,
> +     .begin_use = NULL,
>        .end_use = amdgpu_vcn_ring_end_use,
>  };
>
> @@ -1148,7 +1148,7 @@ static const struct amdgpu_ring_funcs
> vcn_v1_0_enc_ring_vm_funcs = {
>        .insert_nop = amdgpu_ring_insert_nop,
>        .insert_end = vcn_v1_0_enc_ring_insert_end,
>        .pad_ib = amdgpu_ring_generic_pad_ib,
> -     .begin_use = amdgpu_vcn_ring_begin_use,
> +     .begin_use = NULL,
>        .end_use = amdgpu_vcn_ring_end_use,
>  };
>
> --
> 2.7.4
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx

--------------25D2E2E914B173C375E7A321-- --===============1692673812== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============1692673812==--