diff options
author | Jason Ekstrand <[email protected]> | 2018-01-24 19:47:14 -0800 |
---|---|---|
committer | Daniel Stone <[email protected]> | 2018-02-21 22:37:10 +0000 |
commit | adca1e4a92a53a403b7620c3356dcf038f0bcecc (patch) | |
tree | 58d26708fe61e40080bdca7526a78b3c8322dbf1 /src/intel/vulkan/anv_device.c | |
parent | f5433e4d6ce247b86daed741c07aa99f2bd02c0d (diff) |
anv/image: Separate modifiers from legacy scanout
For a bit there, we had a bug in i965 where it ignored the tiling of the
modifier and used the one from the BO instead. At one point, we though
this was best fixed by setting a tiling from Vulkan. However, we've
decided that i965 was just doing the wrong thing and have fixed it as of
50485723523d2948a44570ba110f02f726f86a54.
The old assumptions also affected the solution we used for legacy
scanout in Vulkan. Instead of treating it specially, we just treated it
like a modifier like we do in GL. This commit goes back to making it
it's own thing so that it's clear in the driver when we're using
modifiers and when we're using legacy paths.
v2 (Jason Ekstrand):
- Rename legacy_scanout to needs_set_tiling
Reviewed-by: Daniel Stone <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_device.c')
-rw-r--r-- | src/intel/vulkan/anv_device.c | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c index 00b0b653333..a83b7a39f6a 100644 --- a/src/intel/vulkan/anv_device.c +++ b/src/intel/vulkan/anv_device.c @@ -1835,21 +1835,10 @@ VkResult anv_AllocateMemory( if (dedicated_info && dedicated_info->image != VK_NULL_HANDLE) { ANV_FROM_HANDLE(anv_image, image, dedicated_info->image); - /* For images using modifiers, we require a dedicated allocation - * and we set the BO tiling to match the tiling of the underlying - * modifier. This is a bit unfortunate as this is completely - * pointless for Vulkan. However, GL needs to be able to map things - * so it needs the tiling to be set. The only way to do this in a - * non-racy way is to set the tiling in the creator of the BO so that - * makes it our job. - * - * One of these days, once the GL driver learns to not map things - * through the GTT in random places, we can drop this and start - * allowing multiple modified images in the same BO. + /* Some legacy (non-modifiers) consumers need the tiling to be set on + * the BO. In this case, we have a dedicated allocation. */ - if (image->drm_format_mod != DRM_FORMAT_MOD_INVALID) { - assert(isl_drm_modifier_get_info(image->drm_format_mod)->tiling == - image->planes[0].surface.isl.tiling); + if (image->needs_set_tiling) { const uint32_t i915_tiling = isl_tiling_to_i915_tiling(image->planes[0].surface.isl.tiling); int ret = anv_gem_set_tiling(device, mem->bo->gem_handle, @@ -2217,8 +2206,9 @@ void anv_GetImageMemoryRequirements2KHR( switch (ext->sType) { case VK_STRUCTURE_TYPE_MEMORY_DEDICATED_REQUIREMENTS_KHR: { VkMemoryDedicatedRequirementsKHR *requirements = (void *)ext; - if (image->drm_format_mod != DRM_FORMAT_MOD_INVALID) { - /* Require a dedicated allocation for images with modifiers. + if (image->needs_set_tiling) { + /* If we need to set the tiling for external consumers, we need a + * dedicated allocation. * * See also anv_AllocateMemory. */ |