summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_device.c
Commit message (Collapse)AuthorAgeFilesLines
* anv/device: Implicitly unmap memory objects in FreeMemoryJason Ekstrand2016-12-151-0/+9
| | | | | | | | | | | | From the Vulkan spec version 1.0.32 docs for vkFreeMemory: "If a memory object is mapped at the time it is freed, it is implicitly unmapped." Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> (cherry picked from commit b1217eada9e32bf387d4d14615340aa5b5fd1f5c)
* anv/device: Return the right error for failed mapsJason Ekstrand2016-12-151-2/+7
| | | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Cc: "12.0 13.0" <mesa-dev@lists.freedesktop.org> (cherry picked from commit 920f34a2d9f14f023aee5203baa110c971519ee8)
* radv: set maxFragmentDualSrcAttachments to 1Dave Airlie2016-12-141-1/+1
| | | | | | | | Reported-by: Ilia Mirkin <imirkin@alum.mit.edu> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Signed-off-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit eaf0768b8f9a9fd76b44a4d60826ef1f42fc6a46)
* anv: Update the teardown in reverse order of the anv_CreateDeviceGwan-gyeong Mun2016-12-141-9/+14
| | | | | | | | | | | | This updates releasing of resource in reverse order of the anv_CreateDevice to anv_DestroyDevice. And it fixes resource leak in pthread_mutex, pthread_cond, anv_gem_context. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Mun Gwan-gyeong <elongbug@gmail.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit b178652b41410483dcd82aba495eab6bc892ab15)
* anv: don't leak memory if anv_init_wsi() failsEmil Velikov2016-12-141-2/+4
| | | | | | | | | brw_compiler_create() rzalloc-ates memory which we forgot to free. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit a1cf494f7740c2afb851ffc3248e2cfa54d74ead)
* anv: don't double-close the same fdEmil Velikov2016-12-141-2/+1
| | | | | | Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> (cherry picked from commit 3af81715470f8d656fe8b8e35475ed2b5fc766da)
* anv: fix enumeration of propertiesEmil Velikov2016-11-241-6/+8
| | | | | | | | | | | | | | | | | | | | Driver should enumerate only up-to min2(num_available, num_requested) properties and return VK_INCOMPLETE if the # of requested props is smaller than the ones available. Presently we assert out in such cases. Inspired by a similar fix for RADV. v2: Use MIN2 + typed_memcpy (Jason). Should fix: dEQP-VK.api.info.device.extensions Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> (v1) Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit 5cc07d854c85e30c5aa1ced626b4b6500f8cd74c)
* anv/fence: Handle ANV_FENCE_CREATE_SIGNALED_BITJason Ekstrand2016-11-241-1/+5
| | | | | | Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 1c97432ce88ea272ff7d906cd36f70e09dafcab9)
* anv: Handle null in all destructorsJason Ekstrand2016-11-241-0/+15
| | | | | | | | | | | | | | | | This fixes a bunch of new CTS tests which look for exactly this. Even in the cases where we just call vk_free to free a CPU data structure, we still handle NULL explicitly. This way we're less likely to forget to handle NULL later should we actually do something less trivial. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Dave Airlie <airlied@redhat.com> (cherry picked from commit 49f08ad77f51cc344e4bfe60ba9f8d9fccfbd753) [Emil Velikov: color_rt_surface_state is still around] Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Conflicts: src/intel/vulkan/anv_image.c
* anv: Rework fencesJason Ekstrand2016-11-231-24/+135
| | | | | | | | | | | | | | | | Our previous fence implementation was very simple. Fences had two states: signaled and unsignaled. However, this didn't properly handle all of the edge-cases that we need to handle. In order to handle the case where the client calls vkGetFenceStatus on a fence that has not yet been submitted via vkQueueSubmit, we need a three-status system. In order to handle the case where the client calls vkWaitForFences on fences which have not yet been submitted, we need more complex logic and a condition variable. It's rather annoying but, so long as the client doesn't do that, we should still hit the fast path and use i915_gem_wait to do all our waiting. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 843775bab78a6b4d5cb4f02bd95d9d0e95c1c5e3)
* anv: use correct .specVersion for extensionsEmil Velikov2016-11-101-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vulkan has introduced the consept of .specVersion which can be used to attribute changes of the said extension. The current loader does not check the value, thus it have gone unnoticed that the driver exposes an old version of the following extensions: VK_KHR_xcb_surface (Rev 6) VK_KHR_xlib_surface (Rev 6) VK_KHR_wayland_surface (Rev 5) - Updated the surface create function to take a pCreateInfo structure VK_KHR_swapchain (Rev 68) - Moved the "validity" include for vkAcquireNextImage to be in its proper place, after the prototype and list of parameters. ... According to the documentation: * pname:specVersion is the version of this extension. It is an integer, incremented with backward compatible changes. Based on the history of vk.xml the above (latest) revision has been available since Vulkan 1.0 so even if they were any backwards incompatible change(s) [as hinted by the revision log] those should be safe. Cc: "13.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (cherry picked from commit f373a91a5264bb93b31b5be9f9714da856383ed1)
* anv: Do relocations in userspace before execbuf ioctlKristian Høgsberg Kristensen2016-11-091-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since our surface state buffer is shared by all batches, the kernel does a full stall and sync with the CPU between batches every time we call execbuf2 because it refuses to do relocations on an active buffer. Doing them in userspace and passing the NO_RELOC flag to the kernel allows us to perform the relocations without stalling. This improves the performance of Dota 2 by around 30% on a Sky Lake GT2. v2 (Jason Ekstrand): - Better comments (Chris Wilson) - Fixed write_reloc for correct canonical form (Chris Wilson) v3 (Jason Ekstrand): - Skip relocations which aren't needed - Provide an environment variable to always use the kernel - More comments about correctness (Chris Wilson) v4 (Jason Ekstrand): - More comments (Chris Wilson) v5 (Jason Ekstrand): - Rebase on top of moving execbuf2 setup go QueueSubmit Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit b3a29f2e9eb528a16ceec0fd88aad9f0c3c3b6d4)
* anv: Move relocation handling from EndCommandBuffer to QueueSubmitJason Ekstrand2016-11-091-3/+27
| | | | | | | | | | | | | | | | | | | | Ever since the early days of the Vulkan driver, we've been setting up the lists of relocations at EndCommandBuffer time. The idea behind this was to move some of the CPU load out of QueueSubmit which the client is required to lock around and into command buffer building which could be done in parallel. Then QueueSubmit basically just becomes a bunch of execbuf2 calls. Technically, this works. However, when you start to do more in QueueSubmit than just execbuf2, you start to run into problems. In particular, if a block pool is resized between EndCommandBuffer and QueueSubmit, the list of anv_bo's and the execbuf2 object list can get out of sync. This can cause problems if, for instance, you wanted to do relocations in userspace. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 8b61c57049ff75766715ad4f7b1ad2d3657b9b4d)
* anv: Add a new bo_pool_init helperJason Ekstrand2016-11-091-7/+3
| | | | | | | | | This ensures that we're always setting all of the fields in anv_bo Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 6283b6d56a2bb731cfcb4c876566901075f9bd34)
* anv: Add a cmd_buffer_execbuf helperJason Ekstrand2016-11-091-2/+1
| | | | | | | | | | This puts the actual execbuf2 call in anv_batch_chain.c along with the other relocation stuff. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit db9f4b2a2bbf1aff3c6c878735495fc7accbb11e)
* anv/device: Add an execbuf wrapperJason Ekstrand2016-11-091-20/+31
| | | | | | | | | | This wrapper ensures that we always update all anv_bo::offset fields based on the offsets returned by the kernel. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit 07798c9c3ed29fd162ebc6b6d6beb8448218487f)
* anv: Better handle return codes from anv_physical_device_initJason Ekstrand2016-11-091-1/+1
| | | | | | | | | | | | | The case where we just want the loop to continue is INCOMPATIBLE_DRIVER because that simply means that whatever FD we opened isn't a supported Intel chip. Other error codes such as OUT_OF_HOST_MEMORY are actual errors and we should be returning early in that case. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Cc: "13.0" <mesa-stable@lists.freedesktop.org> (cherry picked from commit a5f8ff6ca18c38a7c4b5b37a4d5b14ca01e71b1e)
* anv/device: Return DEVICE_LOST if execbuf2 failsJason Ekstrand2016-11-091-6/+4
| | | | | | | | | | | | This makes more sense than OUT_OF_HOST_MEMORY. Technically, you can recover from a failed execbuf2 but the batch you just submitted didn't fully execute so things are in an ill-defined state. The app doesn't want to continue from that point anyway. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "13.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (cherry picked from commit c41ec1679f02d6705ceda49d9ad966d0d0833824)
* anv: move to using vk_alloc helpers.Dave Airlie2016-10-191-13/+13
| | | | | | | This moves all the alloc/free in anv to the generic helpers. Acked-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
* anv: Make entrypoint resolution take a gen_device_infoJason Ekstrand2016-10-141-5/+4
| | | | | | | | | | | | In order for things such as the ANV_CALL and the ifuncs to work, we used to have a singleton gen_device_info structure that got assigned the first time you create a device. Given that the driver will never be used simultaneously on two different generations of hardware, this was fairly safe to do. However, it has caused a few hickups and isn't, in general, a good plan. Now that the two primary reasons for this singleton are gone, we can get rid of it and make things quite a bit safer. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Get rid of the ANV_CALL macroJason Ekstrand2016-10-141-1/+1
| | | | | | | | This macro was needed by meta in order to make gen-specific calls from gen-agnostic code. Now that we don't have meta, the remaining two uses are fairly trivial to get rid of. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Get rid of metaJason Ekstrand2016-10-141-6/+0
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* anv: Return correct result in EnumeratePhysicalDevicesNicolas Koch2016-10-111-0/+2
| | | | | | | | | | If pPhysicalDevices is too small for all physical devices, the driver must return VK_INCOMPLETE. Since only a single physical device is supported, this is only the case when pPhysicalDeviceCount == 0 && pPhysicalDevices != NULL. Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: turn on samplerAnisotropy in VkPhysicalDeviceFeaturesLionel Landwerlin2016-10-101-1/+1
| | | | | | | | | | | | | | According to the Vulkan spec 5.63.4 : samplerAnisotropy indicates whether anisotropic filtering is supported. If this feature is not enabled, the maxAnisotropy member of the VkSamplerCreateInfo structure must be 1.0. Since we already set maxAnisotropy to 16 and program the hardware according to the VkSamplerCreateInfo.maxAnisotropy, it seems we can turn this on. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Move BindImageMemory to anv_image.cJason Ekstrand2016-10-071-20/+0
| | | | | | Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Chad Versace <chadversary@chromium.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: fix GetPhysicalDeviceProperties to return timestampPeriod in nsPhilipp Zabel2016-10-061-1/+1
| | | | | | | | | | According to chapters 16.5. (Timestamp Queries) and 30.2 (Limits) of the Vulkan Specification 1.0.29, the .limits.timestampPeriod field returned by vkGetPhysicalDeviceProperties is measured in nanoseconds, not in seconds. Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* anv: get rid of duplicated values from gen_device_infoLionel Landwerlin2016-09-231-15/+7
| | | | | Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* intel/i965: make gen_device_info mutableLionel Landwerlin2016-09-231-30/+29
| | | | | | | | | | | | Make gen_device_info a mutable structure so we can update the fields that can be refined by querying the kernel (like subslices and EU numbers). This patch does not make any functional change, it just makes gen_get_device_info() fill a structure rather than returning a const pointer. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* anv: device: calculate compute thread numbers using subslices numbersLionel Landwerlin2016-09-211-4/+39
| | | | | Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
* anv: Add initial blorp supportJason Ekstrand2016-09-131-0/+4
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
* intel: Rename brw_get_device_name/info to gen_get_device_name/infoJason Ekstrand2016-09-031-2/+2
| | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* intel: s/brw_device_info/gen_device_info/Jason Ekstrand2016-09-031-1/+1
| | | | | | | | | | | | | Generated by: sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.c sed -i -e 's/brw_device_info/gen_device_info/g' src/intel/**/*.h sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.c sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.cpp sed -i -e 's/brw_device_info/gen_device_info/g' **/i965/*.h Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
* anv: Rework pipeline cachingJason Ekstrand2016-08-301-1/+0
| | | | | | | | | | | | | | | | | | | The original pipeline cache the Kristian wrote was based on a now-false premise that the shaders can be stored in the pipeline cache. The Vulkan 1.0 spec explicitly states that the pipeline cache object is transiant and you are allowed to delete it after using it to create a pipeline with no ill effects. As nice as Kristian's design was, it doesn't jive with the expectation provided by the Vulkan spec. The new pipeline cache uses reference-counted anv_shader_bin objects that are backed by a large state pool. The cache itself is just a hash table mapping keys hashes to anv_shader_bin objects. This has the added advantage of removing one more hand-rolled hash table from mesa. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97476 Acked-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
* anv: Add a struct for storing a compiled shaderJason Ekstrand2016-08-301-0/+3
| | | | | | | | | | | | | | | | This new anv_shader_bin struct stores the compiled kernel (as an anv_state) as well as all of the metadata that is generated at shader compile time. The struct is very similar to the old cache_entry struct except that it is reference counted and stores the actual pipeline_bind_map. Similarly to cache_entry, much of the actual data is floating-size and stored after the main struct. Unlike cache_entry, which was storred in GPU-accessable memory, the storage for anv_shader_bin kernels comes from a state pool. The struct itself is reference-counted so that it can be used by multiple pipelines at a time without fear of allocation issues. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org> Acked-by: Kristian Høgsberg Kristensen <krh@bitplanet.net>
* anv: Throw INCOMPATIBLE_DRIVER for non-fatal initialization errorsJason Ekstrand2016-08-221-5/+3
| | | | | | | | | | | The only reason we should throw INITIALIZATION_FAILED is if we have found useable intel hardware but have failed to bring it up for some reason. Otherwise, we should just throw INCOMPATIBLE_DRIVER which will turn into successfully advertising 0 physical devices Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> Tested-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
* anv: remove dummy VK_DEBUG_MARKER_EXT entry pointsmil Velikov2016-08-181-20/+0
| | | | | | | | | | | | The vkCmdDbgMarker{Begin,End} symbols are exported, yet the json does no advertise that the driver supports the extension. Furthermore the functions are empty stubs. Remove those until we get a proper implementation and json notation. Cc: "12.0" <mesa-stable@lists.freedesktop.org> Cc: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* anv: automake: use VISIBILITY_CFLAGS to restrict symbol visibilityEmil Velikov2016-08-181-2/+4
| | | | | | | | | | | Hide the internal symbols and annotate the vk_icdGetInstanceProcAddr as public since the loader needs it (since v1 of the loader interface). v2: Add VISIBILITY_CFLAGS to AM_CFLAGS (Ken) Cc: "12.0" <mesa-stable@lists.freedesktop.org> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> (v1) Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* anv/x11: Add support for Xlib platformKevin Strasser2016-08-151-0/+6
| | | | | | | | | | | Some applications continue to use the Xlib client library and expect that VK_KHR_xlib_surface will be available in the driver. Service these applications by converting the Display pointer to xcb_connection_t and use the existing xcb code in the driver. Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
* anv/device: Add limits for InterpolationOffsetAnuj Phogat2016-08-121-3/+3
| | | | | | | | Fixes the vulkan cts regression in test dEQP-VK.api.info.device.properties Cc: Mark Janes <mark.a.janes@intel.com> Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv/device: Enable sample shading on gen7+Anuj Phogat2016-08-091-1/+1
| | | | | | | Passes all 30 min_sample_shading tests in vulkan cts. Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Enable per sample shading on gen8+Anuj Phogat2016-07-281-1/+1
| | | | | | | | | | | | | Vulkan CTS test results on gen9: ./deqp-vk --deqp-case=dEQP-VK.pipeline.multisample.min_sample_shading* Test run totals: Passed: 60/90 (66.7%) Failed: 0/90 (0.0%) Not supported: 30/90 (33.3%) Warnings: 0/90 (0.0%) Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Enable independentBlend on gen7Jason Ekstrand2016-07-151-1/+1
| | | | | | | | | We can totally do it, we were just only setting up one BLEND_STATE and, now that the code is unified with gen8, we should be handling it correctly. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv/device: Fix max buffer range limitsNanley Chery2016-07-151-2/+6
| | | | | | | | | | | | | | | | Set limits that are consistent with ISL's assertions in isl_genX(buffer_fill_state_s)() and Anvil's format-DescriptorType mapping in anv_isl_format_for_descriptor_type(). Fixes the following new crucible tests: * stress.limits.buffer-update.range.uniform * stress.limits.buffer-update.range.storage These tests are in this patch: https://patchwork.freedesktop.org/patch/98726/ Cc: 12.0 <mesa-stable@lists.freedesktop.org> Signed-off-by: Nanley Chery <nanley.g.chery@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: use cache uuid based on the build timestamp.Emil Velikov2016-07-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not rely on the git sha1: - its current truncated form makes it less unique - it does not attribute for local (Vulkand or otherwise) changes Use a timestamp produced at the time of build. It's perfectly unique, unless someone explicitly thinkers with their system clock. Even then chances of producing the exact same one are very small, if not zero. v2: Remove .tmp rule. Its not needed since we want for the header to be regenerated on each time we call make (Eric). v3: - Honour SOURCE_DATE_EPOCH, to make the build reproducible (Michel) - Replace the generated header with a define, to prevent needless builds on consecutive `make' and/or `make install' calls. (Dave) v4: - Keep the timestamp generation at make time. (Jason) v5: - Ensure that file is regenerated on incremental builds. Cc: Michel Dänzer <michel@daenzer.net> Cc: Dave Airlie <airlied@gmail.com> Cc: mesa-stable@lists.freedesktop.org Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
* anv: Use different BOs for different scratch sizes and stagesJason Ekstrand2016-06-221-2/+2
| | | | | | | | | This solves a race condition where we can end up having different stages stomp on each other because they're all trying to scratch in the same BO but they have different views of its layout. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Add proper support for depth clampingJason Ekstrand2016-06-201-1/+1
| | | | | | Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* anv: Remove the PhysicalDeviceLimits FINISHMEJason Ekstrand2016-06-101-2/+0
| | | | | | | | At this point, the limits are probably more-or-less correct. If there is an invalid limit, that's a bug not a FINSHME. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org>
* automake: move the git_sha1.h rule a level upEmil Velikov2016-05-301-1/+1
| | | | | | | | | | | | | | | This way we can reuse the header from other places like - src/intel/vulkan and src/gallium. Only the former is hooked up atm. Make sure .gitignore is updated, as well as all the users (the mesa code does not need any changes). Also ensure that the file is always created by adding it to the BUILT_SOURCES target. Cc: Jason Ekstrand <jason.ekstrand@intel.com> Cc: Kristian Høgsberg Kristensen <krh@bitplanet.net> Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
* anv: bail out if anv_wsi_init() failsEmil Velikov2016-05-301-1/+3
| | | | | | | | | | | | | | Otherwise we'll end up setting up a device with no winsys integration. Signed-off-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> --- Hard-coding the rendernode name in anv_physical_device_init() is a bad idea really. We could/should be using drmGetDevices() to get info on all the devices (master/render/etc. node names, pci location etc.) and apply our heuristics on top of that. That can come up as a follow up change.
* anv: Try the first 8 render nodes instead of just renderD128Jason Ekstrand2016-05-271-4/+10
| | | | | | | | This way, if you have other cards installed, the Vulkan driver will still work. No guarantees about WSI working correctly but offscreen should at least work. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95537