<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  </head>
  <body>
    <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

Regards,
Nirmoy 
</pre>
    <blockquote type="cite" cite="mid:bc9b30e6-1ecb-574f-8712-446091cca580@amd.com">
      <br>
      Christian.
      <br>
    </blockquote>
  </body>
</html>