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.
_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx