<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">On 03/06/18 21:22, Mauro Rossi wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAEQFVGbOGyOkv9-bYMZWMXjWdAUgzB9nM9A8GgMzS9L0so6MGw@mail.gmail.com">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div dir="ltr">Hi there,
<div class="gmail_extra"><br>
<div class="gmail_quote">2018-06-03 21:52 GMT+02:00 Lionel
Landwerlin <span dir="ltr"><<a
href="mailto:lionel.g.landwerlin@intel.com"
target="_blank" moz-do-not-send="true">lionel.g.landwerlin@intel.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex"><span class="gmail-">On
03/06/18 19:41, Mauro Rossi wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
Change to avoid building error:<br>
<br>
external/mesa/src/intel/vulkan<wbr>/anv_android.c:131:72:<br>
error: too few arguments to function call, expected 5,
have 4<br>
result = anv_bo_cache_import(device,
&device->bo_cache, dma_buf, &bo);<br>
~~~~~~~~~~~~~~~~~~~
^<br>
1 error generated.<br>
<br>
Fixes: b0d50247a7 ("anv/allocator: Set the BO flags in
bo_cache_alloc/import")<br>
Signed-off-by: Mauro Rossi <<a
href="mailto:issor.oruam@gmail.com" target="_blank"
moz-do-not-send="true">issor.oruam@gmail.com</a>><br>
---<br>
src/intel/vulkan/anv_android.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_android<wbr>.c
b/src/intel/vulkan/anv_android<wbr>.c<br>
index 7e07dbaaa4..ed5da5b537 100644<br>
--- a/src/intel/vulkan/anv_android<wbr>.c<br>
+++ b/src/intel/vulkan/anv_android<wbr>.c<br>
@@ -128,7 +128,7 @@ anv_image_from_gralloc(VkDevic<wbr>e
device_h,<br>
*/<br>
int dma_buf =
gralloc_info->handle->data[0];<br>
- result = anv_bo_cache_import(device,
&device->bo_cache, dma_buf, &bo);<br>
+ result = anv_bo_cache_import(device,
&device->bo_cache, dma_buf, 0, &bo);<br>
</blockquote>
<br>
</span>
If you look at anv_intel.c here are the flags that we use
:<br>
<br>
uint64_t bo_flags = 0;<br>
if (device->instance->physicalDev<wbr>ice.supports_48bit_addresses)<br>
bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRE<wbr>SS;<br>
<br>
I'm pretty sure we want the same, potentially also the
async flag?</blockquote>
<div><br>
</div>
<div>Please I need review on the correctness or
improvements,</div>
<div>because I just put 0 as bo_flags as a deduction based
on similar change </div>
<div>in src/intel/vulkan/anv_queue.c where
in anv_bo_cache_import() call the bo_flag was set to 0</div>
<div><br>
</div>
<div>Thanks<br>
</div>
<div>M.</div>
</div>
</div>
</div>
</blockquote>
<br>
Here is what looks good to me (maybe Jason can confirm) :<br>
<br>
uint64_t bo_flags = 0;<br>
if
(device->instance->physicalDevice.supports_48bit_addresses)<br>
bo_flags |= EXEC_OBJECT_SUPPORTS_48B_ADDRESS;<br>
if (pdevice->use_softpin) /* You'll need to grab a pointer to
the physical device here */<br>
bo_flags |= EXEC_OBJECT_PINNED;<br>
<br>
anv_queue.c is for fences which are buffers we don't actually touch
for the GPU.<br>
They're just used for creating/dealing with dependency graph of
workloads.<br>
<br>
It seems anv_intel.c needs updating, or maybe we should just drop
that extensions now that we have other means of importing BOs.<br>
<br>
Thanks for looking into this,<br>
<br>
-<br>
Lionel<br>
<br>
<blockquote type="cite"
cite="mid:CAEQFVGbOGyOkv9-bYMZWMXjWdAUgzB9nM9A8GgMzS9L0so6MGw@mail.gmail.com">
<div dir="ltr">
<div class="gmail_extra">
<div class="gmail_quote">
<div> </div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
<div class="gmail-HOEnZb">
<div class="gmail-h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">
if (result != VK_SUCCESS) {<br>
return vk_errorf(device->instance,
device, result,<br>
"failed to import dma-buf
from VkNativeBufferANDROID");<br>
</blockquote>
<br>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>