From patchwork Tue Jul 28 10:01:09 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deepak M X-Patchwork-Id: 6882161 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9784B9F39D for ; Tue, 28 Jul 2015 09:57:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A577E2041C for ; Tue, 28 Jul 2015 09:57:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A9EFF2042B for ; Tue, 28 Jul 2015 09:57:09 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D30372070; Tue, 28 Jul 2015 02:57:09 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 900317206E for ; Tue, 28 Jul 2015 02:57:08 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga102.fm.intel.com with ESMTP; 28 Jul 2015 02:56:49 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,562,1432623600"; d="scan'208";a="614329517" Received: from mdeepakubuntudesk01-desktop.iind.intel.com ([10.223.25.91]) by orsmga003.jf.intel.com with ESMTP; 28 Jul 2015 02:56:47 -0700 From: Deepak M To: intel-gfx@lists.freedesktop.org Date: Tue, 28 Jul 2015 15:31:09 +0530 Message-Id: <1438077670-12953-9-git-send-email-m.deepak@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1438077670-12953-1-git-send-email-m.deepak@intel.com> References: <1438077670-12953-1-git-send-email-m.deepak@intel.com> Cc: Deepak M , Shobhit Kumar Subject: [Intel-gfx] [MIPI SEQ PARSING v1 PATCH 8/9] drm/i915: Add functions to execute the new sequences from VBT X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Gaurav K Singh 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. Signed-off-by: Gaurav K Singh Signed-off-by: Shobhit Kumar Signed-off-by: Deepak M --- drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 84 +++++++++++++++++++++++++++- 1 file changed, 83 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c index 060305d..c6f66e4 100644 --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c @@ -581,7 +581,13 @@ static const char * const seq_name[] = { "MIPI_SEQ_INIT_OTP", "MIPI_SEQ_DISPLAY_ON", "MIPI_SEQ_DISPLAY_OFF", - "MIPI_SEQ_DEASSERT_RESET" + "MIPI_SEQ_DEASSERT_RESET", + "MIPI_SEQ_BACKLIGHT_ON", + "MIPI_SEQ_BACKLIGHT_OFF", + "MIPI_SEQ_TEAR_ON", + "MIPI_SEQ_TEAR_OFF", + "MIPI_SEQ_POWER_ON", + "MIPI_SEQ_POWER_OFF" }; static void generic_exec_sequence(struct intel_dsi *intel_dsi, const u8 *data) @@ -710,12 +716,88 @@ static int vbt_panel_get_modes(struct drm_panel *panel) return 1; } +static int vbt_panel_power_on(struct drm_panel *panel) +{ + struct vbt_panel *vbt_panel = to_vbt_panel(panel); + struct intel_dsi *intel_dsi = vbt_panel->intel_dsi; + struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + const u8 *sequence; + + sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_POWER_ON]; + generic_exec_sequence(intel_dsi, sequence); + + return 0; +} + +static int vbt_panel_power_off(struct drm_panel *panel) +{ + struct vbt_panel *vbt_panel = to_vbt_panel(panel); + struct intel_dsi *intel_dsi = vbt_panel->intel_dsi; + struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + const u8 *sequence; + + sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_POWER_OFF]; + generic_exec_sequence(intel_dsi, sequence); + + return 0; +} + +static int vbt_panel_backlight_on(struct drm_panel *panel) +{ + struct vbt_panel *vbt_panel = to_vbt_panel(panel); + struct intel_dsi *intel_dsi = vbt_panel->intel_dsi; + struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + const u8 *sequence; + + sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_BACKLIGHT_ON]; + generic_exec_sequence(intel_dsi, sequence); + + return 0; +} + +static int vbt_panel_backlight_off(struct drm_panel *panel) +{ + struct vbt_panel *vbt_panel = to_vbt_panel(panel); + struct intel_dsi *intel_dsi = vbt_panel->intel_dsi; + struct drm_device *dev = intel_dsi->base.base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; + const u8 *sequence; + + sequence = dev_priv->vbt.dsi.sequence[MIPI_SEQ_BACKLIGHT_OFF]; + generic_exec_sequence(intel_dsi, sequence); + + return 0; +} + +static int vbt_panel_get_info(struct drm_panel *panel, + struct drm_connector *connector) +{ + struct intel_connector *intel_connector = + to_intel_connector(connector); + + if (intel_connector) { + connector->display_info.width_mm = + intel_connector->panel.fixed_mode->width_mm; + connector->display_info.height_mm = + intel_connector->panel.fixed_mode->height_mm; + } + 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, + .get_info = vbt_panel_get_info, }; struct drm_panel *vbt_panel_init(struct intel_dsi *intel_dsi, u16 panel_id)