<div dir="ltr"><div>OK. I'll drop this patch.</div><div><br></div><div>Marek<br></div><div><br><div class="gmail_quote"><div dir="ltr">On Wed, Oct 24, 2018 at 4:14 AM Christian König <<a href="mailto:ckoenig.leichtzumerken@gmail.com">ckoenig.leichtzumerken@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Am 24.10.18 um 10:04 schrieb Michel Dänzer:<br>
> On 2018-10-23 9:07 p.m., Marek Olšák wrote:<br>
>> From: Marek Olšák <<a href="mailto:marek.olsak@amd.com" target="_blank">marek.olsak@amd.com</a>><br>
>><br>
>> ---<br>
>> amdgpu/amdgpu_bo.c | 15 +++++++++------<br>
>> 1 file changed, 9 insertions(+), 6 deletions(-)<br>
>><br>
>> diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c<br>
>> index 81f8a5f7..00b9b54a 100644<br>
>> --- a/amdgpu/amdgpu_bo.c<br>
>> +++ b/amdgpu/amdgpu_bo.c<br>
>> @@ -91,26 +91,29 @@ drm_public int amdgpu_bo_alloc(amdgpu_device_handle dev,<br>
>> if (r)<br>
>> goto out;<br>
>> <br>
>> r = amdgpu_bo_create(dev, alloc_buffer->alloc_size, args.out.handle,<br>
>> buf_handle);<br>
>> if (r) {<br>
>> amdgpu_close_kms_handle(dev, args.out.handle);<br>
>> goto out;<br>
>> }<br>
>> <br>
>> - pthread_mutex_lock(&dev->bo_table_mutex);<br>
>> - r = handle_table_insert(&dev->bo_handles, (*buf_handle)->handle,<br>
>> - *buf_handle);<br>
>> - pthread_mutex_unlock(&dev->bo_table_mutex);<br>
>> - if (r)<br>
>> - amdgpu_bo_free(*buf_handle);<br>
>> + if (alloc_buffer->preferred_heap &<br>
>> + (AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT)) {<br>
> What about AMDGPU_GEM_DOMAIN_CPU? I mean, that's unlikely to actually be<br>
> used here, but if it were, exporting and importing the resulting BO<br>
> should work fine?<br>
><br>
> Instead of white-listing the domains which can be shared, it might be<br>
> better to black-list those which can't, i.e. GDS/GWS/OA.<br>
<br>
Well first of all GDS can be shared between applications.<br>
<br>
Then adding a BO to the tracking doesn't add much overhead (only 8 bytes <br>
and only if it was the last allocated).<br>
<br>
So I don't really see a reason why we should do this?<br>
<br>
Christian.<br>
</blockquote></div></div></div>