drm/msm/sde: cleanup all the pipes in one-shot during msm_preclose

When drm_fb_release is executed on a file, it iterates over
all the framebuffers and disables the pipes associated with
the fb one-by-one and issues an atomic_commit. This might
cause validation failures in the atomic_check due to hw pipe
interdependencies. To avoid such a case, override the
pre_close function to disable all the pipes associated with
all the fbs in the file and issue one single atomic_commit.

Change-Id: Ida9607317594a42f49b1e1bd30fb3d592bd79ab2
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h
index a5cc6474..9ed4b7e 100644
--- a/drivers/gpu/drm/msm/msm_drv.h
+++ b/drivers/gpu/drm/msm/msm_drv.h
@@ -71,6 +71,8 @@
 #define MAX_BRIDGES    8
 #define MAX_CONNECTORS 8
 
+#define TEARDOWN_DEADLOCK_RETRY_MAX 5
+
 struct msm_file_private {
 	/* currently we don't do anything useful with this.. but when
 	 * per-context address spaces are supported we'd keep track of