]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915: remove single-use GEM_DEBUG_EXEC()
authorJani Nikula <jani.nikula@intel.com>
Wed, 4 May 2022 18:37:15 +0000 (21:37 +0300)
committerJani Nikula <jani.nikula@intel.com>
Mon, 9 May 2022 11:16:29 +0000 (14:16 +0300)
Reduce the magic of what's going on in GEM_DEBUG_EXEC() by expanding it
inline and being explicit about it. It's as single use case anyway, so
the macro feels overkill.

Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504183716.987793-2-jani.nikula@intel.com
drivers/gpu/drm/i915/gt/intel_ring.c
drivers/gpu/drm/i915/i915_gem.h

index 40ffcb94e3797c295347f2d0f24faed65b2664d3..15ec64d881c4464dc062d73cd3b654d6b169ab7f 100644 (file)
@@ -299,7 +299,8 @@ u32 *intel_ring_begin(struct i915_request *rq, unsigned int num_dwords)
        GEM_BUG_ON(ring->emit > ring->size - bytes);
        GEM_BUG_ON(ring->space < bytes);
        cs = ring->vaddr + ring->emit;
-       GEM_DEBUG_EXEC(memset32(cs, POISON_INUSE, bytes / sizeof(*cs)));
+       if (IS_ENABLED(CONFIG_DRM_I915_DEBUG_GEM))
+               memset32(cs, POISON_INUSE, bytes / sizeof(*cs));
        ring->emit += bytes;
        ring->space -= bytes;
 
index b7b257f54d2e2abbc7146191ea91058678b9e487..a2be323a4be5594ef87071e11bf0fe871dea90a4 100644 (file)
@@ -54,7 +54,6 @@ struct drm_i915_private;
        } while(0)
 #define GEM_WARN_ON(expr) WARN_ON(expr)
 
-#define GEM_DEBUG_EXEC(expr) expr
 #define GEM_DEBUG_WARN_ON(expr) GEM_WARN_ON(expr)
 
 #else
@@ -64,7 +63,6 @@ struct drm_i915_private;
 #define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
 #define GEM_WARN_ON(expr) ({ unlikely(!!(expr)); })
 
-#define GEM_DEBUG_EXEC(expr) do { } while (0)
 #define GEM_DEBUG_WARN_ON(expr) ({ BUILD_BUG_ON_INVALID(expr); 0; })
 #endif