提交 cc8c4cc2 编写于 作者: J John Harrison 提交者: Daniel Vetter

drm/i915: Convert mmio_flip::seqno to struct request

Converted the mmio_flip 'seqno' value to be a request structure 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 flip code
is still waiting on it.

v2: Used the IRQ friendly request dereference call in the notify handler as that
code is called asynchronously without holding any useful mutex locks.

For: VIZ-4377
Signed-off-by: NJohn Harrison <John.C.Harrison@Intel.com>
Reviewed-by: NThomas Daniel <Thomas.Daniel@intel.com>
[danvet: Drop the _irq variant and use the normal reques unref,
wrapped in dev->struct_mutex per the discussion on the m-l.]
Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 f245860e
...@@ -9612,20 +9612,24 @@ static void intel_do_mmio_flip(struct intel_crtc *intel_crtc) ...@@ -9612,20 +9612,24 @@ static void intel_do_mmio_flip(struct intel_crtc *intel_crtc)
static void intel_mmio_flip_work_func(struct work_struct *work) static void intel_mmio_flip_work_func(struct work_struct *work)
{ {
struct intel_crtc *intel_crtc = struct intel_crtc *crtc =
container_of(work, struct intel_crtc, mmio_flip.work); container_of(work, struct intel_crtc, mmio_flip.work);
struct intel_engine_cs *ring; struct intel_mmio_flip *mmio_flip;
uint32_t seqno;
seqno = intel_crtc->mmio_flip.seqno; mmio_flip = &crtc->mmio_flip;
ring = intel_crtc->mmio_flip.ring; if (mmio_flip->req)
WARN_ON(__i915_wait_seqno(i915_gem_request_get_ring(mmio_flip->req),
if (seqno) i915_gem_request_get_seqno(mmio_flip->req),
WARN_ON(__i915_wait_seqno(ring, seqno, crtc->reset_counter,
intel_crtc->reset_counter,
false, NULL, NULL) != 0); false, NULL, NULL) != 0);
intel_do_mmio_flip(intel_crtc); intel_do_mmio_flip(crtc);
if (mmio_flip->req) {
mutex_lock(&crtc->base.dev->struct_mutex);
i915_gem_request_unreference(mmio_flip->req);
mutex_unlock(&crtc->base.dev->struct_mutex);
}
mmio_flip->req = NULL;
} }
static int intel_queue_mmio_flip(struct drm_device *dev, static int intel_queue_mmio_flip(struct drm_device *dev,
...@@ -9637,9 +9641,8 @@ static int intel_queue_mmio_flip(struct drm_device *dev, ...@@ -9637,9 +9641,8 @@ static int intel_queue_mmio_flip(struct drm_device *dev,
{ {
struct intel_crtc *intel_crtc = to_intel_crtc(crtc); struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
intel_crtc->mmio_flip.seqno = i915_gem_request_assign(&intel_crtc->mmio_flip.req,
i915_gem_request_get_seqno(obj->last_write_req); obj->last_write_req);
intel_crtc->mmio_flip.ring = obj->ring;
schedule_work(&intel_crtc->mmio_flip.work); schedule_work(&intel_crtc->mmio_flip.work);
......
...@@ -406,8 +406,7 @@ struct intel_pipe_wm { ...@@ -406,8 +406,7 @@ struct intel_pipe_wm {
}; };
struct intel_mmio_flip { struct intel_mmio_flip {
u32 seqno; struct drm_i915_gem_request *req;
struct intel_engine_cs *ring;
struct work_struct work; struct work_struct work;
}; };
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册