[PATCH 1/9] drm/amdgpu: note VCE usage after submitting the fence

Alex Deucher alexdeucher at gmail.com
Wed Jul 6 21:37:23 UTC 2016


On Wed, Jul 6, 2016 at 3:02 PM, Christian König <deathsimple at vodafone.de> wrote:
> From: Christian König <christian.koenig at amd.com>
>
> It's rather unlikely to cause problems, but let's close this gap.
>
> Signed-off-by: Christian König <christian.koenig at amd.com>
> ---
>  drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> index 875626a..c3ae1b3 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
> @@ -360,8 +360,6 @@ void amdgpu_vce_free_handles(struct amdgpu_device *adev, struct drm_file *filp)
>                 if (!handle || adev->vce.filp[i] != filp)
>                         continue;
>
> -               amdgpu_vce_note_usage(adev);
> -
>                 r = amdgpu_vce_get_destroy_msg(ring, handle, false, NULL);
>                 if (r)
>                         DRM_ERROR("Error destroying VCE handle (%d)!\n", r);
> @@ -629,8 +627,6 @@ int amdgpu_vce_ring_parse_cs(struct amdgpu_cs_parser *p, uint32_t ib_idx)
>         uint32_t *size = &tmp;
>         int i, r = 0, idx = 0;
>
> -       amdgpu_vce_note_usage(p->adev);
> -
>         while (idx < ib->length_dw) {
>                 uint32_t len = amdgpu_get_ib_value(p, ib_idx, idx);
>                 uint32_t cmd = amdgpu_get_ib_value(p, ib_idx, idx + 1);
> @@ -789,6 +785,8 @@ void amdgpu_vce_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seq,
>         amdgpu_ring_write(ring, seq);
>         amdgpu_ring_write(ring, VCE_CMD_TRAP);
>         amdgpu_ring_write(ring, VCE_CMD_END);
> +
> +       amdgpu_vce_note_usage(ring->adev);

Note that uvd and vce note_usage also handle powergating, not just
clocks.  I don't think it matters that the block be powered up at this
point, but it would be good to confirm so this doesn't break UVD and
VCE powergating when we eventually enable them.

Same comment about the UVD note_usage patch.

Alex

>  }
>
>  /**
> --
> 2.5.0
>


More information about the amd-gfx mailing list