<div dir="ltr">Hi,<div class="gmail_extra"><br><div class="gmail_quote">2018-06-04 0:31 GMT+02:00 Lionel Landwerlin <span dir="ltr"><<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF"><div><div class="h5">
    <div class="m_3452819394343633296moz-cite-prefix">On 03/06/18 21:22, Mauro Rossi wrote:<br>
    </div>
    <blockquote type="cite">
      
      <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">lionel.g.landwerlin@intel.com</a><wbr>></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="m_3452819394343633296gmail-">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">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.<wbr>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></div></div>
    Here is what looks good to me (maybe Jason can confirm) :<span class=""><br>
    <br>
       uint64_t bo_flags = 0;<br>
       if
    (device->instance-><wbr>physicalDevice.supports_48bit_<wbr>addresses)<br>
          bo_flags |= EXEC_OBJECT_SUPPORTS_48B_<wbr>ADDRESS;<br></span>
       if (pdevice->use_softpin) /* You'll need to grab a pointer to
    the physical device here */</div></blockquote><div><br></div><div>The above expression should be ok:</div><div><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">   if (device->instance-></span><wbr style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">physicalDevice.</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">use_softpin</span><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">)</span><br></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">If all builds I'm sending v2 of PATCH 1/2 soon</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Thanks</span></div><div><span style="color:rgb(34,34,34);font-family:arial,sans-serif;font-size:small;font-style:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline"><br></span></div><div>Mauro</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"> </div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
          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<span class=""><br>
    <br>
    <blockquote type="cite">
      <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="m_3452819394343633296gmail-HOEnZb">
                <div class="m_3452819394343633296gmail-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>
  </span></div>

</blockquote></div><br></div></div>