drm/msm/sde: move sde_crtc declarations into sde_crtc header
Clean up the sde_kms header by moving the crtc related function
declarations into the crtc specific header file. Also clean up
some of the unused macros in the sde crtc files.
Change-Id: If377e6acb13c8253781c085100a695b6e86e6329
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 758c571..41178b9 100644
--- a/drivers/gpu/drm/msm/sde/sde_crtc.c
+++ b/drivers/gpu/drm/msm/sde/sde_crtc.c
@@ -26,14 +26,6 @@
#include "sde_crtc.h"
#include "sde_color_processing.h"
-#define CTL(i) (CTL_0 + (i))
-#define LM(i) (LM_0 + (i))
-#define INTF(i) (INTF_0 + (i))
-
-/* uncomment to enable higher level IRQ msg's */
-/*#define DBG_IRQ DBG*/
-#define DBG_IRQ(fmt, ...)
-
/* default input fence timeout, in ms */
#define SDE_CRTC_INPUT_FENCE_TIMEOUT 2000
@@ -350,7 +342,7 @@
struct drm_crtc *crtc = (struct drm_crtc *)data;
drm_crtc_handle_vblank(crtc);
- DBG_IRQ("");
+ DRM_DEBUG_VBL("crtc%d\n", crtc->base.id);
MSM_EVT(crtc->dev, crtc->base.id, 0);
}
diff --git a/drivers/gpu/drm/msm/sde/sde_crtc.h b/drivers/gpu/drm/msm/sde/sde_crtc.h
index 6c583ae..39b7b18 100644
--- a/drivers/gpu/drm/msm/sde/sde_crtc.h
+++ b/drivers/gpu/drm/msm/sde/sde_crtc.h
@@ -19,10 +19,6 @@
#include "sde_kms.h"
#define SDE_CRTC_NAME_SIZE 12
-#define PENDING_FLIP 2
-/* worst case one frame wait time based on 30 FPS : 33.33ms*/
-#define CRTC_MAX_WAIT_ONE_FRAME 34
-#define CRTC_HW_MIXER_MAXSTAGES(c, idx) ((c)->mixer[idx].sblk->maxblendstages)
/**
* struct sde_crtc_mixer: stores the map for each virtual pipeline in the CRTC
@@ -49,7 +45,8 @@
* @num_ctls : Number of ctl paths in use
* @num_mixers : Number of mixers in use
* @mixer : List of active mixers
- * @event : Pointer to last received drm vblank event
+ * @event : Pointer to last received drm vblank event. If there is a
+ * pending vblank event, this will be non-null.
* @pending : Whether or not an update is pending
* @vsync_count : Running count of received vsync events
* @drm_requested_vblank : Whether vblanks have been enabled in the encoder
@@ -70,7 +67,6 @@
u32 num_mixers;
struct sde_crtc_mixer mixers[CRTC_DUAL_MIXERS];
- /*if there is a pending flip, these will be non-null */
struct drm_pending_vblank_event *event;
u32 vsync_count;
@@ -139,4 +135,44 @@
return sde_crtc_mixer_width(sde_crtc, mode);
}
+/**
+ * sde_crtc_vblank - enable or disable vblanks for this crtc
+ * @crtc: Pointer to drm crtc object
+ * @en: true to enable vblanks, false to disable
+ */
+int sde_crtc_vblank(struct drm_crtc *crtc, bool en);
+
+/**
+ * sde_crtc_commit_kickoff - trigger kickoff of the commit for this crtc
+ * @crtc: Pointer to drm crtc object
+ */
+void sde_crtc_commit_kickoff(struct drm_crtc *crtc);
+
+/**
+ * sde_crtc_prepare_fence - callback to prepare for output fences
+ * @crtc: Pointer to drm crtc object
+ */
+void sde_crtc_prepare_fence(struct drm_crtc *crtc);
+
+/**
+ * sde_crtc_init - create a new crtc object
+ * @dev: sde device
+ * @plane: base plane
+ * @Return: new crtc object or error
+ */
+struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane);
+
+/**
+ * sde_crtc_complete_commit - callback signalling completion of current commit
+ * @crtc: Pointer to drm crtc object
+ */
+void sde_crtc_complete_commit(struct drm_crtc *crtc);
+
+/**
+ * sde_crtc_cancel_pending_flip - complete flip for clients on lastclose
+ * @crtc: Pointer to drm crtc object
+ * @file: client to cancel's file handle
+ */
+void sde_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file);
+
#endif /* _SDE_CRTC_H_ */
diff --git a/drivers/gpu/drm/msm/sde/sde_encoder.c b/drivers/gpu/drm/msm/sde/sde_encoder.c
index 414374c..fe863aa 100644
--- a/drivers/gpu/drm/msm/sde/sde_encoder.c
+++ b/drivers/gpu/drm/msm/sde/sde_encoder.c
@@ -41,7 +41,8 @@
#define MAX_PHYS_ENCODERS_PER_VIRTUAL \
(MAX_H_TILES_PER_DISPLAY * NUM_PHYS_ENCODER_TYPES)
-#define WAIT_TIMEOUT_MSEC 100
+/* Wait timeout sized on worst case of 4 60fps frames ~= 67ms */
+#define WAIT_TIMEOUT_MSEC 67
/**
* struct sde_encoder_virt - virtual encoder. Container of one or more physical
diff --git a/drivers/gpu/drm/msm/sde/sde_kms.h b/drivers/gpu/drm/msm/sde/sde_kms.h
index eedb815..eba430b 100644
--- a/drivers/gpu/drm/msm/sde/sde_kms.h
+++ b/drivers/gpu/drm/msm/sde/sde_kms.h
@@ -23,6 +23,7 @@
#include "sde_hw_wb.h"
#include "sde_hw_top.h"
#include "sde_connector.h"
+#include "sde_crtc.h"
#include "sde_rm.h"
#include "sde_power_handle.h"
#include "sde_irq.h"
@@ -417,34 +418,6 @@
uint32_t color, uint32_t alpha);
/**
- * CRTC functions
- */
-int sde_crtc_vblank(struct drm_crtc *crtc, bool en);
-void sde_crtc_commit_kickoff(struct drm_crtc *crtc);
-
-/**
- * sde_crtc_prepare_fence - callback to prepare for output fences
- * @crtc: Pointer to drm crtc object
- */
-void sde_crtc_prepare_fence(struct drm_crtc *crtc);
-
-/**
- * sde_crtc_init - create a new crtc object
- * @dev: sde device
- * @plane: base plane
- * @Return: new crtc object or error
- */
-struct drm_crtc *sde_crtc_init(struct drm_device *dev, struct drm_plane *plane);
-
-/**
- * sde_crtc_complete_commit - callback signalling completion of current commit
- * @crtc: Pointer to drm crtc object
- */
-void sde_crtc_complete_commit(struct drm_crtc *crtc);
-
-void sde_crtc_cancel_pending_flip(struct drm_crtc *crtc, struct drm_file *file);
-
-/**
* sde_encoder_get_hw_resources - Populate table of required hardware resources
* @encoder: encoder pointer
* @hw_res: resource table to populate with encoder required resources