panfrost: Warn on going out of AFBC
authorAlyssa Rosenzweig <alyssa@collabora.com>
Mon, 12 Jul 2021 17:56:16 +0000 (13:56 -0400)
committerMarge Bot <eric+marge@anholt.net>
Wed, 14 Jul 2021 17:41:27 +0000 (17:41 +0000)
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11830>

src/gallium/drivers/panfrost/pan_context.c
src/gallium/drivers/panfrost/pan_resource.c
src/gallium/drivers/panfrost/pan_resource.h

index 00f5bfd..9f82998 100644 (file)
@@ -265,7 +265,8 @@ panfrost_set_shader_images(
                 /* Images don't work with AFBC, since they require pixel-level granularity */
                 if (drm_is_afbc(rsrc->image.layout.modifier)) {
                         pan_resource_modifier_convert(ctx, rsrc,
-                                        DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED);
+                                        DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED,
+                                        "Shader image");
                 }
 
                 util_copy_image_view(&ctx->images[shader][start_slot+i], image);
index 594c5b5..14baf90 100644 (file)
@@ -986,10 +986,12 @@ panfrost_ptr_map(struct pipe_context *pctx,
 void
 pan_resource_modifier_convert(struct panfrost_context *ctx,
                               struct panfrost_resource *rsrc,
-                              uint64_t modifier)
+                              uint64_t modifier, const char *reason)
 {
         assert(!rsrc->modifier_constant);
 
+        perf_debug_ctx(ctx, "Disabling AFBC with a blit. Reason: %s", reason);
+
         struct pipe_resource *tmp_prsrc =
                 panfrost_resource_create_with_modifier(
                         ctx->base.screen, &rsrc->base, modifier);
index a3cd7bf..6150e16 100644 (file)
@@ -156,6 +156,6 @@ panfrost_translate_texture_dimension(enum pipe_texture_target t) {
 void
 pan_resource_modifier_convert(struct panfrost_context *ctx,
                               struct panfrost_resource *rsrc,
-                              uint64_t modifier);
+                              uint64_t modifier, const char *reason);
 
 #endif /* PAN_RESOURCE_H */