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

Christian König deathsimple at vodafone.de
Thu Jul 7 07:25:18 UTC 2016


Am 06.07.2016 um 23:37 schrieb Alex Deucher:
> 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.

Yeah, I had the same concerns but I hope that this still works.

We don't access the registers of the block, but only write into the ring 
buffer. As long as the ring buffer doesn't reset during power gating we 
are fine.

If it resets then we need to split the function and move it to 
amdgpu_ring_alloc(), amdgpu_ring_commit() and/or amdgpu_ring_undo() 
instead().

Tom, please keep an eye on this if/when you work on power gating the 
UVD/VCE blocks.

Christian.

>
> Same comment about the UVD note_usage patch.
>
> Alex
>
>>   }
>>
>>   /**
>> --
>> 2.5.0
>>



More information about the amd-gfx mailing list