aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dsi.c
diff options
context:
space:
mode:
authorJani Nikula <jani.nikula@intel.com>2015-01-16 07:27:19 -0500
committerDaniel Vetter <daniel.vetter@ffwll.ch>2015-01-27 03:51:12 -0500
commit7f6a6a4a19f236ba068a2501f7ee0acc26051cac (patch)
tree5df92a8392dbf0afdb93f9a2c3182730f0b9eeb5 /drivers/gpu/drm/i915/intel_dsi.c
parent3b1808bf56ef613f693ac5a592411ef1717c0065 (diff)
drm/i915/dsi: call wait_for_dsi_fifo_empty() for each dsi port
Add port parameter to wait_for_dsi_fifo_empty, and call it for each dsi port. We can now remove the transitional intel_dsi_pipe_to_port() function. Signed-off-by: Jani Nikula <jani.nikula@intel.com> Reviewed-By: Shobhit Kumar <shobhit.kumar@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dsi.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dsi.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index 94865eb22c93..973222788c41 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -42,13 +42,11 @@ static const struct intel_dsi_device intel_dsi_devices[] = {
42 }, 42 },
43}; 43};
44 44
45static void wait_for_dsi_fifo_empty(struct intel_dsi *intel_dsi) 45static void wait_for_dsi_fifo_empty(struct intel_dsi *intel_dsi, enum port port)
46{ 46{
47 struct drm_encoder *encoder = &intel_dsi->base.base; 47 struct drm_encoder *encoder = &intel_dsi->base.base;
48 struct drm_device *dev = encoder->dev; 48 struct drm_device *dev = encoder->dev;
49 struct drm_i915_private *dev_priv = dev->dev_private; 49 struct drm_i915_private *dev_priv = dev->dev_private;
50 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc);
51 enum port port = intel_dsi_pipe_to_port(intel_crtc->pipe);
52 u32 mask; 50 u32 mask;
53 51
54 mask = LP_CTRL_FIFO_EMPTY | HS_CTRL_FIFO_EMPTY | 52 mask = LP_CTRL_FIFO_EMPTY | HS_CTRL_FIFO_EMPTY |
@@ -230,7 +228,8 @@ static void intel_dsi_enable(struct intel_encoder *encoder)
230 if (intel_dsi->dev.dev_ops->enable) 228 if (intel_dsi->dev.dev_ops->enable)
231 intel_dsi->dev.dev_ops->enable(&intel_dsi->dev); 229 intel_dsi->dev.dev_ops->enable(&intel_dsi->dev);
232 230
233 wait_for_dsi_fifo_empty(intel_dsi); 231 for_each_dsi_port(port, intel_dsi->ports)
232 wait_for_dsi_fifo_empty(intel_dsi, port);
234 233
235 intel_dsi_port_enable(encoder); 234 intel_dsi_port_enable(encoder);
236 } 235 }
@@ -243,6 +242,7 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
243 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base); 242 struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
244 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc); 243 struct intel_crtc *intel_crtc = to_intel_crtc(encoder->base.crtc);
245 enum pipe pipe = intel_crtc->pipe; 244 enum pipe pipe = intel_crtc->pipe;
245 enum port port;
246 u32 tmp; 246 u32 tmp;
247 247
248 DRM_DEBUG_KMS("\n"); 248 DRM_DEBUG_KMS("\n");
@@ -272,7 +272,8 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
272 if (intel_dsi->dev.dev_ops->send_otp_cmds) 272 if (intel_dsi->dev.dev_ops->send_otp_cmds)
273 intel_dsi->dev.dev_ops->send_otp_cmds(&intel_dsi->dev); 273 intel_dsi->dev.dev_ops->send_otp_cmds(&intel_dsi->dev);
274 274
275 wait_for_dsi_fifo_empty(intel_dsi); 275 for_each_dsi_port(port, intel_dsi->ports)
276 wait_for_dsi_fifo_empty(intel_dsi, port);
276 277
277 /* Enable port in pre-enable phase itself because as per hw team 278 /* Enable port in pre-enable phase itself because as per hw team
278 * recommendation, port should be enabled befor plane & pipe */ 279 * recommendation, port should be enabled befor plane & pipe */
@@ -315,7 +316,8 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
315 DRM_DEBUG_KMS("\n"); 316 DRM_DEBUG_KMS("\n");
316 317
317 if (is_vid_mode(intel_dsi)) { 318 if (is_vid_mode(intel_dsi)) {
318 wait_for_dsi_fifo_empty(intel_dsi); 319 for_each_dsi_port(port, intel_dsi->ports)
320 wait_for_dsi_fifo_empty(intel_dsi, port);
319 321
320 intel_dsi_port_disable(encoder); 322 intel_dsi_port_disable(encoder);
321 msleep(2); 323 msleep(2);
@@ -344,7 +346,8 @@ static void intel_dsi_disable(struct intel_encoder *encoder)
344 if (intel_dsi->dev.dev_ops->disable) 346 if (intel_dsi->dev.dev_ops->disable)
345 intel_dsi->dev.dev_ops->disable(&intel_dsi->dev); 347 intel_dsi->dev.dev_ops->disable(&intel_dsi->dev);
346 348
347 wait_for_dsi_fifo_empty(intel_dsi); 349 for_each_dsi_port(port, intel_dsi->ports)
350 wait_for_dsi_fifo_empty(intel_dsi, port);
348} 351}
349 352
350static void intel_dsi_clear_device_ready(struct intel_encoder *encoder) 353static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)