From 82f47acb1617728c8f045e529853e953970f18a9 Mon Sep 17 00:00:00 2001 From: Jianxun Zhang Date: Wed, 25 Oct 2023 07:14:52 -0700 Subject: [PATCH] intel/vulkan: Remove private binding on fast clear region To support modifiers with fast clear color, the region should be able to export along with main surface, so we remove the private binding in such case. Signed-off-by: Jianxun Zhang Reviewed-by: Nanley Chery Acked-by: Rohan Garg Part-of: --- src/intel/vulkan/anv_image.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index b1bd87b7474..09c8b813a55 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -639,8 +639,12 @@ add_aux_state_tracking_buffer(struct anv_device *device, * processes with access to the memory may not be aware of it or of * its current state. So put that auxiliary data into a separate * buffer (ANV_IMAGE_MEMORY_BINDING_PRIVATE). + * + * But when the image is created with a drm modifier that supports + * clear color, it will be exported along with main surface. */ - if (anv_image_is_externally_shared(image)) { + if (anv_image_is_externally_shared(image) + && !isl_drm_modifier_get_info(image->vk.drm_format_mod)->supports_clear_color) { binding = ANV_IMAGE_MEMORY_BINDING_PRIVATE; } @@ -1117,8 +1121,12 @@ check_memory_bindings(const struct anv_device *device, * processes with access to the memory may not be aware of it or of * its current state. So put that auxiliary data into a separate * buffer (ANV_IMAGE_MEMORY_BINDING_PRIVATE). + * + * But when the image is created with a drm modifier that supports + * clear color, it will be exported along with main surface. */ - if (anv_image_is_externally_shared(image)) { + if (anv_image_is_externally_shared(image) + && !isl_drm_modifier_get_info(image->vk.drm_format_mod)->supports_clear_color) { binding = ANV_IMAGE_MEMORY_BINDING_PRIVATE; }