anv: drop likely/unlikely around INTEL_DEBUG
authorMarcin Ślusarz <marcin.slusarz@intel.com>
Mon, 14 Sep 2020 16:53:13 +0000 (18:53 +0200)
committerMarge Bot <eric+marge@anholt.net>
Tue, 6 Oct 2020 18:43:07 +0000 (18:43 +0000)
It's included in declaration of INTEL_DEBUG.

Signed-off-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6732>

src/intel/vulkan/anv_batch_chain.c
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_image.c
src/intel/vulkan/anv_perf.c
src/intel/vulkan/anv_pipeline.c
src/intel/vulkan/anv_private.h
src/intel/vulkan/genX_cmd_buffer.c

index 1258af7..d6d8554 100644 (file)
@@ -1750,7 +1750,7 @@ anv_queue_execbuf_locked(struct anv_queue *queue,
       submit->cmd_buffer &&
       submit->cmd_buffer->perf_query_pool;
 
-   if (unlikely(INTEL_DEBUG & DEBUG_BATCH)) {
+   if (INTEL_DEBUG & DEBUG_BATCH) {
       if (submit->cmd_buffer) {
          if (has_perf_query) {
             struct anv_query_pool *query_pool = submit->cmd_buffer->perf_query_pool;
@@ -1816,7 +1816,7 @@ anv_queue_execbuf_locked(struct anv_queue *queue,
       /* Some performance queries just the pipeline statistic HW, no need for
        * OA in that case, so no need to reconfigure.
        */
-      if (likely((INTEL_DEBUG & DEBUG_NO_OACONFIG) == 0) &&
+      if ((INTEL_DEBUG & DEBUG_NO_OACONFIG) == 0 &&
           (query_info->kind == GEN_PERF_QUERY_TYPE_OA ||
            query_info->kind == GEN_PERF_QUERY_TYPE_RAW)) {
          int ret = gen_ioctl(device->perf_fd, I915_PERF_IOCTL_CONFIG,
index fe24730..01f6c4a 100644 (file)
@@ -97,7 +97,7 @@ compiler_perf_log(void *data, const char *fmt, ...)
    va_list args;
    va_start(args, fmt);
 
-   if (unlikely(INTEL_DEBUG & DEBUG_PERF))
+   if (INTEL_DEBUG & DEBUG_PERF)
       mesa_logd_v(fmt, args);
 
    va_end(args);
index ee6247f..a949ea4 100644 (file)
@@ -398,7 +398,7 @@ add_aux_surface_if_supported(struct anv_device *device,
          return VK_SUCCESS;
       }
 
-      if (unlikely(INTEL_DEBUG & DEBUG_NO_HIZ))
+      if (INTEL_DEBUG & DEBUG_NO_HIZ)
          return VK_SUCCESS;
 
       ok = isl_surf_get_hiz_surf(&device->isl_dev,
@@ -481,7 +481,7 @@ add_aux_surface_if_supported(struct anv_device *device,
          return VK_SUCCESS;
       }
 
-      if (unlikely(INTEL_DEBUG & DEBUG_NO_RBC))
+      if (INTEL_DEBUG & DEBUG_NO_RBC)
          return VK_SUCCESS;
 
       ok = isl_surf_get_ccs_surf(&device->isl_dev,
index d96008f..ba6f677 100644 (file)
@@ -187,7 +187,7 @@ VkResult anv_AcquirePerformanceConfigurationINTEL(
    if (!config)
       return vk_error(VK_ERROR_OUT_OF_HOST_MEMORY);
 
-   if (likely(!(INTEL_DEBUG & DEBUG_NO_OACONFIG))) {
+   if (!(INTEL_DEBUG & DEBUG_NO_OACONFIG)) {
       config->register_config =
          gen_perf_load_configuration(device->physical->perf, device->fd,
                                      GEN_PERF_QUERY_GUID_MDAPI);
@@ -223,7 +223,7 @@ VkResult anv_ReleasePerformanceConfigurationINTEL(
    ANV_FROM_HANDLE(anv_device, device, _device);
    ANV_FROM_HANDLE(anv_performance_configuration_intel, config, _configuration);
 
-   if (likely(!(INTEL_DEBUG & DEBUG_NO_OACONFIG)))
+   if (!(INTEL_DEBUG & DEBUG_NO_OACONFIG))
       gen_ioctl(device->fd, DRM_IOCTL_I915_PERF_REMOVE_CONFIG, &config->config_id);
 
    ralloc_free(config->register_config);
@@ -241,7 +241,7 @@ VkResult anv_QueueSetPerformanceConfigurationINTEL(
    ANV_FROM_HANDLE(anv_performance_configuration_intel, config, _configuration);
    struct anv_device *device = queue->device;
 
-   if (likely(!(INTEL_DEBUG & DEBUG_NO_OACONFIG))) {
+   if (!(INTEL_DEBUG & DEBUG_NO_OACONFIG)) {
       if (device->perf_fd < 0) {
          device->perf_fd = anv_device_perf_open(device, config->config_id);
          if (device->perf_fd < 0)
@@ -370,7 +370,7 @@ VkResult anv_AcquireProfilingLockKHR(
 
    assert(device->perf_fd == -1);
 
-   if (likely(!(INTEL_DEBUG & DEBUG_NO_OACONFIG))) {
+   if (!(INTEL_DEBUG & DEBUG_NO_OACONFIG)) {
       fd = anv_device_perf_open(device, first_metric_set->oa_metrics_set_id);
       if (fd < 0)
          return VK_TIMEOUT;
@@ -385,7 +385,7 @@ void anv_ReleaseProfilingLockKHR(
 {
    ANV_FROM_HANDLE(anv_device, device, _device);
 
-   if (likely(!(INTEL_DEBUG & DEBUG_NO_OACONFIG))) {
+   if (!(INTEL_DEBUG & DEBUG_NO_OACONFIG)) {
       assert(device->perf_fd >= 0);
       close(device->perf_fd);
    }
index 36da2cc..f8921de 100644 (file)
@@ -247,7 +247,7 @@ anv_shader_compile_to_nir(struct anv_device *device,
 
    free(spec_entries);
 
-   if (unlikely(INTEL_DEBUG & intel_debug_flag_for_shader_stage(stage))) {
+   if (INTEL_DEBUG & intel_debug_flag_for_shader_stage(stage)) {
       fprintf(stderr, "NIR (from SPIR-V) for %s shader:\n",
               gl_shader_stage_name(stage));
       nir_print_shader(nir, stderr);
index aa216cb..e35b499 100644 (file)
@@ -536,7 +536,7 @@ void anv_loge_v(const char *format, va_list va);
 #define anv_perf_warn(instance, obj, format, ...) \
    do { \
       static bool reported = false; \
-      if (!reported && unlikely(INTEL_DEBUG & DEBUG_PERF)) { \
+      if (!reported && (INTEL_DEBUG & DEBUG_PERF)) { \
          __anv_perf_warn(instance, obj, REPORT_OBJECT_TYPE(obj), __FILE__, __LINE__,\
                          format, ##__VA_ARGS__); \
          reported = true; \
index 259e175..a2d185b 100644 (file)
@@ -1827,7 +1827,7 @@ genX(cmd_buffer_config_l3)(struct anv_cmd_buffer *cmd_buffer,
    if (cfg == cmd_buffer->state.current_l3_config)
       return;
 
-   if (unlikely(INTEL_DEBUG & DEBUG_L3)) {
+   if (INTEL_DEBUG & DEBUG_L3) {
       mesa_logd("L3 config transition: ");
       gen_dump_l3_config(cfg, stderr);
    }