[RFC PATCH] drm/amdgpu: allocate entities on demand
Christian König
christian.koenig at amd.com
Mon Jan 20 13:09:38 UTC 2020
Am 20.01.20 um 14:05 schrieb Nirmoy:
> Hi Christian,
>
> On 11/26/19 10:45 AM, Christian König wrote:
>> It looks like a start, but there numerous things which needs to be
>> fixed.
>>
>> Question number one is: What's that good for? Entities are not the
>> problem here. The real issue is the fence ring and the rq_list.
>>
>> The rq_list could actually be made constant since it should never be
>> changed by the entity. It is only changed for backward compatibility
>> in drm_sched_entity_set_priority().
>>
>> So I would start there and cleanup the
>> drm_sched_entity_set_priority() to actually just set a new constant
>> rq list instead.
>>
>> Then we could embed the fences in amdgpu_ctx_entity as dynamic array
>> at the end of the structure.
>>
> amdgpu_ctx_entity already contains a fence array. Do you mean another
> fence array ?
No I meant that one. See currently this fence array is allocated
separately because its size depends on a module parameter (IIRC that was
one big allocation for all entities).
Where we want to get is that it is allocated together with the
amdgpu_ctx_entity as a dynamic array.
Regards,
Christian.
>
> struct amdgpu_ctx_entity {
>
> uint64_t sequence;
> struct dma_fence **fences;
> struct drm_sched_entity entity;
> };
>
>
>
> Regards,
>
> Nirmoy
>
>> And last we can start to dynamic allocate and initialize the
>> amdgpu_ctx_entity() structures.
>>
>> Regards,
>> Christian.
>>
>>
More information about the amd-gfx
mailing list