summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_intel.c
Commit message (Collapse)AuthorAgeFilesLines
* anv: drop unneeded KHR suffixEric Engestrom2019-01-081-1/+1
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* anv: Use separate MOCS settings for external BOsJason Ekstrand2018-10-031-1/+1
| | | | | | | | | | | | | | | | | | | On Broadwell and above, we have to use different MOCS settings to allow the kernel to take over and disable caching when needed for external buffers. On Broadwell, this is especially important because the kernel can't disable eLLC so we have to do it in userspace. We very badly don't want to do that on everything so we need separate MOCS for external and internal BOs. In order to do this, we add an anv-specific BO flag for "external" and use that to distinguish between buffers which may be shared with other processes and/or display and those which are entirely internal. That, together with an anv_mocs_for_bo helper lets us choose the right MOCS settings for each BO use. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99507 Cc: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: intel: add softpin flag on imported BOsLionel Landwerlin2018-06-051-0/+2
| | | | | | | | | Looks like we forgot to update this bit of the driver for softpin. Fixes: 4affeba1e9eb42 ("anv: Soft-pin everything else") Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/allocator: Set the BO flags in bo_cache_alloc/importJason Ekstrand2018-06-011-4/+5
| | | | | | | It's safer to set them there because we have the opportunity to properly handle combining flags if a BO is imported more than once. Reviewed-by: Scott D Phillips <[email protected]>
* anv: Use an address for each anv_image planeJason Ekstrand2018-05-311-2/+4
| | | | | | This is better than having BO and offset fields. Reviewed-by: Scott D Phillips <[email protected]>
* anv: Fix close(fd) before import issue in vkCreateDmaBufImageINTELKevin Strasser2018-04-031-2/+2
| | | | | | | | | If we close the fd before calling DRM_IOCTL_PRIME_FD_TO_HANDLE the kernel will hit a -EBADF error. Move the close(fd) call to the end of anv_CreateDmaBufImageINTEL(). Signed-off-by: Kevin Strasser <[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-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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/+2
| | | | | | | | | | | | | 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: intel: use anv_image's computed size for importing a BOLionel Landwerlin2017-10-111-11/+15
| | | | | | | | Rather than relying on size = stride * height, we can rely on anv_image's total size. Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Daniel Stone <[email protected]>
* anv: enable multiple planes per image/imageViewLionel Landwerlin2017-10-061-2/+2
| | | | | | | | | | | | | | | | | | | | | This change introduce the concept of planes for image & views. It matches the planes available in new formats. We also refactor depth & stencil support through the usage of planes for the sake of uniformity. In the backend (genX_cmd_buffer.c) we have to take some care though with regard to auxilliary surfaces. Multiplanar color buffers can have multiple auxilliary surfaces but depth & stencil share the same HiZ one (only store in the depth plane). v2: by Jason Remove unused aspect parameters from anv_blorp.c Assert when attempting to resolve YUV images Drop redundant logic for plane offset in make_surface() Rework anv_foreach_plane_aspect_bit() Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Use the BO cache for DeviceMemory allocationsJason Ekstrand2017-04-271-9/+6
| | | | Reviewed-by: Chad Versace <[email protected]>
* anv: Add support for 48-bit addressesJason Ekstrand2017-04-041-0/+3
| | | | | | | | | | | | | | | | | | This commit adds support for using the full 48-bit address space on Broadwell and newer hardware. Thanks to certain limitations, not all objects can be placed above the 32-bit boundary. In particular, general and state base address need to live within 32 bits. (See also Wa32bitGeneralStateOffset and Wa32bitInstructionBaseOffset.) In order to handle this, we add a supports_48bit_address field to anv_bo and only set EXEC_OBJECT_SUPPORTS_48B_ADDRESS if that bit is set. We set the bit for all client-allocated memory objects but leave it false for driver-allocated objects. While this is more conservative than needed, all driver allocations should easily fit in the first 32 bits of address space and keeps things simple because we don't have to think about whether or not any given one of our allocation data structures will be used in a 48-bit-unsafe way. Reviewed-by: Kristian H. Kristensen <[email protected]>
* anv: Fix unintentional integer overflow in anv_CreateDmaBufImageINTELGwan-gyeong Mun2016-11-221-1/+1
| | | | | | | | | | | | | | | Since both pCreateInfo->strideInBytes and pCreateInfo->extent.height are of uint32_t type 32-bit arithmetic will be used. Fix unintentional integer overflow by casting to uint64_t before multifying. CID 1394321 Cc: "13.0" <[email protected]> Signed-off-by: Mun Gwan-gyeong <[email protected]> [Emil Velikov: cast only of the arguments] Reviewed-by: Emil Velikov <[email protected]>
* anv: Add a new bo_pool_init helperJason Ekstrand2016-11-091-6/+5
| | | | | | | | This ensures that we're always setting all of the fields in anv_bo Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Cc: "13.0" <[email protected]>
* anv: move to using vk_alloc helpers.Dave Airlie2016-10-191-2/+2
| | | | | | | This moves all the alloc/free in anv to the generic helpers. Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* Move the intel vulkan driver to src/intel/vulkanJason Ekstrand2016-02-181-0/+100