From: Alyssa Rosenzweig Date: Thu, 30 Mar 2023 15:55:31 +0000 (-0400) Subject: anv,hasvk: Use vk_features2_to_features X-Git-Tag: upstream/23.3.3~10270 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=4fa2924610c7aa69bcfd6a8f47e528606aac846c;p=platform%2Fupstream%2Fmesa.git anv,hasvk: Use vk_features2_to_features Signed-off-by: Alyssa Rosenzweig Reviewed-by: Faith Ekstrand Part-of: --- diff --git a/src/intel/vulkan/anv_android.c b/src/intel/vulkan/anv_android.c index 2b0b4fa..ad77a52 100644 --- a/src/intel/vulkan/anv_android.c +++ b/src/intel/vulkan/anv_android.c @@ -164,12 +164,6 @@ anv_ahb_format_for_vk_format(VkFormat vk_format) } } -static VkFormatFeatureFlags -features2_to_features(VkFormatFeatureFlags2 features2) -{ - return features2 & VK_ALL_FORMAT_FEATURE_FLAG_BITS; -} - static VkResult get_ahw_buffer_format_properties2( VkDevice device_h, @@ -271,7 +265,7 @@ anv_GetAndroidHardwareBufferPropertiesANDROID( format_prop->format = format_prop2.format; format_prop->externalFormat = format_prop2.externalFormat; format_prop->formatFeatures = - features2_to_features(format_prop2.formatFeatures); + vk_format_features2_to_features(format_prop2.formatFeatures); format_prop->samplerYcbcrConversionComponents = format_prop2.samplerYcbcrConversionComponents; format_prop->suggestedYcbcrModel = format_prop2.suggestedYcbcrModel; diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c index d75602f..7ac1626 100644 --- a/src/intel/vulkan/anv_formats.c +++ b/src/intel/vulkan/anv_formats.c @@ -865,12 +865,6 @@ get_buffer_format_features2(const struct intel_device_info *devinfo, return flags; } -static VkFormatFeatureFlags -features2_to_features(VkFormatFeatureFlags2 features2) -{ - return features2 & VK_ALL_FORMAT_FEATURE_FLAG_BITS; -} - static void get_drm_format_modifier_properties_list(const struct anv_physical_device *physical_device, VkFormat vk_format, @@ -888,7 +882,7 @@ get_drm_format_modifier_properties_list(const struct anv_physical_device *physic anv_get_image_format_features2(devinfo, vk_format, anv_format, VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, isl_mod_info); - VkFormatFeatureFlags features = features2_to_features(features2); + VkFormatFeatureFlags features = vk_format_features2_to_features(features2); if (!features) continue; @@ -959,9 +953,9 @@ void anv_GetPhysicalDeviceFormatProperties2( buffer2 = get_buffer_format_features2(devinfo, vk_format, anv_format); pFormatProperties->formatProperties = (VkFormatProperties) { - .linearTilingFeatures = features2_to_features(linear2), - .optimalTilingFeatures = features2_to_features(optimal2), - .bufferFeatures = features2_to_features(buffer2), + .linearTilingFeatures = vk_format_features2_to_features(linear2), + .optimalTilingFeatures = vk_format_features2_to_features(optimal2), + .bufferFeatures = vk_format_features2_to_features(buffer2), }; vk_foreach_struct(ext, pFormatProperties->pNext) { diff --git a/src/intel/vulkan_hasvk/anv_android.c b/src/intel/vulkan_hasvk/anv_android.c index b5fc292..f8aa155 100644 --- a/src/intel/vulkan_hasvk/anv_android.c +++ b/src/intel/vulkan_hasvk/anv_android.c @@ -164,12 +164,6 @@ anv_ahb_format_for_vk_format(VkFormat vk_format) } } -static VkFormatFeatureFlags -features2_to_features(VkFormatFeatureFlags2 features2) -{ - return features2 & VK_ALL_FORMAT_FEATURE_FLAG_BITS; -} - static VkResult get_ahw_buffer_format_properties2( VkDevice device_h, @@ -271,7 +265,7 @@ anv_GetAndroidHardwareBufferPropertiesANDROID( format_prop->format = format_prop2.format; format_prop->externalFormat = format_prop2.externalFormat; format_prop->formatFeatures = - features2_to_features(format_prop2.formatFeatures); + vk_format_features2_to_features(format_prop2.formatFeatures); format_prop->samplerYcbcrConversionComponents = format_prop2.samplerYcbcrConversionComponents; format_prop->suggestedYcbcrModel = format_prop2.suggestedYcbcrModel; diff --git a/src/intel/vulkan_hasvk/anv_formats.c b/src/intel/vulkan_hasvk/anv_formats.c index 92d4e02..392aa8f 100644 --- a/src/intel/vulkan_hasvk/anv_formats.c +++ b/src/intel/vulkan_hasvk/anv_formats.c @@ -857,12 +857,6 @@ get_buffer_format_features2(const struct intel_device_info *devinfo, return flags; } -static VkFormatFeatureFlags -features2_to_features(VkFormatFeatureFlags2 features2) -{ - return features2 & VK_ALL_FORMAT_FEATURE_FLAG_BITS; -} - static void get_drm_format_modifier_properties_list(const struct anv_physical_device *physical_device, VkFormat vk_format, @@ -880,7 +874,7 @@ get_drm_format_modifier_properties_list(const struct anv_physical_device *physic anv_get_image_format_features2(devinfo, vk_format, anv_format, VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT, isl_mod_info); - VkFormatFeatureFlags features = features2_to_features(features2); + VkFormatFeatureFlags features = vk_format_features2_to_features(features2); if (!features) continue; @@ -951,9 +945,9 @@ void anv_GetPhysicalDeviceFormatProperties2( buffer2 = get_buffer_format_features2(devinfo, vk_format, anv_format); pFormatProperties->formatProperties = (VkFormatProperties) { - .linearTilingFeatures = features2_to_features(linear2), - .optimalTilingFeatures = features2_to_features(optimal2), - .bufferFeatures = features2_to_features(buffer2), + .linearTilingFeatures = vk_format_features2_to_features(linear2), + .optimalTilingFeatures = vk_format_features2_to_features(optimal2), + .bufferFeatures = vk_format_features2_to_features(buffer2), }; vk_foreach_struct(ext, pFormatProperties->pNext) {