[PATCH 54/81] drm/i915: Kill the pending_flip counter manipulations

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>

The pending_flip counter is probably going to be remove entirely,
along with i915_gem_execbuffer_wait_for_flips() so don't even try to
use it.

Signed-off-by: Ville Syrjälä <ville.syrjala@xxxxxxxxxxxxxxx>
---
 drivers/gpu/drm/i915/intel_atomic.c |   74 +----------------------------------
 1 files changed, 2 insertions(+), 72 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c
index 1fce359..ac7fe88 100644
--- a/drivers/gpu/drm/i915/intel_atomic.c
+++ b/drivers/gpu/drm/i915/intel_atomic.c
@@ -1536,45 +1536,9 @@ static void atomic_pipe_commit(struct drm_device *dev,
 			       struct intel_atomic_state *state,
 			       int pipe);
 
-static int apply_nonblocking(struct drm_device *dev, struct intel_atomic_state *s)
+static void apply_nonblocking(struct drm_device *dev, struct intel_atomic_state *s)
 {
 	struct intel_crtc *intel_crtc;
-	int i;
-
-	for (i = 0; i < dev->mode_config.num_crtc; i++) {
-		struct intel_crtc_state *st = &s->crtc[i];
-		struct intel_crtc *intel_crtc = to_intel_crtc(st->crtc);
-		struct drm_i915_gem_object *obj;
-
-		if (!st->old.fb)
-			continue;
-
-		obj = to_intel_framebuffer(st->old.fb)->obj;
-
-		/* Only one bit per plane in pending_flips */
-		if (atomic_read(&obj->pending_flip) & (1 << intel_crtc->plane))
-			return -EBUSY;
-	}
-
-	for (i = 0; i < dev->mode_config.num_plane; i++) {
-		struct intel_plane_state *st = &s->plane[i];
-		struct intel_plane *intel_plane = to_intel_plane(st->plane);
-		struct drm_i915_gem_object *obj;
-
-		if (!st->old.fb)
-			continue;
-
-		obj = to_intel_framebuffer(st->old.fb)->obj;
-
-		if (!st->old.fb)
-			continue;
-
-		obj = to_intel_framebuffer(st->old.fb)->obj;
-
-		/* Only one bit per plane in pending_flips */
-		if (atomic_read(&obj->pending_flip) & (1 << (16 + intel_plane->pipe)))
-			return -EBUSY;
-	}
 
 	list_for_each_entry(intel_crtc, &dev->mode_config.crtc_list, base.head)
 		atomic_pipe_commit(dev, s, intel_crtc->pipe);
@@ -1582,8 +1546,6 @@ static int apply_nonblocking(struct drm_device *dev, struct intel_atomic_state *
 	/* don't restore the old state in end() */
 	s->dirty = false;
 	s->restore_state = false;
-
-	return 0;
 }
 
 static int alloc_flip_data(struct drm_device *dev, struct intel_atomic_state *s)
@@ -1695,12 +1657,7 @@ static int intel_atomic_commit(struct drm_device *dev, void *state)
 
 	/* try to apply in a non blocking manner */
 	if (s->flags & DRM_MODE_ATOMIC_NONBLOCK) {
-		ret = apply_nonblocking(dev, s);
-		if (ret) {
-			unpin_cursors(dev, s);
-			unpin_fbs(dev, s);
-			return ret;
-		}
+		apply_nonblocking(dev, s);
 	} else {
 		/* apply in a blocking manner */
 		ret = apply_config(dev, s);
@@ -1823,7 +1780,6 @@ static void intel_flip_complete(struct drm_flip *flip)
 	struct intel_flip *intel_flip =
 		container_of(flip, struct intel_flip, base);
 	struct drm_device *dev = intel_flip->crtc->dev;
-	struct drm_i915_private *dev_priv = dev->dev_private;
 	struct drm_crtc *crtc = intel_flip->crtc;
 	struct intel_crtc *intel_crtc = to_intel_crtc(crtc);
 	int pipe = intel_crtc->pipe;
@@ -1841,18 +1797,6 @@ static void intel_flip_complete(struct drm_flip *flip)
 
 	if (intel_flip->vblank_ref)
 		drm_vblank_put(dev, pipe);
-
-	/* Possibly allow rendering to old_bo again */
-	if (intel_flip->old_bo) {
-		if (intel_flip->plane) {
-			struct intel_plane *intel_plane = to_intel_plane(intel_flip->plane);
-			atomic_clear_mask(1 << (16 + intel_plane->pipe), &intel_flip->old_bo->pending_flip.counter);
-		} else
-			atomic_clear_mask(1 << intel_crtc->plane, &intel_flip->old_bo->pending_flip.counter);
-
-		if (atomic_read(&intel_flip->old_bo->pending_flip) == 0)
-			wake_up(&dev_priv->pending_flip_queue);
-	}
 }
 
 static void intel_flip_finish(struct drm_flip *flip)
@@ -2193,13 +2137,6 @@ static void atomic_pipe_commit(struct drm_device *dev,
 			mutex_lock(&dev->struct_mutex);
 			drm_gem_object_reference(&intel_flip->old_bo->base);
 			mutex_unlock(&dev->struct_mutex);
-
-			/*
-			 * Block clients from rendering to the new back buffer until
-			 * the flip occurs and the object is no longer visible.
-			 */
-			atomic_set_mask(1 << intel_crtc->plane,
-					&intel_flip->old_bo->pending_flip.counter);
 		}
 
 		list_add_tail(&intel_flip->base.list, &flips);
@@ -2244,13 +2181,6 @@ static void atomic_pipe_commit(struct drm_device *dev,
 			mutex_lock(&dev->struct_mutex);
 			drm_gem_object_reference(&intel_flip->old_bo->base);
 			mutex_unlock(&dev->struct_mutex);
-
-			/*
-			 * Block clients from rendering to the new back buffer until
-			 * the flip occurs and the object is no longer visible.
-			 */
-			atomic_set_mask(1 << (16 + intel_plane->pipe),
-					&intel_flip->old_bo->pending_flip.counter);
 		}
 
 		list_add_tail(&intel_flip->base.list, &flips);
-- 
1.7.8.6

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel



[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux