From patchwork Mon Jun 10 08:40:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Lee, Shawn C" X-Patchwork-Id: 10984233 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB07E13AD for ; Mon, 10 Jun 2019 08:11:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9642A28847 for ; Mon, 10 Jun 2019 08:11:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A4E128849; Mon, 10 Jun 2019 08:11:29 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 157432868C for ; Mon, 10 Jun 2019 08:11:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C031D8910C; Mon, 10 Jun 2019 08:11:27 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8557A8910C for ; Mon, 10 Jun 2019 08:11:26 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 10 Jun 2019 01:11:26 -0700 X-ExtLoop1: 1 Received: from shawnle1-cm6330.itwn.intel.com ([10.5.253.127]) by orsmga007.jf.intel.com with ESMTP; 10 Jun 2019 01:11:21 -0700 From: "Lee, Shawn C" To: intel-gfx@lists.freedesktop.org Date: Mon, 10 Jun 2019 01:40:55 -0700 Message-Id: <1560156055-10451-1-git-send-email-shawn.c.lee@intel.com> X-Mailer: git-send-email 2.7.4 Subject: [Intel-gfx] [PATCH] drm/i915: Backlight control via VESA eDP aux interface X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jani Nikula , Cooper Chiou , Lee@freedesktop.org MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP The latest VBT support backlight control via aux. We have to check VBT's setting before doing backlight initialization. Then Driver will assign correct callback function for eDP backlight control. Cc: Jani Nikula Cc: Jose Roberto de Souza Cc: Cooper Chiou Signed-off-by: Lee, Shawn C --- drivers/gpu/drm/i915/intel_bios.c | 3 ++- drivers/gpu/drm/i915/intel_vbt_defs.h | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_bios.c b/drivers/gpu/drm/i915/intel_bios.c index 1c037dfa83f5..27bda45520ec 100644 --- a/drivers/gpu/drm/i915/intel_bios.c +++ b/drivers/gpu/drm/i915/intel_bios.c @@ -317,7 +317,8 @@ parse_lfp_backlight(struct drm_i915_private *dev_priv, entry = &backlight_data->data[panel_type]; - dev_priv->vbt.backlight.present = entry->type == BDB_BACKLIGHT_TYPE_PWM; + dev_priv->vbt.backlight.present = (entry->type == BDB_BACKLIGHT_TYPE_PWM_SOC || + entry->type == BDB_BACKLIGHT_TYPE_PWM_VESA_EDP_AUX); if (!dev_priv->vbt.backlight.present) { DRM_DEBUG_KMS("PWM backlight not present in VBT (type %u)\n", entry->type); diff --git a/drivers/gpu/drm/i915/intel_vbt_defs.h b/drivers/gpu/drm/i915/intel_vbt_defs.h index 89ef14cafb6b..710f539f17de 100644 --- a/drivers/gpu/drm/i915/intel_vbt_defs.h +++ b/drivers/gpu/drm/i915/intel_vbt_defs.h @@ -760,8 +760,10 @@ struct bdb_lvds_lfp_data { * Block 43 - LFP Backlight Control Data Block */ -#define BDB_BACKLIGHT_TYPE_NONE 0 -#define BDB_BACKLIGHT_TYPE_PWM 2 +#define BDB_BACKLIGHT_TYPE_NONE 0 +#define BDB_BACKLIGHT_TYPE_PWM_SOC 2 +#define BDB_BACKLIGHT_TYPE_PWM_PANEL_DRIVER_OLED 4 +#define BDB_BACKLIGHT_TYPE_PWM_VESA_EDP_AUX 5 struct lfp_backlight_data_entry { u8 type:2;