panvk: Add a debug flag to force image copies through the gfx pipeline
Useful to debug copy-related issues. Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Eric R. Smith <eric.smith@collabora.com> Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31441>
This commit is contained in:
committed by
Marge Bot
parent
3d7bf07089
commit
206bf1be09
@@ -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
|
||||
|
||||
@@ -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) || \
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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};
|
||||
|
||||
Reference in New Issue
Block a user