drm/msm/sde: update crtc to use sde debug macros

Need to move the sde crtc to use the local sde specific debug
and error logging macros. The local sde macros allow the logs
to be enabled both from the normal drm_debug and Linux dynamic
debug interfaces. Also move the function naming to be
consistent.

Change-Id: Ib171ebab3959d6ac522cd6885ac8a55ba4f35e0e
Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
diff --git a/drivers/gpu/drm/msm/sde/sde_crtc.c b/drivers/gpu/drm/msm/sde/sde_crtc.c
index a893ae4..30ed9f1 100644
--- a/drivers/gpu/drm/msm/sde/sde_crtc.c
+++ b/drivers/gpu/drm/msm/sde/sde_crtc.c
@@ -40,7 +40,7 @@
 #define LEFT_MIXER 0
 #define RIGHT_MIXER 1
 
-static struct sde_kms *get_kms(struct drm_crtc *crtc)
+static inline struct sde_kms *_sde_crtc_get_kms(struct drm_crtc *crtc)
 {
 	struct msm_drm_private *priv = crtc->dev->dev_private;
 
@@ -51,7 +51,7 @@
 {
 	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	if (!crtc)
 		return;
@@ -69,14 +69,12 @@
 		const struct drm_display_mode *mode,
 		struct drm_display_mode *adjusted_mode)
 {
-	DBG("");
+	SDE_DEBUG("\n");
 
-	if (msm_is_mode_seamless(adjusted_mode)) {
-		SDE_DEBUG("seamless mode set requested\n");
-		if (!crtc->enabled || crtc->state->active_changed) {
-			SDE_ERROR("crtc state prevents seamless transition\n");
-			return false;
-		}
+	if (msm_is_mode_seamless(adjusted_mode) &&
+		(!crtc->enabled || crtc->state->active_changed)) {
+		SDE_ERROR("crtc state prevents seamless transition\n");
+		return false;
 	}
 
 	return true;
@@ -308,7 +306,8 @@
 }
 
 /* if file!=NULL, this is preclose potential cancel-flip path */
-static void complete_flip(struct drm_crtc *crtc, struct drm_file *file)
+static void _sde_crtc_complete_flip(struct drm_crtc *crtc,
+		struct drm_file *file)
 {
 	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
 	struct drm_device *dev = crtc->dev;
@@ -324,8 +323,9 @@
 		 */
 		if (!file || (event->base.file_priv == file)) {
 			sde_crtc->event = NULL;
-			SDE_DEBUG("%s: send event: %pK\n",
+			DRM_DEBUG_VBL("%s: send event: %pK\n",
 						sde_crtc->name, event);
+			MSM_EVT(crtc->dev, crtc->base.id, 0);
 			drm_crtc_send_vblank_event(crtc, event);
 		}
 	}
@@ -377,7 +377,7 @@
 	uint32_t wait_ms = 1;
 	ktime_t kt_end, kt_wait;
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	if (!crtc || !crtc->state) {
 		SDE_ERROR("invalid crtc/state %pK\n", crtc);
@@ -415,7 +415,7 @@
 		struct drm_encoder *enc)
 {
 	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
-	struct sde_kms *sde_kms = get_kms(crtc);
+	struct sde_kms *sde_kms = _sde_crtc_get_kms(crtc);
 	struct sde_rm *rm = &sde_kms->rm;
 	struct sde_crtc_mixer *mixer;
 	struct sde_hw_ctl *last_valid_ctl = NULL;
@@ -490,7 +490,7 @@
 	unsigned long flags;
 	u32 i;
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	if (!crtc) {
 		SDE_ERROR("invalid crtc\n");
@@ -552,7 +552,7 @@
 		return;
 	}
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	sde_crtc = to_sde_crtc(crtc);
 
@@ -607,7 +607,7 @@
 	sde_crtc = to_sde_crtc(crtc);
 	cstate = to_sde_crtc_state(state);
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	__drm_atomic_helper_crtc_destroy_state(crtc, state);
 
@@ -717,12 +717,12 @@
 	struct sde_crtc *sde_crtc;
 
 	if (!crtc) {
-		DRM_ERROR("invalid crtc\n");
+		SDE_ERROR("invalid crtc\n");
 		return;
 	}
 	sde_crtc = to_sde_crtc(crtc);
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	memset(sde_crtc->mixers, 0, sizeof(sde_crtc->mixers));
 	sde_crtc->num_mixers = 0;
@@ -742,7 +742,7 @@
 		return;
 	}
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	sde_crtc = to_sde_crtc(crtc);
 	mixer = sde_crtc->mixers;
@@ -928,7 +928,7 @@
 	struct sde_crtc *sde_crtc = to_sde_crtc(crtc);
 
 	SDE_DEBUG("%s: cancel: %p", sde_crtc->name, file);
-	complete_flip(crtc, file);
+	_sde_crtc_complete_flip(crtc, file);
 }
 
 /**
@@ -940,7 +940,7 @@
 	struct sde_crtc *sde_crtc;
 	struct drm_device *dev;
 
-	DBG("");
+	SDE_DEBUG("\n");
 
 	if (!crtc) {
 		SDE_ERROR("invalid crtc\n");
@@ -1014,7 +1014,7 @@
 static int sde_crtc_set_property(struct drm_crtc *crtc,
 		struct drm_property *property, uint64_t val)
 {
-	DBG("");
+	SDE_DEBUG("\n");
 
 	return sde_crtc_atomic_set_property(crtc, crtc->state, property, val);
 }