[PATCH] drm/amdgpu: allocate entities on demand
Nirmoy
nirmodas at amd.com
Fri Jan 24 12:43:48 UTC 2020
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
Regards,
Nirmoy
>
> Christian.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/amd-gfx/attachments/20200124/6b44583b/attachment.htm>
More information about the amd-gfx
mailing list