sys/dev/drm/i915/intel_overlay.c
/* Wait for pending overlay flip and release old frame.
 * Needs to be called before the overlay register are changed
 * via intel_overlay_(un)map_regs
 */
Wait for pending overlay flip and release old frame.
Needs to be called before the overlay register are changed
via intel_overlay_(un)map_regs
Wait for pending overlay flip and release old frame . Needs to be called before the overlay register are changed via intel_overlay_ ( un ) map_regs
static int intel_overlay_release_old_vid(struct intel_overlay *overlay)
{
	struct drm_i915_private *dev_priv = overlay->i915;
	struct intel_engine_cs *engine = &dev_priv->engine[RCS];
	int ret;
	lockdep_assert_held(&dev_priv->dev->struct_mutex);
	if (!overlay->old_vid_bo)
		return 0;
	if (I915_READ(ISR) & I915_OVERLAY_PLANE_FLIP_PENDING_INTERRUPT) {
		struct drm_i915_gem_request *req;
		req = i915_gem_request_alloc(engine, NULL);
		if (IS_ERR(req))
			return PTR_ERR(req);
		ret = intel_ring_begin(req, 2);
		if (ret) {
			i915_add_request_no_flush(req);
			return ret;
		}
		intel_ring_emit(engine,
				MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP);
		intel_ring_emit(engine, MI_NOOP);
		intel_ring_advance(engine);
		ret = intel_overlay_do_wait_request(overlay, req,
						    intel_overlay_release_old_vid_tail);
		if (ret)
			return ret;
	}
	intel_overlay_release_old_vid_tail(overlay);
	i915_gem_track_fb(overlay->old_vid_bo, NULL,
			  INTEL_FRONTBUFFER_OVERLAY(overlay->crtc->pipe));
	return 0;
}
static int intel_overlay_release_old_vid ( struct intel_overlay * overlay ) { struct drm_i915_private * dev_priv = overlay -> i915 ; struct intel_engine_cs * engine = & dev_priv -> engine [ RCS ] ; int ret ; lockdep_assert_held ( & dev_priv -> dev -> struct_mutex ) ; if ( ! overlay -> old_vid_bo ) return 0 ; if ( I915_READ ( ISR ) & I915_OVERLAY_PLANE_FLIP_PENDING_INTERRUPT ) { struct drm_i915_gem_request * req ; req = i915_gem_request_alloc ( engine , NULL ) ; if ( IS_ERR ( req ) ) return PTR_ERR ( req ) ; ret = intel_ring_begin ( req , 2 ) ; if ( ret ) { i915_add_request_no_flush ( req ) ; return ret ; } intel_ring_emit ( engine , MI_WAIT_FOR_EVENT | MI_WAIT_FOR_OVERLAY_FLIP ) ; intel_ring_emit ( engine , MI_NOOP ) ; intel_ring_advance ( engine ) ; ret = intel_overlay_do_wait_request ( overlay , req , intel_overlay_release_old_vid_tail ) ; if ( ret ) return ret ; } intel_overlay_release_old_vid_tail ( overlay ) ; i915_gem_track_fb ( overlay -> old_vid_bo , NULL , INTEL_FRONTBUFFER_OVERLAY ( overlay -> crtc -> pipe ) ) ; return 0 ; }
Wait for pending overlay flip and release old frame.
Wait for pending overlay flip and release old frame .
/* Only wait if there is actually an old frame to release to
	 * guarantee forward progress.
	 */ /* synchronous slowpath */