diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-04 09:08:46 -0400 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-05-04 10:40:38 -0400 |
commit | 5e5655c32de83a0151de0c4993d7783c22b6f9b4 (patch) | |
tree | 3436e783ba56065ce254fc3ac3c4de9582fab0be /drivers/gpu/drm/i915/intel_ringbuffer.h | |
parent | 95aebcb2da73079f9ecb7f4e353af71ff1f04c05 (diff) |
drm/i915: Micro-optimise hotpath through intel_ring_begin()
Typically, there is space available within the ring and if not we have
to wait (by definition a slow path). Rearrange the code to reduce the
number of branches and stack size for the hotpath, accomodating a slight
growth for the wait.
v2: Fix the new assert that packets are not larger than the actual ring.
v3: Make the parameters unsigned as well to make usage.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170504130846.4807-3-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/intel_ringbuffer.h')
-rw-r--r-- | drivers/gpu/drm/i915/intel_ringbuffer.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/gpu/drm/i915/intel_ringbuffer.h b/drivers/gpu/drm/i915/intel_ringbuffer.h index 3e343b09eeb6..ec16fb6fde62 100644 --- a/drivers/gpu/drm/i915/intel_ringbuffer.h +++ b/drivers/gpu/drm/i915/intel_ringbuffer.h | |||
@@ -497,7 +497,8 @@ void intel_legacy_submission_resume(struct drm_i915_private *dev_priv); | |||
497 | 497 | ||
498 | int __must_check intel_ring_cacheline_align(struct drm_i915_gem_request *req); | 498 | int __must_check intel_ring_cacheline_align(struct drm_i915_gem_request *req); |
499 | 499 | ||
500 | u32 __must_check *intel_ring_begin(struct drm_i915_gem_request *req, int n); | 500 | u32 __must_check *intel_ring_begin(struct drm_i915_gem_request *req, |
501 | unsigned int n); | ||
501 | 502 | ||
502 | static inline void | 503 | static inline void |
503 | intel_ring_advance(struct drm_i915_gem_request *req, u32 *cs) | 504 | intel_ring_advance(struct drm_i915_gem_request *req, u32 *cs) |