diff --git a/src/panfrost/vulkan/panvk_instance.c b/src/panfrost/vulkan/panvk_instance.c index 866217e3723..b826441a60b 100644 --- a/src/panfrost/vulkan/panvk_instance.c +++ b/src/panfrost/vulkan/panvk_instance.c @@ -38,6 +38,7 @@ static const struct debug_control panvk_debug_options[] = { {"dump", PANVK_DEBUG_DUMP}, {"no_known_warn", PANVK_DEBUG_NO_KNOWN_WARN}, {"cs", PANVK_DEBUG_CS}, + {"copy_gfx", PANVK_DEBUG_COPY_GFX}, {NULL, 0}}; VKAPI_ATTR VkResult VKAPI_CALL diff --git a/src/panfrost/vulkan/panvk_instance.h b/src/panfrost/vulkan/panvk_instance.h index e386deedfd3..19b94f4b1e6 100644 --- a/src/panfrost/vulkan/panvk_instance.h +++ b/src/panfrost/vulkan/panvk_instance.h @@ -22,6 +22,7 @@ enum panvk_debug_flags { PANVK_DEBUG_DUMP = 1 << 6, PANVK_DEBUG_NO_KNOWN_WARN = 1 << 7, PANVK_DEBUG_CS = 1 << 8, + PANVK_DEBUG_COPY_GFX = 1 << 9, }; #if defined(VK_USE_PLATFORM_WAYLAND_KHR) || \ diff --git a/src/panfrost/vulkan/panvk_meta.h b/src/panfrost/vulkan/panvk_meta.h index 508217de15f..3282e652a76 100644 --- a/src/panfrost/vulkan/panvk_meta.h +++ b/src/panfrost/vulkan/panvk_meta.h @@ -12,16 +12,6 @@ #include "vk_format.h" #include "vk_meta.h" -static inline bool -panvk_meta_copy_to_image_use_gfx_pipeline(struct panvk_image *dst_img) -{ - /* Writes to AFBC images must go through the graphics pipeline. */ - if (drm_is_afbc(dst_img->pimage.layout.modifier)) - return true; - - return false; -} - static inline VkFormat panvk_meta_get_uint_format_for_blk_size(unsigned blk_sz) { diff --git a/src/panfrost/vulkan/panvk_vX_cmd_meta.c b/src/panfrost/vulkan/panvk_vX_cmd_meta.c index 9d120b908a9..6a6aaca2061 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_meta.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_meta.c @@ -6,6 +6,23 @@ #include "panvk_cmd_meta.h" #include "panvk_entrypoints.h" +static bool +copy_to_image_use_gfx_pipeline(struct panvk_device *dev, + struct panvk_image *dst_img) +{ + struct panvk_instance *instance = + to_panvk_instance(dev->vk.physical->instance); + + if (instance->debug_flags & PANVK_DEBUG_COPY_GFX) + return true; + + /* Writes to AFBC images must go through the graphics pipeline. */ + if (drm_is_afbc(dst_img->pimage.layout.modifier)) + return true; + + return false; +} + void panvk_per_arch(cmd_meta_compute_start)( struct panvk_cmd_buffer *cmdbuf, @@ -260,7 +277,7 @@ panvk_per_arch(CmdCopyBufferToImage2)( VK_FROM_HANDLE(panvk_image, img, pCopyBufferToImageInfo->dstImage); struct vk_meta_copy_image_properties img_props = panvk_meta_copy_get_image_properties(img); - bool use_gfx_pipeline = panvk_meta_copy_to_image_use_gfx_pipeline(img); + bool use_gfx_pipeline = copy_to_image_use_gfx_pipeline(dev, img); if (use_gfx_pipeline) { struct panvk_cmd_meta_graphics_save_ctx save = {0}; @@ -341,7 +358,7 @@ panvk_per_arch(CmdCopyImage2)(VkCommandBuffer commandBuffer, panvk_meta_copy_get_image_properties(src_img); struct vk_meta_copy_image_properties dst_img_props = panvk_meta_copy_get_image_properties(dst_img); - bool use_gfx_pipeline = panvk_meta_copy_to_image_use_gfx_pipeline(dst_img); + bool use_gfx_pipeline = copy_to_image_use_gfx_pipeline(dev, dst_img); if (use_gfx_pipeline) { struct panvk_cmd_meta_graphics_save_ctx save = {0};