[PATCH] drm/amdgpu: allocate entities on demand

Christian König christian.koenig at amd.com
Fri Jan 24 12:56:43 UTC 2020


Am 24.01.20 um 13:43 schrieb Nirmoy:
>
>
> On 1/24/20 1:09 PM, Christian König wrote:
>>> + return  -ENOMEM;
>>
>> That's complete overkill, just statically allocate the array in the 
>> amdgpu_ctx structure.
>>
>> The maximum instance should be 4 IIRC, so something like "struct 
>> amdgpu_ctx_entity *entities[AMDGPU_HW_IP_NUM][4];" so a maximum of 
>> 288 bytes used.
>>
>> Only alternative I see would be to allocate the array behind the 
>> structure, see dma_resv_list_alloc() for an example on how to do 
>> this. But I don't think that this is worth it.
> Resent with added
> +#define AMDGPU_MAX_ENTITY_NUM 4

Yes, of course that is certainly a good idea as well.

Christian.

>
> Regards,
> Nirmoy
>>
>> Christian.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20200124/5f18757c/attachment-0001.htm>


More information about the amd-gfx mailing list