From c342d85d3f3c92794c6eb7a49d6844250d7ce62d Mon Sep 17 00:00:00 2001
From: Timo Aaltonen <tjaalton@debian.org>
Date: Wed, 17 Dec 2014 13:44:52 +0200
Subject: [PATCH 2/2] Revert "drm/atomic: Integrate fence support"

This reverts commit e2330f0719515e41090a4d9685b931888b7c01d6.

Conflicts:
	drivers/gpu/drm/drm_atomic_helper.c
	include/drm/drm_crtc.h
---
 drivers/gpu/drm/drm_atomic_helper.c | 23 -----------------------
 include/drm/drm_crtc.h              |  3 ---
 2 files changed, 26 deletions(-)

--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -30,7 +30,6 @@
 #include <drm/drm_plane_helper.h>
 #include <drm/drm_crtc_helper.h>
 #include <drm/drm_atomic_helper.h>
-#include <linux/fence.h>
 
 /**
  * DOC: overview
@@ -838,25 +837,6 @@ void drm_atomic_helper_commit_modeset_en
 }
 EXPORT_SYMBOL(drm_atomic_helper_commit_modeset_enables);
 
-static void wait_for_fences(struct drm_device *dev,
-			    struct drm_atomic_state *state)
-{
-	struct drm_plane *plane;
-	struct drm_plane_state *plane_state;
-	int i;
-
-	for_each_plane_in_state(state, plane, plane_state, i) {
-		if (!plane->state->fence)
-			continue;
-
-		WARN_ON(!plane->state->fb);
-
-		fence_wait(plane->state->fence, false);
-		fence_put(plane->state->fence);
-		plane->state->fence = NULL;
-	}
-}
-
 static bool framebuffer_changed(struct drm_device *dev,
 				struct drm_atomic_state *old_state,
 				struct drm_crtc *crtc)
@@ -985,8 +965,6 @@ int drm_atomic_helper_commit(struct drm_
 	 * current layout.
 	 */
 
-	wait_for_fences(dev, state);
-
 	drm_atomic_helper_commit_modeset_disables(dev, state);
 
 	drm_atomic_helper_commit_planes(dev, state);
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -43,7 +43,6 @@ struct drm_object_properties;
 struct drm_file;
 struct drm_clip_rect;
 struct device_node;
-struct fence;
 
 #define DRM_MODE_OBJECT_CRTC 0xcccccccc
 #define DRM_MODE_OBJECT_CONNECTOR 0xc0c0c0c0
@@ -752,7 +751,6 @@ struct drm_connector {
  * @plane: backpointer to the plane
  * @crtc: currently bound CRTC, NULL if disabled
  * @fb: currently bound framebuffer
- * @fence: optional fence to wait for before scanning out @fb
  * @crtc_x: left position of visible portion of plane on crtc
  * @crtc_y: upper position of visible portion of plane on crtc
  * @crtc_w: width of visible portion of plane on crtc
@@ -770,7 +768,6 @@ struct drm_plane_state {
 
 	struct drm_crtc *crtc;   /* do not write directly, use drm_atomic_set_crtc_for_plane() */
 	struct drm_framebuffer *fb;  /* do not write directly, use drm_atomic_set_fb_for_plane() */
-	struct fence *fence;
 
 	/* Signed dest location allows it to be partially off screen */
 	int32_t crtc_x, crtc_y;
