aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorShobhit Kumar <shobhit.kumar@intel.com>2014-07-12 07:47:22 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-07 05:07:15 -0400
commit1381308bb1e24fd7906eab3f046654041546cce3 (patch)
treebd680e5e3aae203da885562f46b8b634d337acf8
parent57007df74a547c68b3373861aa15efb861af6efc (diff)
drm/i915: wait for all DSI FIFOs to be empty
Ensure that the DSI packets for a particular sequence are completely sent before going ahead in the enabling or disabling of the panel Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c8
-rw-r--r--drivers/gpu/drm/i915/intel_dsi_cmd.c16
-rw-r--r--drivers/gpu/drm/i915/intel_dsi_cmd.h1
3 files changed, 25 insertions, 0 deletions
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index bfcefbf33709..09e1cafe3e87 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -152,6 +152,8 @@ static void intel_dsi_enable(struct intel_encoder *encoder)
152 if (intel_dsi->dev.dev_ops->enable) 152 if (intel_dsi->dev.dev_ops->enable)
153 intel_dsi->dev.dev_ops->enable(&intel_dsi->dev); 153 intel_dsi->dev.dev_ops->enable(&intel_dsi->dev);
154 154
155 wait_for_dsi_fifo_empty(intel_dsi);
156
155 /* assert ip_tg_enable signal */ 157 /* assert ip_tg_enable signal */
156 temp = I915_READ(MIPI_PORT_CTRL(pipe)) & ~LANE_CONFIGURATION_MASK; 158 temp = I915_READ(MIPI_PORT_CTRL(pipe)) & ~LANE_CONFIGURATION_MASK;
157 temp = temp | intel_dsi->port_bits; 159 temp = temp | intel_dsi->port_bits;
@@ -192,6 +194,8 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
192 if (intel_dsi->dev.dev_ops->send_otp_cmds) 194 if (intel_dsi->dev.dev_ops->send_otp_cmds)
193 intel_dsi->dev.dev_ops->send_otp_cmds(&intel_dsi->dev); 195 intel_dsi->dev.dev_ops->send_otp_cmds(&intel_dsi->dev);
194 196
197 wait_for_dsi_fifo_empty(intel_dsi);
198
195 /* Enable port in pre-enable phase itself because as per hw team 199 /* Enable port in pre-enable phase itself because as per hw team
196 * recommendation, port should be enabled befor plane & pipe */ 200 * recommendation, port should be enabled befor plane & pipe */
197 intel_dsi_enable(encoder); 201 intel_dsi_enable(encoder);
@@ -232,6 +236,8 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
232 DRM_DEBUG_KMS("\n"); 236 DRM_DEBUG_KMS("\n");
233 237
234 if (is_vid_mode(intel_dsi)) { 238 if (is_vid_mode(intel_dsi)) {
239 wait_for_dsi_fifo_empty(intel_dsi);
240
235 /* de-assert ip_tg_enable signal */ 241 /* de-assert ip_tg_enable signal */
236 temp = I915_READ(MIPI_PORT_CTRL(pipe)); 242 temp = I915_READ(MIPI_PORT_CTRL(pipe));
237 I915_WRITE(MIPI_PORT_CTRL(pipe), temp & ~DPI_ENABLE); 243 I915_WRITE(MIPI_PORT_CTRL(pipe), temp & ~DPI_ENABLE);
@@ -261,6 +267,8 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
261 * some next enable sequence send turn on packet error is observed */ 267 * some next enable sequence send turn on packet error is observed */
262 if (intel_dsi->dev.dev_ops->disable) 268 if (intel_dsi->dev.dev_ops->disable)
263 intel_dsi->dev.dev_ops->disable(&intel_dsi->dev); 269 intel_dsi->dev.dev_ops->disable(&intel_dsi->dev);
270
271 wait_for_dsi_fifo_empty(intel_dsi);
264} 272}
265 273
266static void intel_dsi_clear_device_ready(struct intel_encoder *encoder) 274static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)
diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.c b/drivers/gpu/drm/i915/intel_dsi_cmd.c
index 933c86305237..7f1430ac8543 100644
--- a/drivers/gpu/drm/i915/intel_dsi_cmd.c
+++ b/drivers/gpu/drm/i915/intel_dsi_cmd.c
@@ -419,3 +419,19 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs)
419 419
420 return 0; 420 return 0;
421} 421}
422
423void wait_for_dsi_fifo_empty(struct intel_dsi *intel_dsi)
424{
425 struct drm_encoder *encoder = &intel_dsi->base.base;
426 struct drm_device *dev = encoder->dev;
427 struct drm_i915_private *dev_priv = dev->dev_private;
428 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
429 enum pipe pipe = intel_crtc->pipe;
430 u32 mask;
431
432 mask = LP_CTRL_FIFO_EMPTY | HS_CTRL_FIFO_EMPTY |
433 LP_DATA_FIFO_EMPTY | HS_DATA_FIFO_EMPTY;
434
435 if (wait_for((I915_READ(MIPI_GEN_FIFO_STAT(pipe)) & mask) == mask, 100))
436 DRM_ERROR("DPI FIFOs are not empty\n");
437}
diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.h b/drivers/gpu/drm/i915/intel_dsi_cmd.h
index 9a18cbfa5460..46aa1acc00eb 100644
--- a/drivers/gpu/drm/i915/intel_dsi_cmd.h
+++ b/drivers/gpu/drm/i915/intel_dsi_cmd.h
@@ -51,6 +51,7 @@ int dsi_vc_generic_read(struct intel_dsi *intel_dsi, int channel,
51 u8 *reqdata, int reqlen, u8 *buf, int buflen); 51 u8 *reqdata, int reqlen, u8 *buf, int buflen);
52 52
53int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs); 53int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs);
54void wait_for_dsi_fifo_empty(struct intel_dsi *intel_dsi);
54 55
55/* XXX: questionable write helpers */ 56/* XXX: questionable write helpers */
56static inline int dsi_vc_dcs_write_0(struct intel_dsi *intel_dsi, 57static inline int dsi_vc_dcs_write_0(struct intel_dsi *intel_dsi,