dri-devel Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Deepak M <m.deepak@intel.com>
To: dri-devel@lists.freedesktop.org
Cc: Shobhit Kumar <shobhit.kumar@intel.com>,
	Deepak M <m.deepak@intel.com>,
	Jani Nikula <jani.nikula@intel.com>,
	Daniel Vetter <daniel.vetter@intel.com>,
	Gaurav K Singh <gaurav.k.singh@intel.com>
Subject: [PATCH 2/2] drm/i915: Add functions to execute the new sequences from VBT
Date: Mon, 29 Feb 2016 17:15:55 +0530	[thread overview]
Message-ID: <1456746355-31094-2-git-send-email-m.deepak@intel.com> (raw)
In-Reply-To: <1456746355-31094-1-git-send-email-m.deepak@intel.com>

From: Gaurav K Singh <gaurav.k.singh@intel.com>

New sequences are added in the mipi sequence block of the
VBT from version 3 onwards. The sequences are added to
make the code more generic as the panel related info
are placed in the VBT.

Cc: David Airlie <airlied@linux.ie>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
Signed-off-by: Shobhit Kumar <shobhit.kumar@intel.com>
Signed-off-by: Deepak M <m.deepak@intel.com>
---
 drivers/gpu/drm/i915/intel_dsi.c           |  8 ++++++++
 drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 32 ++++++++++++++++++++++++++++++
 2 files changed, 40 insertions(+)

diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c
index b928c50..82f6822 100644
--- a/drivers/gpu/drm/i915/intel_dsi.c
+++ b/drivers/gpu/drm/i915/intel_dsi.c
@@ -461,6 +461,8 @@ static void intel_dsi_enable(struct intel_encoder *encoder)
 		intel_dsi_port_enable(encoder);
 	}
 
+	drm_panel_backlight_on(intel_dsi->panel);
+
 	intel_panel_enable_backlight(intel_dsi->attached_connector);
 }
 
@@ -485,6 +487,8 @@ static void intel_dsi_pre_enable(struct intel_encoder *encoder)
 	if (intel_dsi->gpio_panel)
 		gpiod_set_value_cansleep(intel_dsi->gpio_panel, 1);
 
+	/* Panel Enable */
+	drm_panel_power_on(intel_dsi->panel);
 	msleep(intel_dsi->panel_on_delay);
 
 	if (IS_VALLEYVIEW(dev) || IS_CHERRYVIEW(dev)) {
@@ -537,6 +541,7 @@ static void intel_dsi_pre_disable(struct intel_encoder *encoder)
 	DRM_DEBUG_KMS("\n");
 
 	intel_panel_disable_backlight(intel_dsi->attached_connector);
+	drm_panel_backlight_off(intel_dsi->panel);
 
 	if (is_vid_mode(intel_dsi)) {
 		/* Send Shutdown command to the panel in LP mode */
@@ -651,6 +656,9 @@ static void intel_dsi_post_disable(struct intel_encoder *encoder)
 
 	drm_panel_unprepare(intel_dsi->panel);
 
+	/* Disable Panel */
+	drm_panel_power_off(intel_dsi->panel);
+
 	msleep(intel_dsi->panel_off_delay);
 	msleep(intel_dsi->panel_pwr_cycle_delay);
 
diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
index 787f01c..01a2743 100644
--- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
+++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c
@@ -404,12 +404,44 @@ static int vbt_panel_get_modes(struct drm_panel *panel)
 	return 1;
 }
 
+static int vbt_panel_power_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_ON);
+
+	return 0;
+}
+
+static int vbt_panel_power_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_POWER_OFF);
+
+	return 0;
+}
+
+static int vbt_panel_backlight_on(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_BACKLIGHT_ON);
+
+	return 0;
+}
+
+static int vbt_panel_backlight_off(struct drm_panel *panel)
+{
+	generic_exec_sequence(panel, MIPI_SEQ_BACKLIGHT_OFF);
+
+	return 0;
+}
+
 static const struct drm_panel_funcs vbt_panel_funcs = {
 	.disable = vbt_panel_disable,
 	.unprepare = vbt_panel_unprepare,
 	.prepare = vbt_panel_prepare,
 	.enable = vbt_panel_enable,
 	.get_modes = vbt_panel_get_modes,
+	.power_on = vbt_panel_power_on,
+	.power_off = vbt_panel_power_off,
+	.backlight_on = vbt_panel_backlight_on,
+	.backlight_off = vbt_panel_backlight_off,
 };
 
 struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  reply	other threads:[~2016-02-29 11:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-29 11:45 [PATCH 1/2] drm: Add few more wrapper functions for drm panel Deepak M
2016-02-29 11:45 ` Deepak M [this message]
2016-02-29 12:12 ` Jani Nikula
2016-03-02 12:58   ` Deepak M
2016-03-02 15:25     ` Thierry Reding

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=1456746355-31094-2-git-send-email-m.deepak@intel.com \
    --to=m.deepak@intel.com \
    --cc=daniel.vetter@intel.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=gaurav.k.singh@intel.com \
    --cc=jani.nikula@intel.com \
    --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