aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/i915_drv.h
diff options
context:
space:
mode:
authorJohn Harrison <John.C.Harrison@Intel.com>2014-11-24 13:49:42 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-12-03 03:35:22 -0500
commit1b5a433a4dd967b125131da42b89b5cc0d5b1f57 (patch)
tree64e16dd2052cb12fa91d0d4d687b19855b148eef /drivers/gpu/drm/i915/i915_drv.h
parentff79e857024143f54aff5257c14595e949f46d8a (diff)
drm/i915: Convert 'i915_seqno_passed' calls into 'i915_gem_request_completed'
Almost everywhere that caled i915_seqno_passed() was really asking 'has the given seqno popped out of the hardware yet?'. Thus it had to query the current hardware seqno and then do a signed delta comparison (which copes with wrapping around zero but not with seqno values more than 2GB apart, although the latter is unlikely!). Now that the majority of seqno instances have been replaced with request structures, it is possible to convert this test to be request based as well. There is now a 'i915_gem_request_completed()' function which takes a request and returns true or false as appropriate. Note that this currently just wraps up the original _passed() test but a later patch in the series will reduce this to simply returning a cached internal value, i.e.: _completed(req) { return req->completed; }' This checkin converts almost all _seqno_passed() calls. The only one left is in the semaphore code which still requires seqnos not request structures. For: VIZ-4377 Signed-off-by: John Harrison <John.C.Harrison@Intel.com> Reviewed-by: Thomas Daniel <Thomas.Daniel@intel.com> [danvet: Drop hunk touching the trace_irq code since I've dropped the patch which converts that, and resolve resulting conflict.] Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/i915_drv.h')
-rw-r--r--drivers/gpu/drm/i915/i915_drv.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
index d4e1fa757a34..04fb96e67093 100644
--- a/drivers/gpu/drm/i915/i915_drv.h
+++ b/drivers/gpu/drm/i915/i915_drv.h
@@ -2062,6 +2062,12 @@ static inline void i915_gem_request_assign(struct drm_i915_gem_request **pdst,
2062 *pdst = src; 2062 *pdst = src;
2063} 2063}
2064 2064
2065/*
2066 * XXX: i915_gem_request_completed should be here but currently needs the
2067 * definition of i915_seqno_passed() which is below. It will be moved in
2068 * a later patch when the call to i915_seqno_passed() is obsoleted...
2069 */
2070
2065struct drm_i915_file_private { 2071struct drm_i915_file_private {
2066 struct drm_i915_private *dev_priv; 2072 struct drm_i915_private *dev_priv;
2067 struct drm_file *file; 2073 struct drm_file *file;
@@ -2563,6 +2569,18 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2)
2563 return (int32_t)(seq1 - seq2) >= 0; 2569 return (int32_t)(seq1 - seq2) >= 0;
2564} 2570}
2565 2571
2572static inline bool i915_gem_request_completed(struct drm_i915_gem_request *req,
2573 bool lazy_coherency)
2574{
2575 u32 seqno;
2576
2577 BUG_ON(req == NULL);
2578
2579 seqno = req->ring->get_seqno(req->ring, lazy_coherency);
2580
2581 return i915_seqno_passed(seqno, req->seqno);
2582}
2583
2566int __must_check i915_gem_get_seqno(struct drm_device *dev, u32 *seqno); 2584int __must_check i915_gem_get_seqno(struct drm_device *dev, u32 *seqno);
2567int __must_check i915_gem_set_seqno(struct drm_device *dev, u32 seqno); 2585int __must_check i915_gem_set_seqno(struct drm_device *dev, u32 seqno);
2568int __must_check i915_gem_object_get_fence(struct drm_i915_gem_object *obj); 2586int __must_check i915_gem_object_get_fence(struct drm_i915_gem_object *obj);