<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On 03/01/2017 07:21 AM, Xu, Randy
wrote:<br>
</div>
<blockquote
cite="mid:ED23C0EC80CA454080E4450B3058EEA169B13E56@SHSMSX101.ccr.corp.intel.com"
type="cite">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered
medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:SimSun;
panose-1:2 1 6 0 3 1 1 1 1 1;}
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
{font-family:Consolas;
panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
{font-family:"\@SimSun";
panose-1:2 1 6 0 3 1 1 1 1 1;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:purple;
text-decoration:underline;}
p
{mso-style-priority:99;
mso-margin-top-alt:auto;
margin-right:0in;
mso-margin-bottom-alt:auto;
margin-left:0in;
font-size:12.0pt;
font-family:"Times New Roman",serif;
color:black;}
pre
{mso-style-priority:99;
mso-style-link:"HTML Preformatted Char";
margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";
color:black;}
span.hoenzb
{mso-style-name:hoenzb;}
span.HTMLPreformattedChar
{mso-style-name:"HTML Preformatted Char";
mso-style-priority:99;
mso-style-link:"HTML Preformatted";
font-family:"Consolas",serif;
color:black;}
span.EmailStyle21
{mso-style-type:personal;
font-family:"Calibri",sans-serif;
color:#1F497D;}
span.EmailStyle22
{mso-style-type:personal-compose;
font-family:"Calibri",sans-serif;
color:windowtext;}
.MsoChpDefault
{mso-style-type:export-only;
font-size:10.0pt;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Hi,
Tapani<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">According
to
</span><a moz-do-not-send="true"
href="https://source.android.com/devices/graphics/implement-vulkan.html"
target="_blank">https://source.android.com/devices/graphics/implement-vulkan.html</a><br>
<span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">"Window
System Integration (WSI) extensions are exported by the
loader and primarily implemented in it rather than the
driver.". Also, Google provides the stubhal.c in
frameworks/native/vulkan/libvulkan, the
VK_ANDROID_native_buffer functions are implemented there as
a sample.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">The
reason I guess is that VK_ANDROID_native_buffer
implementation needs to access Gralloc HAL data structure,
but mesa driver should have no dependency to Android HAL,
which is required by HAL Binderization.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
</div>
</blockquote>
<br>
We have a dependency on gralloc in the EGL layer so that is why I
don't see it as a problem for Vulkan WSI.<br>
<br>
I'm OK with having it in HAL but maybe we should still spend some
time to figure out a way to expose extension from there (inject
string to extensions list in a way or another). Loader wraps
extension list and exposes different one to applications than it has
from driver, maybe should take some look there how it does all this.<br>
<br>
<br>
<blockquote
cite="mid:ED23C0EC80CA454080E4450B3058EEA169B13E56@SHSMSX101.ccr.corp.intel.com"
type="cite">
<div class="WordSection1">
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">This
patch doesn’t expose VK_ANDROID_native_buffer extension in
driver (as the function is not implemented here), but avoid
screening it when create device.<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Randy<o:p></o:p></span></p>
<p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"><o:p> </o:p></span></p>
<div>
<div style="border:none;border-top:solid #E1E1E1
1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">From:</span></b><span
style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:windowtext">
Palli, Tapani
<br>
<b>Sent:</b> Wednesday, March 1, 2017 1:03 PM<br>
<b>To:</b> Jason Ekstrand <a class="moz-txt-link-rfc2396E" href="mailto:jason@jlekstrand.net"><jason@jlekstrand.net></a>;
Xu, Randy <a class="moz-txt-link-rfc2396E" href="mailto:randy.xu@intel.com"><randy.xu@intel.com></a><br>
<b>Cc:</b> <a class="moz-txt-link-abbreviated" href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<b>Subject:</b> Re: [Mesa-dev] [PATCH] Vulkan: Add
VK_ANDROID_native_buffer to device extension list<o:p></o:p></span></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On 03/01/2017 06:17 AM, Jason Ekstrand
wrote:<o:p></o:p></p>
</div>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal">On Tue, Feb 28, 2017 at 7:52 PM,
Randy Xu <<a moz-do-not-send="true"
href="mailto:randy.xu@intel.com" target="_blank">randy.xu@intel.com</a>>
wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">The VK_ANDROID_native_buffer is
implemented in Android Vulkan HAL,<br>
not driver, but must be claimed in device extension
list. Otherwise,<br>
this extension will be screened off in framework and
driver.<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal" style="margin-bottom:12.0pt">This
seems rather odd. Can't the Vulkan HAL just hook
into vkEnumerateDeviceExtensionProperties and add it
to the list there? It seems a bit odd to advertise
an extension but not actually provide any of the
functionality.<o:p></o:p></p>
</div>
</div>
</div>
</div>
</blockquote>
<p class="MsoNormal"><br>
This was my question as well. I proposed Randy to include
functionality, at the moment it would be along these lines:<br>
<br>
<a moz-do-not-send="true"
href="https://github.com/android-ia/external-mesa/commit/8b6b2fc4de933c03feba33e5b57c20262e7983cc">https://github.com/android-ia/external-mesa/commit/8b6b2fc4de933c03feba33e5b57c20262e7983cc</a><br>
<br>
I don't have a strong preference where functionality exists
but it seems like ideally the whole thing would exist in one
single component. If the extension list cannot be modified in
HAL then this becomes harder to achieve in HAL.<br>
<br>
<br>
<o:p></o:p></p>
<blockquote style="margin-top:5.0pt;margin-bottom:5.0pt">
<div>
<div>
<div>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">Test: Pass Vulkan
dEQP-VK.wsi.android.swapchain.* on Android platform<br>
<br>
Signed-off-by: Randy Xu <<a
moz-do-not-send="true"
href="mailto:randy.xu@intel.com">randy.xu@intel.com</a>><br>
---<br>
<a moz-do-not-send="true"
href="http://Android.common.mk" target="_blank">Android.common.mk</a>
| 3 +++<br>
src/intel/vulkan/anv_device.c | 9 +++++++++<br>
2 files changed, 12 insertions(+)<br>
<br>
diff --git a/<a moz-do-not-send="true"
href="http://Android.common.mk" target="_blank">Android.common.mk</a>
b/<a moz-do-not-send="true"
href="http://Android.common.mk" target="_blank">Android.common.mk</a><br>
index 611162a..f49189b 100644<br>
--- a/<a moz-do-not-send="true"
href="http://Android.common.mk" target="_blank">Android.common.mk</a><br>
+++ b/<a moz-do-not-send="true"
href="http://Android.common.mk" target="_blank">Android.common.mk</a><br>
@@ -116,6 +116,9 @@ else<br>
LOCAL_CFLAGS +=
-DDEFAULT_DRIVER_DIR=\"/system/lib/$(MESA_DRI_MODULE_REL_PATH)\"<br>
endif<br>
<br>
+# Enable VK_ANDROID_native_buffer<br>
+LOCAL_CFLAGS += -DVK_USE_PLATFORM_ANDROID_KHR<br>
+<br>
# uncomment to keep the debug symbols<br>
#LOCAL_STRIP_MODULE := false<br>
<br>
diff --git a/src/intel/vulkan/anv_device.c
b/src/intel/vulkan/anv_device.c<br>
index 0db96f2..478d753 100644<br>
--- a/src/intel/vulkan/anv_device.c<br>
+++ b/src/intel/vulkan/anv_device.c<br>
@@ -258,6 +258,15 @@ static const
VkExtensionProperties device_extensions[] = {<br>
.extensionName =
VK_KHR_MAINTENANCE1_EXTENSION_NAME,<br>
.specVersion = 1,<br>
},<br>
+#ifdef VK_USE_PLATFORM_ANDROID_KHR<br>
+ {<br>
+ // Refer <a moz-do-not-send="true"
href="https://source.android.com/devices/graphics/implement-vulkan.html"
target="_blank">
https://source.android.com/devices/graphics/implement-vulkan.html</a><br>
+ // "Window System Integration (WSI)
extensions are exported by the loader<br>
+ // and primarily implemented in it rather
than the driver."<br>
+ .extensionName = "VK_ANDROID_native_buffer",<o:p></o:p></p>
</blockquote>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">In the other places, we use the
EXTENSION_NAME #define<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"> <o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC
1.0pt;padding:0in 0in 0in
6.0pt;margin-left:4.8pt;margin-right:0in">
<p class="MsoNormal">+ .specVersion = 1,<br>
+ },<br>
+#endif<br>
{<br>
.extensionName =
VK_KHR_SHADER_DRAW_PARAMETERS_EXTENSION_NAME,<br>
.specVersion = 1,<br>
<span class="hoenzb"><span style="color:#888888">--</span></span><span
style="color:#888888"><br>
<span class="hoenzb">2.7.4</span><br>
<br>
<span class="hoenzb">_______________________________________________</span><br>
<span class="hoenzb">mesa-dev mailing list</span><br>
<span class="hoenzb"><a moz-do-not-send="true"
href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a></span><br>
<span class="hoenzb"><a moz-do-not-send="true"
href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev"
target="_blank">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a></span></span><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><br>
<br>
<br>
<o:p></o:p></p>
<pre>_______________________________________________<o:p></o:p></pre>
<pre>mesa-dev mailing list<o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><o:p></o:p></pre>
<pre><a moz-do-not-send="true" href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev">https://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><o:p></o:p></pre>
</blockquote>
<p><o:p> </o:p></p>
</div>
</blockquote>
<p><br>
</p>
</body>
</html>