diff mbox

[2/2] drm/i915: Update the DSI ULPS entry/exit sequence

Message ID 1404385541-15075-2-git-send-email-shobhit.kumar@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Kumar, Shobhit July 3, 2014, 11:05 a.m. UTC
We should keep DEVICE_READY bit set in the ULPS enter sequence. In
exit sequence also we should set DEVICE_READY, but thats causing
blankout for me. Also exit sequence is simplified as per hw team
recommendation.

This should fix -
[drm:intel_dsi_clear_device_ready] *ERROR* DSI LP not going Low

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80818
Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c | 29 +++++++++++++++--------------
 1 file changed, 15 insertions(+), 14 deletions(-)

Comments

Chris Wilson July 3, 2014, 2:10 p.m. UTC | #1
On Thu, Jul 03, 2014 at 04:35:41PM +0530, Shobhit Kumar wrote:
> We should keep DEVICE_READY bit set in the ULPS enter sequence. In
> exit sequence also we should set DEVICE_READY, but thats causing
> blankout for me. Also exit sequence is simplified as per hw team
> recommendation.
> 
> This should fix -
> [drm:intel_dsi_clear_device_ready] *ERROR* DSI LP not going Low
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80818
> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>

They silence that warning and appears to still work,
Tested-by: Chris Wilson <chris@chris-wilson.co.uk>
-Chris
Jani Nikula July 4, 2014, 2:26 p.m. UTC | #2
On Thu, 03 Jul 2014, Chris Wilson <chris@chris-wilson.co.uk> wrote:
> On Thu, Jul 03, 2014 at 04:35:41PM +0530, Shobhit Kumar wrote:
>> We should keep DEVICE_READY bit set in the ULPS enter sequence. In
>> exit sequence also we should set DEVICE_READY, but thats causing
>> blankout for me. Also exit sequence is simplified as per hw team
>> recommendation.
>> 
>> This should fix -
>> [drm:intel_dsi_clear_device_ready] *ERROR* DSI LP not going Low
>> 
>> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=80818
>> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
>
> They silence that warning and appears to still work,
> Tested-by: Chris Wilson <chris@chris-wilson.co.uk>

Pushed to -fixes, thanks for the patches and testing.

BR,
Jani.


> -Chris
>
> -- 
> Chris Wilson, Intel Open Source Technology Centre
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index a6a1355..967a5b6 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -117,17 +117,18 @@  static void intel_dsi_device_ready(struct intel_encoder *encoder)
 	/* bandgap reset is needed after everytime we do power gate */
 	band_gap_reset(dev_priv);
 
+	I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER);
+	usleep_range(2500, 3000);
+
 	val = I915_READ(MIPI_PORT_CTRL(pipe));
 	I915_WRITE(MIPI_PORT_CTRL(pipe), val | LP_OUTPUT_HOLD);
 	usleep_range(1000, 1500);
-	I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_EXIT);
-	usleep_range(2000, 2500);
-	I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY);
-	usleep_range(2000, 2500);
-	I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00);
-	usleep_range(2000, 2500);
+
+	I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_EXIT);
+	usleep_range(2500, 3000);
+
 	I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY);
-	usleep_range(2000, 2500);
+	usleep_range(2500, 3000);
 }
 
 static void intel_dsi_enable(struct intel_encoder *encoder)
@@ -271,23 +272,23 @@  static void intel_dsi_clear_device_ready(struct intel_encoder *encoder)
 
 	DRM_DEBUG_KMS("\n");
 
-	I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER);
+	I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_ENTER);
 	usleep_range(2000, 2500);
 
-	I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_EXIT);
+	I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_EXIT);
 	usleep_range(2000, 2500);
 
-	I915_WRITE(MIPI_DEVICE_READY(pipe), ULPS_STATE_ENTER);
+	I915_WRITE(MIPI_DEVICE_READY(pipe), DEVICE_READY | ULPS_STATE_ENTER);
 	usleep_range(2000, 2500);
 
-	val = I915_READ(MIPI_PORT_CTRL(pipe));
-	I915_WRITE(MIPI_PORT_CTRL(pipe), val & ~LP_OUTPUT_HOLD);
-	usleep_range(1000, 1500);
-
 	if (wait_for(((I915_READ(MIPI_PORT_CTRL(pipe)) & AFE_LATCHOUT)
 					== 0x00000), 30))
 		DRM_ERROR("DSI LP not going Low\n");
 
+	val = I915_READ(MIPI_PORT_CTRL(pipe));
+	I915_WRITE(MIPI_PORT_CTRL(pipe), val & ~LP_OUTPUT_HOLD);
+	usleep_range(1000, 1500);
+
 	I915_WRITE(MIPI_DEVICE_READY(pipe), 0x00);
 	usleep_range(2000, 2500);