From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jani Nikula Subject: Re: [PATCH 5/9] drm/i915: SHUTDOWN & Turn ON packets to be sent for both MIPI Ports in case of dual link Configuration Date: Wed, 24 Sep 2014 12:32:24 +0300 Message-ID: <87a95pmkif.fsf@intel.com> References: <1411548418-26525-1-git-send-email-gaurav.k.singh@intel.com> <1411548418-26525-6-git-send-email-gaurav.k.singh@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id AD9F26E012 for ; Wed, 24 Sep 2014 02:32:26 -0700 (PDT) In-Reply-To: <1411548418-26525-6-git-send-email-gaurav.k.singh@intel.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" To: Gaurav K Singh , intel-gfx Cc: Shobhit Kumar List-Id: intel-gfx@lists.freedesktop.org On Wed, 24 Sep 2014, Gaurav K Singh wrote: > Signed-off-by: Gaurav K Singh > Signed-off-by: Shobhit Kumar > --- > drivers/gpu/drm/i915/intel_dsi_cmd.c | 35 ++++++++++++++++++++++------------ > 1 file changed, 23 insertions(+), 12 deletions(-) > > diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.c b/drivers/gpu/drm/i915/intel_dsi_cmd.c > index eb698b1..a70656e 100644 > --- a/drivers/gpu/drm/i915/intel_dsi_cmd.c > +++ b/drivers/gpu/drm/i915/intel_dsi_cmd.c > @@ -394,6 +394,7 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs) > struct intel_crtc *intel_crtc = to_intel_crtc(encoder->crtc); > enum pipe pipe = intel_crtc->pipe; > u32 mask; > + int count = 1; > > /* XXX: pipe, hs */ > if (hs) > @@ -401,18 +402,28 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs) > else > cmd |= DPI_LP_MODE; > > - /* clear bit */ > - I915_WRITE(MIPI_INTR_STAT(pipe), SPL_PKT_SENT_INTERRUPT); > - > - /* XXX: old code skips write if control unchanged */ > - if (cmd == I915_READ(MIPI_DPI_CONTROL(pipe))) > - DRM_ERROR("Same special packet %02x twice in a row.\n", cmd); > - > - I915_WRITE(MIPI_DPI_CONTROL(pipe), cmd); > - > - mask = SPL_PKT_SENT_INTERRUPT; > - if (wait_for((I915_READ(MIPI_INTR_STAT(pipe)) & mask) == mask, 100)) > - DRM_ERROR("Video mode command 0x%08x send failed.\n", cmd); > + if (intel_dsi->dual_link) > + count = 2; > + > + do { Please never use a do-while when a regular for loop will do. > + /* clear bit */ > + I915_WRITE(MIPI_INTR_STAT(pipe), SPL_PKT_SENT_INTERRUPT); > + > + /* XXX: old code skips write if control unchanged */ > + if (cmd == I915_READ(MIPI_DPI_CONTROL(pipe))) > + DRM_ERROR("Same special packet %02x twice in a row.\n", > + cmd); > + I915_WRITE(MIPI_DPI_CONTROL(pipe), cmd); > + > + mask = SPL_PKT_SENT_INTERRUPT; > + if (wait_for((I915_READ(MIPI_INTR_STAT(pipe)) & mask) == > + mask, 100)) > + DRM_ERROR("Video mode command 0x%08x send failed.\n", > + cmd); > + /* For Port C for dual link */ > + if (intel_dsi->dual_link) > + pipe = PIPE_B; > + } while (--count > 0); > > return 0; > } > -- > 1.7.9.5 > > _______________________________________________ > Intel-gfx mailing list > Intel-gfx@lists.freedesktop.org > http://lists.freedesktop.org/mailman/listinfo/intel-gfx -- Jani Nikula, Intel Open Source Technology Center