Re: [PATCH] drm/amdgpu: allocate entities on demand

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.

_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux