Commit e9794c88 authored by Jani Nikula's avatar Jani Nikula
Browse files

drm/i915: remove single-use GEM_DEBUG_EXEC()



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: default avatarJani Nikula <jani.nikula@intel.com>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20220504183716.987793-2-jani.nikula@intel.com
parent 1b93ff4d
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -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;

+0 −2
Original line number Diff line number Diff line
@@ -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