aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_formats.c
Commit message (Collapse)AuthorAgeFilesLines
* anv: Drop unneeded struct keywordsJason Ekstrand2020-01-031-2/+2
| | | | | | | | | All VkFoo structs are typedef'd to not need the struct keyword. Leaving it in there is just extra characters and breaks Vulkan's aliasing when stuff gets promoted to core versions. It's better to just never use struct for VkFoo. Reviewed-by: Caio Marcelo de Oliveira Filho <[email protected]>
* anv/formats: Disable I915_FORMAT_MOD_Y_TILED_CCS on TGL+Nanley Chery2019-10-281-0/+5
| | | | | | | The format of the CCS has changed. Reviewed-by: Kenneth Graunke <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
* anv: Don't claim support for 24 and 48-bit formats on IVBJason Ekstrand2019-07-291-0/+8
| | | | Cc: [email protected]
* anv: report HOST_ALLOCATION as supported for imagesArcady Goldmints-Orlov2019-07-251-0/+4
| | | | | | | | | | Report VK_EXTERNAL_MEMORY_HANDLE_TYPE_HOST_ALLOCATION_BIT_EXT as supported for images. It was being shown supported for buffers, but not images. Fixes: 69cc6272fbc1 ("anv: Implement VK_EXT_external_memory_host") Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: fix format mapping for depth/stencil formatsLionel Landwerlin2019-07-181-0/+3
| | | | | | | | | | | | anv_format is supposed to have a pointer back to the associated VkFormat, we were missed this for depth/stencil formats. This doesn't fix anything afaict, but will be needed for future changes. Signed-off-by: Lionel Landwerlin <[email protected]> Fixes: 465de47bad70 ("anv: associate vulkan formats with aspects") Acked-by: Jason Ekstrand <[email protected]>
* anv: fix VkExternalBufferProperties for host allocationChia-I Wu2019-07-071-0/+10
| | | | | | | | | It was reported as unsupported previously. It should be importable and is compatible with itself. Signed-off-by: Chia-I Wu <[email protected]> Fixes: 69cc6272fbc199 ("anv: Implement VK_EXT_external_memory_host") Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: fix VkExternalBufferProperties for unsupported handlesChia-I Wu2019-07-071-1/+7
| | | | | | | | compatibleHandleTypes must include the queried handle type. Signed-off-by: Chia-I Wu <[email protected]> Cc: <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv:Use VK_EXT_separate_stencil_usage to avoid stencil shadows on gen7Jason Ekstrand2019-06-171-0/+3
| | | | | | | | | | Whenever stencil texturing is not required (most of the time), we can use VK_EXT_separate_stencil_usage to only create the shadow image when VK_IMAGE_USAGE_SAMPLED_BIT is required for stencil. Of course, this depends on applications to use the extension but hopefully DXVK and similar translators are doing so and that covers most of the apps. Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Add stencil texturing support for gen7Jason Ekstrand2019-06-171-3/+1
| | | | | | | | | | | | Intel hardware didn't get support for sampling from W-tiled (required for stencil) images until Broadwell so we can't directly sample from stencil. Instead, if we want to support stencil texturing on gen7 hardware, we have to keep a texture-capable shadow copy around and use BLORP to update when stencil changes. The one thing this commit does not implement is self-dependencies with stencil input attachments. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99493 Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/formats: Re-arrange the way se set some flag bitsJason Ekstrand2019-06-171-6/+5
| | | | Reviewed-by: Lionel Landwerlin <[email protected]>
* drm-uapi: use local files, not system libdrmEric Engestrom2019-02-141-1/+1
| | | | | | | | | There was an issue recently caused by the system header being included by mistake, so let's just get rid of this include path and always explicitly #include "drm-uapi/FOO.h" Signed-off-by: Eric Engestrom <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
* anv: do not advertise AHW support if extension not enabledTapani Pälli2019-01-171-6/+15
| | | | | | | | | | | | | | | | Fixes following failing vk-gl-cts cases on Linux desktop: dEQP-VK.api.external.memory.android_hardware_buffer.suballocated.buffer.info dEQP-VK.api.external.memory.android_hardware_buffer.suballocated.image.info dEQP-VK.api.external.memory.android_hardware_buffer.dedicated.image.info dEQP-VK.api.external.memory.android_hardware_buffer.dedicated.buffer.info Fixes: 517103abf1c "anv/android: add ahardwarebuffer external memory properties" Reported-by: Juan A. Suarez <[email protected]> Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Juan A. Suarez <[email protected]>
* anv: drop unneeded KHR suffixEric Engestrom2019-01-081-4/+4
| | | | | Signed-off-by: Eric Engestrom <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* anv: add VkFormat field as part of anv_formatTapani Pälli2018-12-191-0/+4
| | | | | Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: support VkExternalFormatANDROID in vkCreateSamplerYcbcrConversionTapani Pälli2018-12-191-4/+26
| | | | | | | | | | | | If external format is used, we store the external format identifier in conversion to be used later when creating VkImageView. v2: rebase to b43f955037c changes v3: added assert, ignore components when creating external format conversion (Lionel) Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv/android: add ahardwarebuffer external memory propertiesTapani Pälli2018-12-191-0/+41
| | | | | | | | | | | | | v2: have separate memory properties for android, set usage flags for buffers correctly v3: code cleanup (Jason) + limit maxArrayLayers to 1 for AHardwareBuffer based images v4: rebase to b43f955037c changes Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: make anv_get_image_format_features publicTapani Pälli2018-12-191-11/+11
| | | | | | | This will be utilized later by GetAndroidHardwareBufferPropertiesANDROID. Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: associate vulkan formats with aspectsLionel Landwerlin2018-11-131-41/+66
| | | | | | | | This will make it easier to associate an aspect with a plane number. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Don't advertise ASTC support on BSWJason Ekstrand2018-10-151-0/+8
| | | | | Tested-by: Mark Janes <[email protected]> Reviewed-by: Nanley Chery <[email protected]>
* anv: add VK_EXT_sampler_filter_minmax supportYunchao He2018-08-221-0/+6
| | | | | | | | | | | | | | | | | | This extension can be supported on SKL+. With this patch, all corresponding tests (6K+) in CTS can pass. No test fails. I verified CTS with the command below: deqp-vk --deqp-case=dEQP-VK.pipeline.sampler.view_type.*reduce* v2: 1) support all depth formats, not depth-only formats, 2) fix a wrong indention (Jason). v3: fix a few nits (Lionel). v4: fix failures in CI: disable sampler reduction when sampler reduction mode is not specified via this extension (Lionel). Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: avoid warning when switching in VkStructureTypeCaio Marcelo de Oliveira Filho2018-07-181-1/+2
| | | | | | | | | | | | | | When one of the cases is not part of the enum, the compilar complains: ../../src/intel/vulkan/anv_formats.c: In function ‘anv_GetPhysicalDeviceFormatProperties2’: ../../src/intel/vulkan/anv_formats.c:728:7: warning: case value ‘1000001004’ not in enumerated type ‘VkStructureType’ {aka ‘enum VkStructureType’} [-Wswitch] case VK_STRUCTURE_TYPE_WSI_FORMAT_MODIFIER_PROPERTIES_LIST_MESA: ^~~~ Given the switch has an "default:" case, we don't lose anything by switching on the unsigned value to avoid the warning. Reviewed-by: Anuj Phogat <[email protected]>
* anv: Allow blitting to/from any supported formatJason Ekstrand2018-05-091-5/+5
| | | | | | | | Now that blorp handles all the cases, why not? The only real change we have to make is to stop using anv_swizzle_for_render() in blorp_blit because it doesn't work for B4G4R4A4 and blorp now natively handles that. Reviewed-by: Topi Pohjolainen <[email protected]>
* anv: Add WSI support for the I915_FORMAT_MOD_Y_TILED_CCSJason Ekstrand2018-04-051-0/+9
| | | | | | | | | | | | | v2 (Jason Ekstrand): - Return the correct enum values from anv_layout_to_fast_clear_type v3 (Jason Ekstrand): - Always return ANV_FAST_CLEAR_NONE and leave doing the right thing for the patch which adds a modifier which supports fast-clears. Reviewed-by: Daniel Stone <[email protected]> Tested-by: Daniel Stone <[email protected]> Acked-by: Nanley Chery <[email protected]>
* util: Move util_is_power_of_two to bitscan.h and rename to ↵Ian Romanick2018-03-291-2/+2
| | | | | | | | | | | util_is_power_of_two_or_zero The new name make the zero-input behavior more obvious. The next patch adds a new function with different zero-input behavior. Signed-off-by: Ian Romanick <[email protected]> Suggested-by: Matt Turner <[email protected]> Reviewed-by: Alejandro Piñeiro <[email protected]>
* Get rid of a bunch of KHR suffixesJason Ekstrand2018-03-071-81/+81
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* anv: Add version 1.1.0 but leave it disabledJason Ekstrand2018-03-071-6/+6
| | | | | | | | This requires us to rename any Vulkan API entrypoints which became core in 1.1 to no longer have the KHR suffix. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* anv: set maxResourceSize to the respective value for each generationSamuel Iglesias Gonsálvez2018-02-281-1/+14
| | | | | | | | v2: - Add the proper values to gen9+ (Jason) Signed-off-by: Samuel Iglesias Gonsálvez <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/image: Add support for modifiers for WSIJason Ekstrand2018-02-211-0/+38
| | | | | | This adds support for the modifiers portion of the WSI "extension". Reviewed-by: Daniel Stone <[email protected]>
* anv: Implement VK_EXT_external_memory_dma_bufJason Ekstrand2017-12-041-2/+6
| | | | | | | | | 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: Refactor anv_get_format_plane() - explicit unsupportedChad Versace2017-11-091-4/+4
| | | | | | | | | | | | The same local variable, 'plane_format', was returned on success *and* failure. Be more explicit in distinguishing the two cases: return 'plane_format' on success and return 'unsupported' on failure. This simplifies the diff in upcoming patches for VK_EXT_image_drm_format_modifier. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Remove anv_physical_device_get_format_properties()Chad Versace2017-11-091-23/+13
| | | | | | | | Fold its body into its sole caller, anv_GetPhysicalDeviceFormatProperties(). Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Simplify anv_physical_device_get_format_properties()Chad Versace2017-11-091-16/+9
| | | | | | | | | Now that get_image_format_properties() returns the correct VkFormatFeatureFlags, we can remove the unneeded if-branch and some local variables. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Simplify anv_get_image_format_properties()Chad Versace2017-11-091-14/+3
| | | | | | | | | Now that get_image_format_features() has a VkImageTiling parameter, we can bypass anv_physical_device_get_format_properties() and call get_image_format_features() directly. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Rename get_image_format_properties()Chad Versace2017-11-091-12/+12
| | | | | | | | | | | | | The name is misleading. It looks like vkGetPhysicalDeviceImageFormatProperties(), but it actually implement vkGetPhysicalDeviceFormatProperties. Let's rename it to what it actually does, get_image_format_features(), because it returns VkFormatFeatureFlags. For consistency, also rename get_buffer_format_properties() to get_buffer_format_features(). Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Fix get_image_format_properties() - YCbCrChad Versace2017-11-091-46/+40
| | | | | | | | | | | | Teach it to calculate the format features for YCbCr. The goal (which is completed in this patch) is to incrementally fix get_image_format_properties() to return a correct result. Previously, it returned incorrect VkFormatFeatureFlags which the caller needed clean up. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Fix get_image_format_properties() - 3-channel formatsChad Versace2017-11-091-19/+15
| | | | | | | | | | | Teach it to calculate the format features for 3-channel formats. The goal is to incrementally fix get_image_format_properties() to return a correct result. Currently, it returns incorrect VkFormatFeatureFlags which the caller must clean up. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Refactor get_image_format_properties() - Reduce paramsChad Versace2017-11-091-11/+21
| | | | | | | | | | | | Replace parameters 'enum isl_format' and 'struct anv_format_plane' with new parameter 'const struct anv_format *'. The goal is to incrementally fix get_image_format_properties() to return a correct result. Currently, it returns incorrect VkFormatFeatureFlags which the caller must clean up. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Refactor get_image_format_properties() - base_isl_formatChad Versace2017-11-091-3/+4
| | | | | | | Rename parameter 'base' to 'base_isl_format'. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Refactor get_image_format_properties() - plane_formatChad Versace2017-11-091-8/+8
| | | | | | | Rename parameter 'format' to 'plane_format'. Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Refactor get_image_format_properties() - ASTCChad Versace2017-11-091-4/+5
| | | | | | | | | | | | | Teach it to calculate the format features for ASTC. The goal is to incrementally fix get_image_format_properties() to return a correct result. Currently, it returns incorrect VkFormatFeatureFlags which the caller must clean up. v2: New commit message Reviewed-by: Jason Ekstrand <[email protected]> (v1) Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Refactor get_image_format_properties() - depthstencil (v2)Chad Versace2017-11-091-16/+31
| | | | | | | | | | | | | Teach it to calculate the features of depthstencil formats. The goal is to incrementally fix get_image_format_properties() to return a correct result. Currently, it returns incorrect VkFormatFeatureFlags which the caller must clean up. v2: New commit message Reviewed-by: Jason Ekstrand <[email protected]> (v1) Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Better types for 'aspect' function paramsChad Versace2017-11-091-1/+1
| | | | | | | | | Some functions have a comment that says "Exactly one bit must be in 'aspect'". So change the type of their 'aspect' parameter from VkImageAspectFlags to VkImageAspectFlagBits. Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Refactor get_buffer_format_properties()Chad Versace2017-11-091-15/+29
| | | | | | | | | | | Make it a stand-alone function. Pre-patch, for some formats the function returned incorrect VkFormatFeatureFlags which were cleaned up by the caller. This prepares for a cleaner implementation of VK_EXT_image_drm_format_modifier. Reviewed-by: Jason Ekstrand <[email protected]>
* anv: Suffix anv-private 'VK' tokens with 'ANV'Chad Versace2017-11-071-1/+1
| | | | | | | | | | | | | | | | | I saw VK_IMAGE_ASPECT_ANY_COLOR_BIT while hacking anv_formats.c and got confused. "Huh? What extension added that?". No extension defines it; anv_private.h defines it. To remove confusion, rename the anv-private VK tokens as if they were extension tokens with the ANV vendor suffix. I found only two such tokens: VK_IMAGE_ASPECT_ANY_COLOR_BIT VK_IMAGE_ASPECT_PLANES_BITS Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: Remove unused variable 'gen'Chad Versace2017-11-071-4/+0
| | | | | | | In anv_physical_device_get_format_properties(). Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]>
* anv: enable VK_KHR_sampler_ycbcr_conversionLionel Landwerlin2017-10-061-7/+76
| | | | | | | | | | | | 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: enable multiple planes per image/imageViewLionel Landwerlin2017-10-061-2/+1
| | | | | | | | | | | | | | | | | | | | | 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: add new formats KHR_sampler_ycbcr_conversionLionel Landwerlin2017-10-061-6/+152
| | | | | | | Adding new downsampling factors for each planes. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: modify the internal concept of format to express multiple planesLionel Landwerlin2017-10-061-240/+272
| | | | | | | | | | | | | | | A given Vulkan format can now be decomposed into a set of planes. We now use 'struct anv_format_plane' to represent the format of those planes. v2: by Jason Rename anv_get_plane_format() to anv_get_format_plane() Don't rename anv_get_isl_format() Replace ds_fmt() by fmt2() Introduce fmt_unsupported() Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv: prepare formats to handle disjoints setsLionel Landwerlin2017-10-061-10/+27
| | | | | | | | | | | Newer format enums start at offset 1000000000, making it impossible to have them all in one table. This change splits the formats into sets that we then access through indirection. v2: rename format_extract to vk_to_anv_format (Chad/Jason) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>