|
@@ -2189,8 +2189,17 @@ struct drm_i915_gem_request {
|
|
|
struct drm_i915_private *i915;
|
|
|
struct intel_engine_cs *ring;
|
|
|
|
|
|
- /** GEM sequence number associated with this request. */
|
|
|
- uint32_t seqno;
|
|
|
+ /** GEM sequence number associated with the previous request,
|
|
|
+ * when the HWS breadcrumb is equal to this the GPU is processing
|
|
|
+ * this request.
|
|
|
+ */
|
|
|
+ u32 previous_seqno;
|
|
|
+
|
|
|
+ /** GEM sequence number associated with this request,
|
|
|
+ * when the HWS breadcrumb is equal or greater than this the GPU
|
|
|
+ * has finished processing this request.
|
|
|
+ */
|
|
|
+ u32 seqno;
|
|
|
|
|
|
/** Position in the ringbuffer of the start of the request */
|
|
|
u32 head;
|
|
@@ -2969,15 +2978,17 @@ i915_seqno_passed(uint32_t seq1, uint32_t seq2)
|
|
|
return (int32_t)(seq1 - seq2) >= 0;
|
|
|
}
|
|
|
|
|
|
+static inline bool i915_gem_request_started(struct drm_i915_gem_request *req,
|
|
|
+ bool lazy_coherency)
|
|
|
+{
|
|
|
+ u32 seqno = req->ring->get_seqno(req->ring, lazy_coherency);
|
|
|
+ return i915_seqno_passed(seqno, req->previous_seqno);
|
|
|
+}
|
|
|
+
|
|
|
static inline bool i915_gem_request_completed(struct drm_i915_gem_request *req,
|
|
|
bool lazy_coherency)
|
|
|
{
|
|
|
- u32 seqno;
|
|
|
-
|
|
|
- BUG_ON(req == NULL);
|
|
|
-
|
|
|
- seqno = req->ring->get_seqno(req->ring, lazy_coherency);
|
|
|
-
|
|
|
+ u32 seqno = req->ring->get_seqno(req->ring, lazy_coherency);
|
|
|
return i915_seqno_passed(seqno, req->seqno);
|
|
|
}
|
|
|
|