drm/i915: Rename conditional GEM execution macros
After a brief discussion, we settled on a naming convention for the conditional GEM debugging data that should be clearer to the casual user: GEM_DEBUG Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170207102319.10910-1-chris@chris-wilson.co.uk Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
This commit is contained in:
parent
8c12d12159
commit
ae9a043b0c
@ -29,17 +29,17 @@
|
|||||||
#define GEM_BUG_ON(expr) BUG_ON(expr)
|
#define GEM_BUG_ON(expr) BUG_ON(expr)
|
||||||
#define GEM_WARN_ON(expr) WARN_ON(expr)
|
#define GEM_WARN_ON(expr) WARN_ON(expr)
|
||||||
|
|
||||||
#define GEM_BUG_ONLY(expr) expr
|
#define GEM_DEBUG_DECL(var) var
|
||||||
#define GEM_BUG_ONLY_DECLARE(var) var
|
#define GEM_DEBUG_EXEC(expr) expr
|
||||||
#define GEM_BUG_ONLY_ON(expr) GEM_BUG_ON(expr)
|
#define GEM_DEBUG_BUG_ON(expr) GEM_BUG_ON(expr)
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
|
#define GEM_BUG_ON(expr) BUILD_BUG_ON_INVALID(expr)
|
||||||
#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
|
#define GEM_WARN_ON(expr) (BUILD_BUG_ON_INVALID(expr), 0)
|
||||||
|
|
||||||
#define GEM_BUG_ONLY(expr) do { } while (0)
|
#define GEM_DEBUG_DECL(var)
|
||||||
#define GEM_BUG_ONLY_DECLARE(var)
|
#define GEM_DEBUG_EXEC(expr) do { } while (0)
|
||||||
#define GEM_BUG_ONLY_ON(expr)
|
#define GEM_DEBUG_BUG_ON(expr)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define I915_NUM_ENGINES 5
|
#define I915_NUM_ENGINES 5
|
||||||
|
@ -351,7 +351,7 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
|
|||||||
execlists_context_status_change(port[0].request,
|
execlists_context_status_change(port[0].request,
|
||||||
INTEL_CONTEXT_SCHEDULE_IN);
|
INTEL_CONTEXT_SCHEDULE_IN);
|
||||||
desc[0] = execlists_update_context(port[0].request);
|
desc[0] = execlists_update_context(port[0].request);
|
||||||
GEM_BUG_ONLY(port[0].context_id = upper_32_bits(desc[0]));
|
GEM_DEBUG_EXEC(port[0].context_id = upper_32_bits(desc[0]));
|
||||||
port[0].count++;
|
port[0].count++;
|
||||||
|
|
||||||
if (port[1].request) {
|
if (port[1].request) {
|
||||||
@ -359,7 +359,7 @@ static void execlists_submit_ports(struct intel_engine_cs *engine)
|
|||||||
execlists_context_status_change(port[1].request,
|
execlists_context_status_change(port[1].request,
|
||||||
INTEL_CONTEXT_SCHEDULE_IN);
|
INTEL_CONTEXT_SCHEDULE_IN);
|
||||||
desc[1] = execlists_update_context(port[1].request);
|
desc[1] = execlists_update_context(port[1].request);
|
||||||
GEM_BUG_ONLY(port[1].context_id = upper_32_bits(desc[1]));
|
GEM_DEBUG_EXEC(port[1].context_id = upper_32_bits(desc[1]));
|
||||||
port[1].count = 1;
|
port[1].count = 1;
|
||||||
} else {
|
} else {
|
||||||
desc[1] = 0;
|
desc[1] = 0;
|
||||||
@ -583,8 +583,8 @@ static void intel_lrc_irq_handler(unsigned long data)
|
|||||||
continue;
|
continue;
|
||||||
|
|
||||||
/* Check the context/desc id for this event matches */
|
/* Check the context/desc id for this event matches */
|
||||||
GEM_BUG_ONLY_ON(readl(buf + 2 * idx + 1) !=
|
GEM_DEBUG_BUG_ON(readl(buf + 2 * idx + 1) !=
|
||||||
port[0].context_id);
|
port[0].context_id);
|
||||||
|
|
||||||
GEM_BUG_ON(port[0].count == 0);
|
GEM_BUG_ON(port[0].count == 0);
|
||||||
if (--port[0].count == 0) {
|
if (--port[0].count == 0) {
|
||||||
|
@ -2284,7 +2284,7 @@ int intel_ring_begin(struct drm_i915_gem_request *req, int num_dwords)
|
|||||||
|
|
||||||
ring->space -= bytes;
|
ring->space -= bytes;
|
||||||
GEM_BUG_ON(ring->space < 0);
|
GEM_BUG_ON(ring->space < 0);
|
||||||
GEM_BUG_ONLY(ring->advance = ring->tail + bytes);
|
GEM_DEBUG_EXEC(ring->advance = ring->tail + bytes);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,7 +144,7 @@ struct intel_ring {
|
|||||||
|
|
||||||
u32 head;
|
u32 head;
|
||||||
u32 tail;
|
u32 tail;
|
||||||
GEM_BUG_ONLY_DECLARE(u32 advance);
|
GEM_DEBUG_DECL(u32 advance);
|
||||||
|
|
||||||
int space;
|
int space;
|
||||||
int size;
|
int size;
|
||||||
@ -381,7 +381,7 @@ struct intel_engine_cs {
|
|||||||
struct execlist_port {
|
struct execlist_port {
|
||||||
struct drm_i915_gem_request *request;
|
struct drm_i915_gem_request *request;
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
GEM_BUG_ONLY_DECLARE(u32 context_id);
|
GEM_DEBUG_DECL(u32 context_id);
|
||||||
} execlist_port[2];
|
} execlist_port[2];
|
||||||
struct rb_root execlist_queue;
|
struct rb_root execlist_queue;
|
||||||
struct rb_node *execlist_first;
|
struct rb_node *execlist_first;
|
||||||
@ -519,7 +519,7 @@ static inline void intel_ring_advance(struct intel_ring *ring)
|
|||||||
* reserved for the command packet (i.e. the value passed to
|
* reserved for the command packet (i.e. the value passed to
|
||||||
* intel_ring_begin()).
|
* intel_ring_begin()).
|
||||||
*/
|
*/
|
||||||
GEM_BUG_ONLY_ON(ring->tail != ring->advance);
|
GEM_DEBUG_BUG_ON(ring->tail != ring->advance);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline u32 intel_ring_offset(struct intel_ring *ring, void *addr)
|
static inline u32 intel_ring_offset(struct intel_ring *ring, void *addr)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user