<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">Am 24.01.20 um 13:43 schrieb Nirmoy:<br>
</div>
<blockquote type="cite" cite="mid:c62a3859-dbfb-8b5e-ec9c-4498220e3f61@amd.com">
<p><br>
</p>
<div class="moz-cite-prefix">On 1/24/20 1:09 PM, Christian König
wrote:<br>
</div>
<blockquote type="cite" cite="mid:bc9b30e6-1ecb-574f-8712-446091cca580@amd.com">
<blockquote type="cite" style="color: #000000;">+
return -ENOMEM; <br>
</blockquote>
<br>
That's complete overkill, just statically allocate the array in
the amdgpu_ctx structure. <br>
<br>
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. <br>
<br>
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. <br>
</blockquote>
Resent with added <br>
<pre class="moz-quote-pre" wrap="">+#define AMDGPU_MAX_ENTITY_NUM 4</pre>
</blockquote>
<br>
Yes, of course that is certainly a good idea as well.<br>
<br>
Christian.<br>
<br>
<blockquote type="cite" cite="mid:c62a3859-dbfb-8b5e-ec9c-4498220e3f61@amd.com">
<pre class="moz-quote-pre" wrap="">
Regards,
Nirmoy
</pre>
<blockquote type="cite" cite="mid:bc9b30e6-1ecb-574f-8712-446091cca580@amd.com"> <br>
Christian. <br>
</blockquote>
</blockquote>
<br>
</body>
</html>