[PATCH 1/5] drm/amdgpu/vce:set vce ring priority level

Sahu, Satyajit satyajit.sahu at amd.com
Thu Aug 26 08:49:36 UTC 2021


On 8/26/2021 1:49 PM, Christian König wrote:
>
>
> Am 26.08.21 um 09:13 schrieb Satyajit Sahu:
>> There are multiple rings available in VCE. Map each ring
>> to different priority.
>>
>> Signed-off-by: Satyajit Sahu <satyajit.sahu at amd.com>
>> ---
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 14 ++++++++++++++
>>   drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h | 14 ++++++++++++++
>>   2 files changed, 28 insertions(+)
>>
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
>> index 1ae7f824adc7..b68411caeac2 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c
>> @@ -1168,3 +1168,17 @@ int amdgpu_vce_ring_test_ib(struct amdgpu_ring 
>> *ring, long timeout)
>>       amdgpu_bo_free_kernel(&bo, NULL, NULL);
>>       return r;
>>   }
>> +
>> +enum vce_enc_ring_priority amdgpu_vce_get_ring_prio(int index)
>> +{
>> +    switch(index) {
>> +    case AMDGPU_VCE_GENERAL_PURPOSE:
>> +        return AMDGPU_VCE_ENC_PRIO_NORMAL;
>> +    case AMDGPU_VCE_LOW_LATENCY:
>> +        return AMDGPU_VCE_ENC_PRIO_HIGH;
>> +    case AMDGPU_VCE_REALTIME:
>> +        return AMDGPU_VCE_ENC_PRIO_VERY_HIGH;
>> +    default:
>> +        return AMDGPU_VCE_ENC_PRIO_NORMAL;
>> +    }
>> +}
>> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h 
>> b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
>> index d6d83a3ec803..60525887e9e3 100644
>> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
>> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.h
>> @@ -32,6 +32,19 @@
>>     #define AMDGPU_VCE_FW_53_45    ((53 << 24) | (45 << 16))
>>   +enum vce_enc_ring_priority {
>
> Please name that enamu amdgpu_vce_...
>
>> +    AMDGPU_VCE_ENC_PRIO_NORMAL = 1,
>> +    AMDGPU_VCE_ENC_PRIO_HIGH,
>> +    AMDGPU_VCE_ENC_PRIO_VERY_HIGH,
>
> Please use the defines Nirmoy added for that here.

I'll wait till Nirmoy's patch is merged, then rebase my changes on top 
of that.

regards,

Satyajit

>
>> +    AMDGPU_VCE_ENC_PRIO_MAX
>
> I don't think we need this any more.
>
>> +};
>> +
>> +enum vce_enc_ring_type {
>> +    AMDGPU_VCE_GENERAL_PURPOSE,
>> +    AMDGPU_VCE_LOW_LATENCY,
>> +    AMDGPU_VCE_REALTIME
>> +};
>
> Same here, I don't think we need this any more.
>
> Regards,
> Christian.
>
>> +
>>   struct amdgpu_vce {
>>       struct amdgpu_bo    *vcpu_bo;
>>       uint64_t        gpu_addr;
>> @@ -71,5 +84,6 @@ void amdgpu_vce_ring_begin_use(struct amdgpu_ring 
>> *ring);
>>   void amdgpu_vce_ring_end_use(struct amdgpu_ring *ring);
>>   unsigned amdgpu_vce_ring_get_emit_ib_size(struct amdgpu_ring *ring);
>>   unsigned amdgpu_vce_ring_get_dma_frame_size(struct amdgpu_ring *ring);
>> +enum vce_enc_ring_priority amdgpu_vce_get_ring_prio(int index);
>>     #endif
>


More information about the amd-gfx mailing list