Commit 9bfc01a2 authored by John Harrison's avatar John Harrison Committed by Daniel Vetter

drm/i915: Convert 'last_flip_req' to be a request not a seqno

Converted 'last_flip_req' to be an actual request rather than a seqno value as
part of the on going seqno to request changes. This includes reference counting
the request being saved away to ensure it can not be retired and freed while the
overlay code is still waiting on it.

For: VIZ-4377
Signed-off-by: default avatarJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: default avatarThomas Daniel <Thomas.Daniel@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b6660d59
...@@ -182,7 +182,7 @@ struct intel_overlay { ...@@ -182,7 +182,7 @@ struct intel_overlay {
u32 flip_addr; u32 flip_addr;
struct drm_i915_gem_object *reg_bo; struct drm_i915_gem_object *reg_bo;
/* flip handling */ /* flip handling */
uint32_t last_flip_req; struct drm_i915_gem_request *last_flip_req;
void (*flip_tail)(struct intel_overlay *); void (*flip_tail)(struct intel_overlay *);
}; };
...@@ -217,17 +217,20 @@ static int intel_overlay_do_wait_request(struct intel_overlay *overlay, ...@@ -217,17 +217,20 @@ static int intel_overlay_do_wait_request(struct intel_overlay *overlay,
int ret; int ret;
BUG_ON(overlay->last_flip_req); BUG_ON(overlay->last_flip_req);
ret = i915_add_request(ring, &overlay->last_flip_req); i915_gem_request_assign(&overlay->last_flip_req,
ring->outstanding_lazy_request);
ret = i915_add_request(ring, NULL);
if (ret) if (ret)
return ret; return ret;
overlay->flip_tail = tail; overlay->flip_tail = tail;
ret = i915_wait_seqno(ring, overlay->last_flip_req); ret = i915_wait_seqno(ring,
i915_gem_request_get_seqno(overlay->last_flip_req));
if (ret) if (ret)
return ret; return ret;
i915_gem_retire_requests(dev); i915_gem_retire_requests(dev);
overlay->last_flip_req = 0; i915_gem_request_assign(&overlay->last_flip_req, NULL);
return 0; return 0;
} }
...@@ -286,7 +289,10 @@ static int intel_overlay_continue(struct intel_overlay *overlay, ...@@ -286,7 +289,10 @@ static int intel_overlay_continue(struct intel_overlay *overlay,
intel_ring_emit(ring, flip_addr); intel_ring_emit(ring, flip_addr);
intel_ring_advance(ring); intel_ring_advance(ring);
return i915_add_request(ring, &overlay->last_flip_req); WARN_ON(overlay->last_flip_req);
i915_gem_request_assign(&overlay->last_flip_req,
ring->outstanding_lazy_request);
return i915_add_request(ring, NULL);
} }
static void intel_overlay_release_old_vid_tail(struct intel_overlay *overlay) static void intel_overlay_release_old_vid_tail(struct intel_overlay *overlay)
...@@ -366,10 +372,11 @@ static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay) ...@@ -366,10 +372,11 @@ static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay)
struct intel_engine_cs *ring = &dev_priv->ring[RCS]; struct intel_engine_cs *ring = &dev_priv->ring[RCS];
int ret; int ret;
if (overlay->last_flip_req == 0) if (overlay->last_flip_req == NULL)
return 0; return 0;
ret = i915_wait_seqno(ring, overlay->last_flip_req); ret = i915_wait_seqno(ring,
i915_gem_request_get_seqno(overlay->last_flip_req));
if (ret) if (ret)
return ret; return ret;
i915_gem_retire_requests(dev); i915_gem_retire_requests(dev);
...@@ -377,7 +384,7 @@ static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay) ...@@ -377,7 +384,7 @@ static int intel_overlay_recover_from_interrupt(struct intel_overlay *overlay)
if (overlay->flip_tail) if (overlay->flip_tail)
overlay->flip_tail(overlay); overlay->flip_tail(overlay);
overlay->last_flip_req = 0; i915_gem_request_assign(&overlay->last_flip_req, NULL);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment