summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_lrc.h
diff options
context:
space:
mode:
authorChris Wilson2017-09-12 23:49:05 +0200
committerChris Wilson2017-09-13 11:31:48 +0200
commit2013ddebd2f4b5ef90625c8b82da216df0123134 (patch)
tree02fbd4475dedeb0e0d8fb76ff01a466d3fe1da99 /drivers/gpu/drm/i915/intel_lrc.h
parentdrm/i915/dsi: Replace MIPI command error message with debug message (diff)
downloadkernel-qcow2-linux-2013ddebd2f4b5ef90625c8b82da216df0123134.tar.gz
kernel-qcow2-linux-2013ddebd2f4b5ef90625c8b82da216df0123134.tar.xz
kernel-qcow2-linux-2013ddebd2f4b5ef90625c8b82da216df0123134.zip
drm/i915: Move the context descriptor to an inline helper
The context descriptor is stored inside the per-engine context state, as we only need to compute it once and access it frequently. However, currently only intel_lrc.c has easy access, but i915_guc_submission.c would like to frequently read it as well, and more so only ever needs the lower 32bits. Make it an inline as the compiler should be able to retrieve the value in less instructions than it takes to do the function call: add/remove: 0/1 grow/shrink: 1/0 up/down: 8/-45 (-37) function old new delta i915_guc_submit 621 629 +8 intel_lr_context_descriptor 45 - -45 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Link: https://patchwork.freedesktop.org/patch/msgid/20170912214905.21987-1-chris@chris-wilson.co.uk Reviewed-by: Oscar Mateo <oscar.mateo@intel.com>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_lrc.h')
-rw-r--r--drivers/gpu/drm/i915/intel_lrc.h11
1 files changed, 9 insertions, 2 deletions
diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h
index 57ef5833c427..3b1de327e504 100644
--- a/drivers/gpu/drm/i915/intel_lrc.h
+++ b/drivers/gpu/drm/i915/intel_lrc.h
@@ -25,6 +25,7 @@
#define _INTEL_LRC_H_
#include "intel_ringbuffer.h"
+#include "i915_gem_context.h"
#define GEN8_LR_CONTEXT_ALIGN I915_GTT_MIN_ALIGNMENT
@@ -78,8 +79,14 @@ struct drm_i915_private;
struct i915_gem_context;
void intel_lr_context_resume(struct drm_i915_private *dev_priv);
-uint64_t intel_lr_context_descriptor(struct i915_gem_context *ctx,
- struct intel_engine_cs *engine);
+
+static inline uint64_t
+intel_lr_context_descriptor(struct i915_gem_context *ctx,
+ struct intel_engine_cs *engine)
+{
+ return ctx->engine[engine->id].lrc_desc;
+}
+
/* Execlists */
int intel_sanitize_enable_execlists(struct drm_i915_private *dev_priv,