From: Shobhit Kumar <shobhit.kumar@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>, intel-gfx@lists.freedesktop.org
Cc: Shobhit Kumar <shobhit.kumar@intel.com>,
Thierry Reding <thierry.reding@gmail.com>
Subject: Re: [RFC PATCH 01/12] drm/i915/dsi: call dpi_send_cmd() for each dsi port at a higher level
Date: Thu, 22 Jan 2015 14:18:05 +0530 [thread overview]
Message-ID: <54C0B945.8040908@linux.intel.com> (raw)
In-Reply-To: <66b6cf76aab2ad59b2edac1152abd09b2026410d.1421410274.git.jani.nikula@intel.com>
On 01/16/2015 05:57 PM, Jani Nikula wrote:
> Instead of having the for each dsi port loop within dpi_send_cmd(), add
> a port parameter to the function and call it for each port instead.
>
> This is a rewrite of
>
> commit 4510cd779e5897eeb8691aecbd639bb62ec27d55
> Author: Gaurav K Singh <gaurav.k.singh@intel.com>
> Date: Thu Dec 4 10:58:51 2014 +0530
>
> drm/i915: Dual link needs Shutdown and Turn on packet for both ports
>
> to add more flexibility in using dpi_send_cmd() for just one port as
> necessary. No functional changes.
>
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Better this way.
Reviewed-By: Shobhit Kumar <shobhit.kumar@intel.com>
> ---
> drivers/gpu/drm/i915/intel_dsi.c | 7 +++++--
> drivers/gpu/drm/i915/intel_dsi_cmd.c | 26 ++++++++++----------------
> drivers/gpu/drm/i915/intel_dsi_cmd.h | 2 +-
> 3 files changed, 16 insertions(+), 19 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
> index 42b6d6f5cecc..36b19c7e87b9 100644
> --- a/drivers/gpu/drm/i915/intel_dsi.c
> +++ b/drivers/gpu/drm/i915/intel_dsi.c
> @@ -207,7 +207,8 @@ static void intel_dsi_enable(struct intel_encoder *encoder)
> I915_WRITE(MIPI_MAX_RETURN_PKT_SIZE(port), 8 * 4);
> else {
> msleep(20); /* XXX */
> - dpi_send_cmd(intel_dsi, TURN_ON, DPI_LP_MODE_EN);
> + for_each_dsi_port(port, intel_dsi->ports)
> + dpi_send_cmd(intel_dsi, TURN_ON, DPI_LP_MODE_EN, port);
> msleep(100);
>
> if (intel_dsi->dev.dev_ops->enable)
> @@ -275,12 +276,14 @@ static void intel_dsi_enable_nop(struct intel_encoder *encoder)
> static void intel_dsi_pre_disable(struct intel_encoder *encoder)
> {
> struct intel_dsi *intel_dsi = enc_to_intel_dsi(&encoder->base);
> + enum port port;
>
> DRM_DEBUG_KMS("\n");
>
> if (is_vid_mode(intel_dsi)) {
> /* Send Shutdown command to the panel in LP mode */
> - dpi_send_cmd(intel_dsi, SHUTDOWN, DPI_LP_MODE_EN);
> + for_each_dsi_port(port, intel_dsi->ports)
> + dpi_send_cmd(intel_dsi, SHUTDOWN, DPI_LP_MODE_EN, port);
> msleep(10);
> }
> }
> diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.c b/drivers/gpu/drm/i915/intel_dsi_cmd.c
> index 562811c1a9d2..5f63c807acea 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_cmd.c
> +++ b/drivers/gpu/drm/i915/intel_dsi_cmd.c
> @@ -380,12 +380,11 @@ int dsi_vc_generic_read(struct intel_dsi *intel_dsi, int channel,
> *
> * XXX: commands with data in MIPI_DPI_DATA?
> */
> -int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs)
> +int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs, enum port port)
> {
> struct drm_encoder *encoder = &intel_dsi->base.base;
> struct drm_device *dev = encoder->dev;
> struct drm_i915_private *dev_priv = dev->dev_private;
> - enum port port;
> u32 mask;
>
> /* XXX: pipe, hs */
> @@ -394,23 +393,18 @@ int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs)
> else
> cmd |= DPI_LP_MODE;
>
> - for_each_dsi_port(port, intel_dsi->ports) {
> - /* clear bit */
> - I915_WRITE(MIPI_INTR_STAT(port), SPL_PKT_SENT_INTERRUPT);
> + /* clear bit */
> + I915_WRITE(MIPI_INTR_STAT(port), SPL_PKT_SENT_INTERRUPT);
>
> - /* XXX: old code skips write if control unchanged */
> - if (cmd == I915_READ(MIPI_DPI_CONTROL(port)))
> - DRM_ERROR("Same special packet %02x twice in a row.\n",
> - cmd);
> + /* XXX: old code skips write if control unchanged */
> + if (cmd == I915_READ(MIPI_DPI_CONTROL(port)))
> + DRM_ERROR("Same special packet %02x twice in a row.\n", cmd);
>
> - I915_WRITE(MIPI_DPI_CONTROL(port), cmd);
> + I915_WRITE(MIPI_DPI_CONTROL(port), cmd);
>
> - mask = SPL_PKT_SENT_INTERRUPT;
> - if (wait_for((I915_READ(MIPI_INTR_STAT(port)) & mask) == mask,
> - 100))
> - DRM_ERROR("Video mode command 0x%08x send failed.\n",
> - cmd);
> - }
> + mask = SPL_PKT_SENT_INTERRUPT;
> + if (wait_for((I915_READ(MIPI_INTR_STAT(port)) & mask) == mask, 100))
> + DRM_ERROR("Video mode command 0x%08x send failed.\n", cmd);
>
> return 0;
> }
> diff --git a/drivers/gpu/drm/i915/intel_dsi_cmd.h b/drivers/gpu/drm/i915/intel_dsi_cmd.h
> index 326a5ac55561..1d1a716e473a 100644
> --- a/drivers/gpu/drm/i915/intel_dsi_cmd.h
> +++ b/drivers/gpu/drm/i915/intel_dsi_cmd.h
> @@ -51,7 +51,7 @@ int dsi_vc_dcs_read(struct intel_dsi *intel_dsi, int channel, u8 dcs_cmd,
> int dsi_vc_generic_read(struct intel_dsi *intel_dsi, int channel,
> u8 *reqdata, int reqlen, u8 *buf, int buflen, enum port port);
>
> -int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs);
> +int dpi_send_cmd(struct intel_dsi *intel_dsi, u32 cmd, bool hs, enum port port);
> void wait_for_dsi_fifo_empty(struct intel_dsi *intel_dsi);
>
> /* XXX: questionable write helpers */
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2015-01-22 8:48 UTC|newest]
Thread overview: 45+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-16 12:27 [RFC PATCH 00/12] drm/i915: port dsi over to drm panel/dsi frameworks Jani Nikula
2015-01-16 12:27 ` [RFC PATCH 01/12] drm/i915/dsi: call dpi_send_cmd() for each dsi port at a higher level Jani Nikula
2015-01-22 8:48 ` Shobhit Kumar [this message]
2015-01-16 12:27 ` [RFC PATCH 02/12] drm/i915/dsi: set max return packet size for each dsi port Jani Nikula
2015-01-22 10:53 ` Shobhit Kumar
2015-01-22 12:57 ` Jani Nikula
2015-01-22 13:01 ` [PATCH v2] " Jani Nikula
2015-01-23 2:07 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 03/12] drm/i915/dsi: move wait_for_dsi_fifo_empty to intel_dsi.c Jani Nikula
2015-01-22 9:01 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 04/12] drm/i915/dsi: call wait_for_dsi_fifo_empty() for each dsi port Jani Nikula
2015-01-22 10:55 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 05/12] drm/i915/dsi: remove unnecessary dsi device callbacks Jani Nikula
2015-01-22 11:23 ` Shobhit Kumar
2015-01-22 13:23 ` Jani Nikula
2015-01-23 9:44 ` Shobhit Kumar
2015-01-23 15:22 ` Daniel Vetter
2015-01-27 8:41 ` Shobhit Kumar
2015-01-27 13:09 ` Daniel Vetter
2015-01-27 13:13 ` Chris Wilson
2015-01-28 5:08 ` Shobhit Kumar
2015-01-28 9:17 ` Daniel Vetter
2015-01-16 12:27 ` [RFC PATCH 06/12] drm/i915/dsi: add some constness to vbt panel driver Jani Nikula
2015-01-22 11:25 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 07/12] drm/i915/dsi: switch to drm_panel interface Jani Nikula
2015-01-23 10:57 ` Shobhit Kumar
2015-01-23 15:31 ` Daniel Vetter
2015-01-27 8:52 ` Shobhit Kumar
2015-01-23 13:30 ` [PATCH v2] " Jani Nikula
2015-01-29 4:52 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 08/12] drm/i915/dsi: add drm mipi dsi host support Jani Nikula
2015-01-23 12:21 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 09/12] drm/i915/dsi: make the vbt panel driver use mipi_dsi_device for transfers Jani Nikula
2015-01-23 12:24 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 10/12] drm/i915/dsi: remove old read/write functions in favor of new stuff Jani Nikula
2015-01-23 12:25 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 11/12] drm/i915/dsi: move dpi_send_cmd() to intel_dsi.c and make it static Jani Nikula
2015-01-23 12:27 ` Shobhit Kumar
2015-01-16 12:27 ` [RFC PATCH 12/12] drm/i915/dsi: remove intel_dsi_cmd.c and the unused functions therein Jani Nikula
2015-01-23 12:28 ` Shobhit Kumar
2015-01-29 16:04 ` Daniel Vetter
2015-01-22 11:46 ` [RFC PATCH 00/12] drm/i915: port dsi over to drm panel/dsi frameworks Shobhit Kumar
2015-01-22 13:28 ` Jani Nikula
2015-01-23 2:13 ` Shobhit Kumar
2015-01-23 12:30 ` 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=54C0B945.8040908@linux.intel.com \
--to=shobhit.kumar@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=shobhit.kumar@intel.com \
--cc=thierry.reding@gmail.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