anv: Take a device in anv_perf_warn
authorJason Ekstrand <jason@jlekstrand.net>
Sat, 18 Jan 2020 04:57:35 +0000 (22:57 -0600)
committerMarge Bot <eric+marge@anholt.net>
Mon, 20 Jan 2020 22:08:52 +0000 (22:08 +0000)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3461>

src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/anv_util.c
src/intel/vulkan/genX_cmd_buffer.c

index 6bbeb840285e8e9c839857eccdf00cdd0fe50e20..461b6f83dd286925381ff6bfbe5bddfe586c45d2 100644 (file)
@@ -308,7 +308,7 @@ add_aux_state_tracking_buffer(struct anv_image *image,
  * image's memory requirements (that is, the image's size and alignment).
  */
 static VkResult
-make_surface(const struct anv_device *dev,
+make_surface(struct anv_device *dev,
              struct anv_image *image,
              uint32_t stride,
              isl_tiling_flags_t tiling_flags,
@@ -424,14 +424,14 @@ make_surface(const struct anv_device *dev,
       if (!(image->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT)) {
          /* It will never be used as an attachment, HiZ is pointless. */
       } else if (dev->info.gen == 7) {
-         anv_perf_warn(dev->instance, image, "Implement gen7 HiZ");
+         anv_perf_warn(dev, image, "Implement gen7 HiZ");
       } else if (image->levels > 1) {
-         anv_perf_warn(dev->instance, image, "Enable multi-LOD HiZ");
+         anv_perf_warn(dev, image, "Enable multi-LOD HiZ");
       } else if (image->array_size > 1) {
-         anv_perf_warn(dev->instance, image,
+         anv_perf_warn(dev, image,
                        "Implement multi-arrayLayer HiZ clears and resolves");
       } else if (dev->info.gen == 8 && image->samples > 1) {
-         anv_perf_warn(dev->instance, image, "Enable gen8 multisampled HiZ");
+         anv_perf_warn(dev, image, "Enable gen8 multisampled HiZ");
       } else if (!unlikely(INTEL_DEBUG & DEBUG_NO_HIZ)) {
          assert(image->planes[plane].aux_surface.isl.size_B == 0);
          ok = isl_surf_get_hiz_surf(&dev->isl_dev,
@@ -475,7 +475,7 @@ make_surface(const struct anv_device *dev,
                 * image, we currently don't have things hooked up to get it
                 * working.
                 */
-               anv_perf_warn(dev->instance, image,
+               anv_perf_warn(dev, image,
                              "This image format doesn't support rendering. "
                              "Not allocating an CCS buffer.");
                image->planes[plane].aux_surface.isl.size_B = 0;
@@ -494,7 +494,7 @@ make_surface(const struct anv_device *dev,
                 image->ccs_e_compatible) {
                image->planes[plane].aux_usage = ISL_AUX_USAGE_CCS_E;
             } else if (dev->info.gen >= 12) {
-               anv_perf_warn(dev->instance, image,
+               anv_perf_warn(dev, image,
                              "The CCS_D aux mode is not yet handled on "
                              "Gen12+. Not allocating a CCS buffer.");
                image->planes[plane].aux_surface.isl.size_B = 0;
index 84f1dc53d867c5f0863ec3cc5b1bba4a2286aee0..53359f5225f931b52a8a5693ff3f959589fca8fc 100644 (file)
@@ -478,7 +478,7 @@ VkResult __vk_errorf(struct anv_instance *instance, const void *object,
 #define anv_debug_ignored_stype(sType) \
    intel_logd("%s: ignored VkStructureType %u\n", __func__, (sType))
 
-void __anv_perf_warn(struct anv_instance *instance, const void *object,
+void __anv_perf_warn(struct anv_device *device, const void *object,
                      VkDebugReportObjectTypeEXT type, const char *file,
                      int line, const char *format, ...)
    anv_printflike(6, 7);
index 1159ccecc6a9fea5fdda9217b703d399fc1cbc1c..58d2efcc51f2d64b52ff650ff43a486c70c7c58a 100644 (file)
@@ -50,7 +50,7 @@ anv_loge_v(const char *format, va_list va)
 }
 
 void anv_printflike(6, 7)
-__anv_perf_warn(struct anv_instance *instance, const void *object,
+__anv_perf_warn(struct anv_device *device, const void *object,
                 VkDebugReportObjectTypeEXT type,
                 const char *file, int line, const char *format, ...)
 {
@@ -64,7 +64,7 @@ __anv_perf_warn(struct anv_instance *instance, const void *object,
 
    snprintf(report, sizeof(report), "%s: %s", file, buffer);
 
-   vk_debug_report(&instance->debug_report_callbacks,
+   vk_debug_report(&device->physical->instance->debug_report_callbacks,
                    VK_DEBUG_REPORT_PERFORMANCE_WARNING_BIT_EXT,
                    type,
                    (uint64_t) (uintptr_t) object,
index 88d17eeab1e2bde3db2839caa0066ca2ee96acaa..0e9f7ce2e23a5df2d8873e3cc51f7d41067773b6 100644 (file)
@@ -342,7 +342,7 @@ color_attachment_compute_aux_usage(struct anv_device * device,
           */
          if (cmd_state->pass->attachments[att].first_subpass_layout ==
              VK_IMAGE_LAYOUT_COLOR_ATTACHMENT_OPTIMAL) {
-            anv_perf_warn(device->instance, iview->image,
+            anv_perf_warn(device, iview->image,
                           "Not temporarily enabling CCS_E.");
          }
       } else {
@@ -406,13 +406,13 @@ color_attachment_compute_aux_usage(struct anv_device * device,
       if (att_state->fast_clear &&
           (iview->planes[0].isl.base_level > 0 ||
            iview->planes[0].isl.base_array_layer > 0)) {
-         anv_perf_warn(device->instance, iview->image,
+         anv_perf_warn(device, iview->image,
                        "Rendering with multi-lod or multi-layer framebuffer "
                        "with LOAD_OP_LOAD and baseMipLevel > 0 or "
                        "baseArrayLayer > 0.  Not fast clearing.");
          att_state->fast_clear = false;
       } else if (att_state->fast_clear && cmd_state->framebuffer->layers > 1) {
-         anv_perf_warn(device->instance, iview->image,
+         anv_perf_warn(device, iview->image,
                        "Rendering to a multi-layer framebuffer with "
                        "LOAD_OP_CLEAR.  Only fast-clearing the first slice");
       }
@@ -1102,7 +1102,7 @@ transition_color_buffer(struct anv_cmd_buffer *cmd_buffer,
          }
       } else {
          if (image->samples == 4 || image->samples == 16) {
-            anv_perf_warn(cmd_buffer->device->instance, image,
+            anv_perf_warn(cmd_buffer->device, image,
                           "Doing a potentially unnecessary fast-clear to "
                           "define an MCS buffer.");
          }
@@ -5166,7 +5166,7 @@ cmd_buffer_end_subpass(struct anv_cmd_buffer *cmd_buffer)
           * SRGB view & a UNORM image).
           */
          if (fast_clear_type != ANV_FAST_CLEAR_NONE) {
-            anv_perf_warn(cmd_buffer->device->instance, iview,
+            anv_perf_warn(cmd_buffer->device, iview,
                           "Doing a partial resolve to get rid of clear color at the "
                           "end of a renderpass due to an image/view format mismatch");