From patchwork Mon Jan 9 09:16:29 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Srinivas, Vidya" X-Patchwork-Id: 9504241 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 29AE860710 for ; Mon, 9 Jan 2017 09:09:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DD522840E for ; Mon, 9 Jan 2017 09:09:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 12EDE28461; Mon, 9 Jan 2017 09:09:01 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id AD0E52840E for ; Mon, 9 Jan 2017 09:09:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 881DF6E19E; Mon, 9 Jan 2017 09:08:59 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 992616E19E for ; Mon, 9 Jan 2017 09:08:57 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 09 Jan 2017 01:08:56 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.33,339,1477983600"; d="scan'208"; a="1080804604" Received: from vsrini4-ubuntu-intel.iind.intel.com ([10.223.26.91]) by orsmga001.jf.intel.com with ESMTP; 09 Jan 2017 01:08:54 -0800 From: Vidya Srinivas To: intel-gfx@lists.freedesktop.org Date: Mon, 9 Jan 2017 14:46:29 +0530 Message-Id: <1483953389-26662-1-git-send-email-vidya.srinivas@intel.com> X-Mailer: git-send-email 1.9.1 Cc: Vidya Srinivas Subject: [Intel-gfx] [PATCH 14/14] drm/i915: Enable VBT backlight sequences 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-Virus-Scanned: ClamAV using ClamSMTP Enable the support for backlight sequences to configure backlight settings based on VBT Backlight on/off sequence. Signed-off-by: Uma Shankar --- drivers/gpu/drm/i915/intel_dsi.c | 2 ++ drivers/gpu/drm/i915/intel_dsi_panel_vbt.c | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dsi.c b/drivers/gpu/drm/i915/intel_dsi.c index cdcd3188..1f09f40 100644 --- a/drivers/gpu/drm/i915/intel_dsi.c +++ b/drivers/gpu/drm/i915/intel_dsi.c @@ -537,6 +537,7 @@ static void intel_dsi_enable(struct intel_encoder *encoder) } intel_panel_enable_backlight(intel_dsi->attached_connector); + drm_panel_backlight_on(intel_dsi->panel); } static void intel_dsi_prepare(struct intel_encoder *intel_encoder, @@ -619,6 +620,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); /* * Disable Device ready before the port shutdown in order diff --git a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c index 0dc63f5..0693241 100644 --- a/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c +++ b/drivers/gpu/drm/i915/intel_dsi_panel_vbt.c @@ -567,6 +567,20 @@ static int vbt_panel_reset(struct drm_panel *panel) 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, @@ -576,6 +590,8 @@ static int vbt_panel_reset(struct drm_panel *panel) .power_off = vbt_panel_power_off, .enable = vbt_panel_enable, .get_modes = vbt_panel_get_modes, + .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)