aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_device.c
Commit message (Collapse)AuthorAgeFilesLines
* anv: fix maxDescriptorSet* limitsSamuel Iglesias Gonsálvez2018-01-111-5/+5
| | | | | | | | | | | | | | | "The maxDescriptorSet* limit is n times the corresponding maxPerStageDescriptor* limit, where n is the number of shader stages supported by the VkPhysicalDevice. If all shader stages are supported, n = 6 (vertex, tessellation control, tessellation evaluation, geometry, fragment, compute)." Fixes: dEQP-VK.api.info.device.properties Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/device: Mark all state buffers as needing captureJason Ekstrand2017-12-281-3/+3
| | | | | | | Previously, we were flagging the instruction state buffer for capture but not surface state or dynamic state. We want those captured too. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Remove unused variable.Bas Nieuwenhuizen2017-12-171-2/+0
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Enable UBO pushingJason Ekstrand2017-12-081-0/+1
| | | | | | | | | | | | | Push constants on Intel hardware are significantly more performant than pull constants. Since most Vulkan applications don't actively use push constants on Vulkan or at least don't use it heavily, we're pulling way more than we should be. By enabling pushing chunks of UBOs we can get rid of a lot of those pulls. On my SKL GT4e, this improves the performance of Dota 2 and Talos by around 2.5% and improves Aztec Ruins by around 2%. Reviewed-by: Jordan Justen <[email protected]>
* anv/device: Increase the UBO alignment requirement to 32Jason Ekstrand2017-12-081-2/+10
| | | | | | | | Push constants work in terms of 32-byte chunks so if we want to be able to push UBOs, every thing needs to be 32-byte aligned. Currently, we only require 16-byte which is too small. Reviewed-by: Jordan Justen <[email protected]>
* anv: Disable VK_KHR_16bit_storageJason Ekstrand2017-12-081-2/+2
| | | | | | | | | | | | The testing for this extension is currently very poor. The CTS tests only test accessing UBOs and SSBOs at dynamic offsets so none of our constant-offset paths get triggered at all. Also, there's an assertion in our handling of nir_intrinsic_load_uniform that offset % 4 == 0 which is never triggered indicating that nothing every gets loaded from an offset which is not a dword. Both push constants and the constant offset pull paths are complex enough, we really don't want to ship without tests. We'll turn the extension back on once we have decent tests.
* anv: fix a case statement in GetMemoryFdPropertiesKHRFredrik Höglund2017-12-061-1/+1
| | | | | | | | | The handle type in the case statement is supposed to be VK_EXTERNAL_- MEMORY_HANDLE_TYPE_DMA_BUF_BIT_EXT. Fixes: ab18e8e59b6 ("anv: Implement VK_EXT_external_memory_dma_buf") Signed-off-by: Fredrik Höglund <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Enable SPV_KHR_16bit_storage and VK_KHR_16bit_storage for SSBO/UBOAlejandro Piñeiro2017-12-061-0/+13
| | | | | | | | | | | | | | | | | | | | | | Enables SPV_KHR_16bit_storage on gen 8+. VK_KHR_16bit_storage is enabled for SSBO/UBO using the VK_KHR_get_physical_device_properties2 functionality to expose if the extension is supported or not. v2: update due rebase against master (Alejandro) v3: (Jason Ekstrand) - Move this patch up in VK_KHR_16bit_storage series enabling only storageBuffer16BitAccess and uniformAndStorageBuffer16BitAccess. - Only expose VK_KHR_16bit_storage on Gen8+ v4: (Jason Ekstrand) - Squash enable SPV_KHR_16bit_storage into VK_KHR_16bit_storage enablement for SSBO/UBO. Signed-off-by: Jose Maria Casanova Crespo <[email protected]> Signed-off-by: Alejandro Piñeiro <[email protected]> Signed-off-by: Eduardo Lima Mitev <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Add support for the variablePointers featureJason Ekstrand2017-12-051-1/+1
| | | | | | | | Not to be confused with variablePointersStorageBuffer which is the subset of VK_KHR_variable_pointers required to enable the extension. This means we now have "full" support for variable pointers. Reviewed-by: Kristian H. Kristensen <[email protected]>
* anv: query CS timestamp frequency from the kernelLionel Landwerlin2017-12-041-0/+13
| | | | | | | | | The reference value in gen_device_info isn't going to be acurate on Gen10+. We should query it from the kernel, which reads a couple of register to compute the actual value. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Rafael Antognolli <[email protected]>
* anv/image: Implement the wsi "extension"Jason Ekstrand2017-12-041-1/+10
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* anv: Require a dedicated allocation for modified imagesJason Ekstrand2017-12-041-4/+49
| | | | | | | | This lets us set the BO tiling when we allocate the memory. This is required for GL to work properly. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* anv: Implement VK_EXT_external_memory_dma_bufJason Ekstrand2017-12-041-15/+27
| | | | | | | | | This is a modified version of the patch originally sent by Chad Versace. The primary difference is that this version claims that OPQAUE_FD and DMA_BUF are compatible handle types. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* anv: flag batch & instruction BOs for captureLionel Landwerlin2017-11-221-2/+5
| | | | | | | | | | | | | When the kernel support flagging our BO, let's mark batch & instruction BOs for capture so then can be included in the error state. v2: Only add EXEC_CAPTURE if supported (Kristian) v3: Fix operator precedence issue (Lionel) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv: setup BO flags at state_pool/block_pool creationLionel Landwerlin2017-11-221-4/+14
| | | | | | | | This will allow to set the flags on any anv_bo created/filled from a state pool or block pool later. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv: Don't crash on invalid heap sizes when the PCI ID is overridenJason Ekstrand2017-11-131-0/+12
|
* anv: don't assert on device init on CannonlakeLionel Landwerlin2017-10-211-2/+4
| | | | | | | v2: Warn that support is still in alpha (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Fix instance typos.Vinson Lee2017-10-181-1/+1
| | | | | | | | | | | | | | | | | | Fix build error. CC vulkan/vulkan_libvulkan_common_la-anv_device.lo In file included from vulkan/anv_device.c:33:0: vulkan/anv_device.c: In function ‘anv_AllocateMemory’: vulkan/anv_device.c:1562:37: error: ‘struct anv_device’ has no member named ‘instace’; did you mean ‘instance’? result = vk_errorf(device->instace, device, ^ vulkan/anv_private.h:317:17: note: in definition of macro ‘vk_errorf’ __vk_errorf(instance, obj, REPORT_OBJECT_TYPE(obj), error,\ ^~~~~~~~ Fixes: 9775894f1025 ("anv: Move size check from anv_bo_cache_import() to caller (v2)") Signed-off-by: Vinson Lee <[email protected]> Reviewed-by: Eric Engestrom <[email protected]>
* anv: Move size check from anv_bo_cache_import() to caller (v2)Chad Versace2017-10-171-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change prepares for VK_ANDROID_native_buffer. When the user imports a gralloc hande into a VkImage using VK_ANDROID_native_buffer, the user provides no size. The driver must infer the size from the internals of the gralloc buffer. The patch is essentially a refactor patch, but it does change behavior in some edge cases, described below. In what follows, the "nominal size" of the bo refers to anv_bo::size, which may not match the bo's "actual size" according to the kernel. Post-patch, the nominal size of the bo returned from anv_bo_cache_import() is always the size of imported dma-buf according to lseek(). Pre-patch, the bo's nominal size was difficult to predict. If the imported dma-buf's gem handle was not resident in the cache, then the bo's nominal size was align(VkMemoryAllocateInfo::allocationSize, 4096). If it *was* resident, then the bo's nominal size was whatever the cache returned. As a consequence, the first cache insert decided the bo's nominal size, which could be significantly smaller compared to the dma-buf's actual size, as the nominal size was determined by VkMemoryAllocationInfo::allocationSize and not lseek(). I believe this patch cleans up that messy behavior. For an imported or exported VkDeviceMemory, anv_bo::size should now be the true size of the bo, if I correctly understand the problem (which I possibly don't). v2: - Preserve behavior of aligning size to 4096 before checking. [for jekstrand] - Check size with < instead of <=, to match behavior of commit c0a4f56 "anv: bo_cache: allow importing a BO larger than needed". [for chadv]
* anv: Move close(fd) from anv_bo_cache_import to its callers (v2)Chad Versace2017-10-171-0/+11
| | | | | | | | | | | | | This will allow us to implement VK_ANDROID_native_buffer without dup'ing the fd. We must close the fd in VK_KHR_external_memory_fd, but we should not in VK_ANDROID_native_buffer. v2: - Add missing close(fd) for case VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_OPAQUE_FD_BIT_KHR, subcase ANV_SEMAPHORE_TYPE_BO. Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Better support for Android logging (v2)Chad Versace2017-10-171-6/+5
| | | | | | | | | | | | | | | In src/intel/vulkan/*, redirect all instances of printf, vk_error, anv_loge, anv_debug, anv_finishme, anv_perf_warn, anv_assert, and their many variants to the new intel_log functions. I believe I caught them all. The other subdirs of src/intel are left for a future exercise. v2: - Rebase onto Tapani's VK_EXT_debug_report changes. - Drop unused #include <cutils/log.h>. Reviewed-by: Jason Ekstrand <[email protected]>
* intel/compiler: Add a flag for pull constant supportJason Ekstrand2017-10-121-0/+1
| | | | | | | | | | | The Vulkan driver does not support pull constants. It simply limits things such that we can always push everything. Previously, we were determining whether or not to push things based on whether or not the prog_data::pull_param array is non-null. This is rather hackish and about to stop working. Reviewed-by: Jordan Justen <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]>
* anv: enable VK_KHR_sampler_ycbcr_conversionLionel Landwerlin2017-10-061-0/+45
| | | | | | | | | | | | v2: Make GetImageMemoryRequirements2KHR() iterate over all pInfo structs (Lionel) Handle VkSamplerYcbcrConversionImageFormatPropertiesKHR (Andrew/Jason) Iterator over BindImageMemory2KHR's pNext structs correctly (Jason) v3: Revert GetImageMemoryRequirements2KHR() change from v2 (Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Advertise point clipping propertiesSamuel Iglesias Gonsálvez2017-09-201-0/+8
| | | | | Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Implement VK_KHR_bind_memory2Jason Ekstrand2017-09-181-8/+33
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* util: Query build-id by symbol address, not library nameChad Versace2017-09-131-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch renames build_id_find_nhdr() to build_id_find_nhdr_for_addr(), and changes it to never examine the library name. Tested on Fedora by confirming that build_id_get_data() returns the same build-id as the file(1) tool. For BSD, I confirmed that the API used (dladdr() and struct Dl_info) is documented in FreeBSD's manpages. This solves two problems: - We can now the query the build-id without knowing the installed library's filename. This matters because Android requires specific filenames for HAL modules, such as "/vendor/lib/hw/vulkan.${board}.so". The HAL filenames do not follow the Unix convention of "libfoo.so". In other words, the same query code will now work on Linux and Android. - Querying the build-id now works correctly when the process contains multiple shared objects with the same basename. (Admittedly, this is a highly unlikely scenario). Cc: Jonathan Gray <[email protected]> Reviewed-by: Matt Turner <[email protected]> Reviewed-by: Emil Velikov <[email protected]>
* anv: move brw_process_intel_debug_variable to happen earlyTapani Pälli2017-09-121-2/+2
| | | | | | | | | Currently anv_perf_warn call in anv_compute_heap_size does not ever report a perf warning. Move debug variable read as the first thing in case there will be other perf_warn calls added. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: wire up vk_errorf macro to do debug reportingTapani Pälli2017-09-121-14/+24
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: wire up anv_perf_warn macro to do debug reportingTapani Pälli2017-09-121-1/+2
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: implementation of VK_EXT_debug_report extensionTapani Pälli2017-09-121-0/+34
| | | | | | | | | | | | | | | | | | | Patch adds required functionality for extension to manage a list of application provided callbacks and handle debug reporting from driver and application side. v2: remove useless helper anv_debug_report_call add locking around callbacks list use vk_alloc2, vk_free2 refactor CreateDebugReportCallbackEXT fix bugs found with crucible testing v3: provide ANV_FROM_HANDLE and use it misc fixes for issues Jason found use vk_find_struct_const for finding ctor_cb Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Use DRM sync objects to back fences whenever possibleJason Ekstrand2017-08-281-0/+2
| | | | | | | | | In order to implement VK_KHR_external_fence, we need to back our fences with something that's shareable. Since the kernel wait interface for sync objects already supports waiting for multiple fences in one go, it makes anv_WaitForFences much simpler if we only have one type of fence. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Use DRM sync objects for external semaphores when availableJason Ekstrand2017-08-151-0/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Implement support for exporting semaphores as FENCE_FDJason Ekstrand2017-08-151-0/+1
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Submit a dummy batch when only semaphores are provided.Jason Ekstrand2017-08-151-0/+30
| | | | | | | | Vulkan allows you to do a submit whose only job is to wait on and trigger semaphores. The easiest way for us to support that right now is to insert a dummy execbuf. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Pull the API version from anv_extensions.pyJason Ekstrand2017-08-021-1/+1
| | | | | | | This way everything stays in sync and we only have the one version number. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Autogenerate extension query and lookupJason Ekstrand2017-08-011-153/+4
| | | | | | | | | | | | | | | | | | | | | | | As time goes on, extension advertising is going to get more complex. Today, we either implement an extension or we don't. However, in the future, whether or not we advertise an extension will depend on kernel or hardware features. This commit introduces a python codegen framework that generates the anv_EnumerateFooExtensionProperties functions as well as a pair of anv_foo_extension_supported functions for querying for the support of a given extension string. Each extension has an "enable" predicate that is any valid C expression. For device extensions, the physical device is available as "device" so the expression could be something such as "device->has_kernel_feature". For instance extensions, the only option is VK_USE_PLATFORM defines. This mechanism also means that we have a single one-line-per-entry table for all extension declarations instead of the two tables we had in anv_device.c and the one we had in anv_entrypoints_gen.py. The Python code is smart and uses the XML to determine whether an extension is an instance extension or device extension. Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Advertise support for VK_KHR_variable_pointersJason Ekstrand2017-07-181-0/+11
| | | | | | | | We don't support the general version yet because that requires us to lower shared variables up-front in SPIR-V -> NIR. This shouldn't be a whole lot of work but it's not something we support today. Reviewed-by: Iago Toral Quiroga <[email protected]>
* anv: Advertise support for VK_KHR_storage_buffer_storage_classJason Ekstrand2017-07-181-0/+4
| | | | Reviewed-by: Iago Toral Quiroga <[email protected]>
* anv: advertise v6 of the wayland surface extensionEmil Velikov2017-07-171-1/+1
| | | | | | | | | | | Jason updated the Khronos spec to explicitly state that Wayland surfaces must support VK_PRESENT_MODE_MAILBOX_KHR. ANV did so since day one (back in 2015) Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: ensure device name contains terminating characterLionel Landwerlin2017-07-171-2/+2
| | | | | | | | | | v2: Use sizeof() (Chris) CID: 1415113 Reported-by: Grazvydas Ignotas <[email protected]> Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* anv: Implement VK_KHR_external_memory_*Jason Ekstrand2017-07-151-5/+81
| | | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Implement VK_KHR_dedicated_allocationJason Ekstrand2017-07-151-0/+18
| | | | | | | | We always recommend sub-allocation and don't do anything special for dedicated allocations. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Implement VK_KHR_get_memory_requirements2Jason Ekstrand2017-07-151-0/+47
| | | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Advertise version 1.0.54Jason Ekstrand2017-07-151-1/+1
| | | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Drop support for VK_KHX_external_semaphore_*Jason Ekstrand2017-07-151-12/+0
| | | | | | | | These have been formally deprecated by Khronos never to be shipped again. The KHR versions should be implemented/used instead. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Drop support for VK_KHX_external_memory_*Jason Ekstrand2017-07-141-79/+5
| | | | | | | | These have been formally deprecated by Khronos never to be shipped again. The KHR versions should be implemented/used instead. Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: don't use strcpy for copying stringsLionel Landwerlin2017-07-131-1/+2
| | | | | | CID: 1358935 Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Anuj Phogat <[email protected]>
* intel: Move clflush helpers from anv to common/gen_clflush.h.Kenneth Graunke2017-07-101-1/+1
| | | | | | | | | I want to use these in the OpenGL driver as well. v2: Add to COMMON_FILES in Makefile.sources (caught by Emil) Reviewed-by: Daniel Vetter <[email protected]> Reviewed-by: Matt Turner <[email protected]>
* anv: check support for enabled features in vkCreateDevice()Samuel Iglesias Gonsálvez2017-07-031-0/+13
| | | | | | | | | | | From Vulkan spec, 4.2.1. "Device Creation": "vkCreateDevice verifies that extensions and features requested in the ppEnabledExtensionNames and pEnabledFeatures members of pCreateInfo, respectively, are supported by the implementation." Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: fix reported timestampPeriod valueLionel Landwerlin2017-07-021-1/+1
| | | | | | | | | | | We lost some precision on a previous change due to switching to integers. Since we report a float in timestampPeriod, we want the division to happen in floats. CID: 1413021 Fixes: c77d98ef32 ("intel: common: express timestamps units in frequency") Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>