public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@linux.intel.com>
To: Gaurav K Singh <gaurav.k.singh@intel.com>,
	intel-gfx <intel-gfx@lists.freedesktop.org>
Cc: Shobhit Kumar <shobhit.kumar@intel.com>
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	[thread overview]
Message-ID: <87a95pmkif.fsf@intel.com> (raw)
In-Reply-To: <1411548418-26525-6-git-send-email-gaurav.k.singh@intel.com>

On Wed, 24 Sep 2014, Gaurav K Singh <gaurav.k.singh@intel.com> wrote:
> Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
> Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
> ---
>  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

  reply	other threads:[~2014-09-24  9:32 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-24  8:46 [PATCH 0/9] BYT DSI Dual Link Support Gaurav K Singh
2014-09-24  8:46 ` [PATCH 1/9] drm/i915: New functions added for enabling & disabling MIPI Port Ctrl reg Gaurav K Singh
2014-09-24  8:46 ` [PATCH 2/9] drm/i915: MIPI Sequence to be sent to the DSI Controller based on the port no from VBT Gaurav K Singh
2014-09-24  8:46 ` [PATCH 3/9] drm/i915: MIPI Port Ctrl related changes for dual link configuration Gaurav K Singh
2014-09-24  9:27   ` Jani Nikula
2014-10-21  6:30     ` Singh, Gaurav K
2014-10-21 12:12       ` Daniel Vetter
2014-10-21 13:19         ` Jani Nikula
2014-09-24  8:46 ` [PATCH 4/9] drm/i915: Pixel Clock and pixel overlap related changes for dual link Configuration Gaurav K Singh
2014-09-24  9:23   ` Jani Nikula
2014-09-24  8:46 ` [PATCH 5/9] drm/i915: SHUTDOWN & Turn ON packets to be sent for both MIPI Ports in case of " Gaurav K Singh
2014-09-24  9:32   ` Jani Nikula [this message]
2014-09-25 12:54     ` Shobhit Kumar
2014-09-25 13:39       ` Jani Nikula
2014-09-25 14:22         ` Shobhit Kumar
2014-09-24  8:46 ` [PATCH 6/9] drm/i915: Dsipll clk to be enabled for DSI1 in case of dual link configuration Gaurav K Singh
2014-09-24  9:34   ` Jani Nikula
2014-09-24  8:46 ` [PATCH 7/9] drm/i915: MIPI Timings related changes for dual link Configuration Gaurav K Singh
2014-09-24  8:46 ` [PATCH 8/9] drm/i915: MIPI encoder disable " Gaurav K Singh
2014-09-24  8:46 ` [PATCH 9/9] drm/i915: MIPI Encoder enable related changes for dual link configuration Gaurav K Singh
2014-09-24  9:01 ` [PATCH 0/9] BYT DSI Dual Link Support Daniel Vetter
2014-09-25 12:47   ` Shobhit Kumar

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87a95pmkif.fsf@intel.com \
    --to=jani.nikula@linux.intel.com \
    --cc=gaurav.k.singh@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=shobhit.kumar@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox