<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 5 June 2017 at 17:23, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div><div class="h5">On Mon, Jun 5, 2017 at 9:19 AM, Bas Nieuwenhuizen <span dir="ltr"><<a href="mailto:bas@basnieuwenhuizen.nl" target="_blank">bas@basnieuwenhuizen.nl</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On Mon, Jun 5, 2017 at 5:40 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>> wrote:<br>
> On Mon, Jun 5, 2017 at 7:48 AM, Alex Smith <<a href="mailto:asmith@feralinteractive.com" target="_blank">asmith@feralinteractive.com</a>><br>
> wrote:<br>
>><br>
>> As already done by RADV, this code is lifted straight from there.<br>
><br>
><br>
> I think this is a good idea but I'm very confused by the code.<br>
><br>
>><br>
>> Signed-off-by: Alex Smith <<a href="mailto:asmith@feralinteractive.com" target="_blank">asmith@feralinteractive.com</a>><br>
>> ---<br>
>>  src/intel/vulkan/anv_device.c | 24 +++++++++++++++++++++++-<br>
>>  1 file changed, 23 insertions(+), 1 deletion(-)<br>
>><br>
>> diff --git a/src/intel/vulkan/anv_device.<wbr>c b/src/intel/vulkan/anv_device.<wbr>c<br>
>> index aacd07f..8090eea 100644<br>
>> --- a/src/intel/vulkan/anv_device.<wbr>c<br>
>> +++ b/src/intel/vulkan/anv_device.<wbr>c<br>
>> @@ -754,6 +754,28 @@ void anv_GetPhysicalDeviceFeatures2<wbr>KHR(<br>
>>     }<br>
>>  }<br>
>><br>
>> +static uint32_t anv_get_driver_version()<br>
><br>
><br>
> First off, it would be good to put this in src/vulkan/<br>
<br>
</span>Agreed.<br>
<span><br>
><br>
>><br>
>> +{<br>
>> +   const char *minor_string = strchr(VERSION, '.');<br>
>> +   const char *patch_string = minor_string ? strchr(minor_string + 1,<br>
>> ','): NULL;<br>
><br>
><br>
> Why are we searching for "," and not "." here?<br>
<br>
</span>Looks like I made a typo, nice find!<br>
<span>><br>
>><br>
>> +   int major = atoi(VERSION);<br>
>> +   int minor = minor_string ? atoi(minor_string + 1) : 0;<br>
>> +   int patch = patch_string ? atoi(patch_string + 1) : 0;<br>
>> +   if (strstr(VERSION, "devel")) {<br>
>> +      if (patch == 0) {<br>
>> +         patch = 99;<br>
><br>
><br>
> Is this really what we want?  When I checkout the mesa-17.0.0 tag and<br>
> configure, I see this in config.log:<br>
><br>
> #define VERSION "17.0.0"<br>
><br>
> This code looks like it would call that 16.99.99 which is a version that<br>
> never existed.  Perhaps the better thing to do is to look for "-something"<br>
> at the end of the string, assert that patch == 0, and do the decrement.<br>
> That should catch -rcN as well as -devel.<br>
><br>
> Dave?  Bas?<br>
<br>
</span>Note the strstr, which checks for devel,</blockquote><div><br></div></div></div><div>Drp... You're right.<br></div><span class=""><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> so with 17.0.0, that<br>
decrement shouldn't happen. I'm open to generalizing this, I mostly<br>
did this for getting a sense of what people used on <a href="http://vulkan.gpuinfo.org" rel="noreferrer" target="_blank">vulkan.gpuinfo.org</a><br>
and so the rc's weren't really a priority.<span class="m_1528256557567035039HOEnZb"><font color="#888888"><br></font></span></blockquote><div><br></div></span><div>I'm not sure what to do about RCs.  I think it may be best to just let those count as the version for which they are an RC.  In which case the only needed change is the typo fix and moving it to src/vulkan/util.<br></div></div></div></div></blockquote><div><br></div><div>I can sort that out tomorrow.</div><div><br></div><div>Alex</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div></div><div><div class="h5"><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="m_1528256557567035039HOEnZb"><font color="#888888">
- Bas<br>
</font></span><div class="m_1528256557567035039HOEnZb"><div class="m_1528256557567035039h5"><br>
><br>
> --Jason<br>
><br>
>><br>
>> +         if (minor == 0) {<br>
>> +            minor = 99;<br>
>> +            --major;<br>
>> +         } else<br>
>> +            --minor;<br>
>> +      } else<br>
>> +         --patch;<br>
>> +   }<br>
>> +   uint32_t version = VK_MAKE_VERSION(major, minor, patch);<br>
>> +   return version;<br>
>> +}<br>
>> +<br>
>>  void anv_GetPhysicalDevicePropertie<wbr>s(<br>
>>      VkPhysicalDevice                            physicalDevice,<br>
>>      VkPhysicalDeviceProperties*                 pProperties)<br>
>> @@ -886,7 +908,7 @@ void anv_GetPhysicalDevicePropertie<wbr>s(<br>
>><br>
>>     *pProperties = (VkPhysicalDeviceProperties) {<br>
>>        .apiVersion = VK_MAKE_VERSION(1, 0, 42),<br>
>> -      .driverVersion = 1,<br>
>> +      .driverVersion = anv_get_driver_version(),<br>
>>        .vendorID = 0x8086,<br>
>>        .deviceID = pdevice->chipset_id,<br>
>>        .deviceType = VK_PHYSICAL_DEVICE_TYPE_INTEGR<wbr>ATED_GPU,<br>
>> --<br>
>> 2.9.4<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> mesa-dev mailing list<br>
>> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
>> <a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
><br>
><br>
</div></div></blockquote></div></div></div><br></div></div>
</blockquote></div><br></div></div>