From patchwork Thu May 11 23:02:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9723223 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 E990160236 for ; Thu, 11 May 2017 23:02:45 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1C6028738 for ; Thu, 11 May 2017 23:02:45 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D6CC52873E; Thu, 11 May 2017 23:02:45 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 94C4728738 for ; Thu, 11 May 2017 23:02:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E3E276E5F9; Thu, 11 May 2017 23:02:42 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pg0-x233.google.com (mail-pg0-x233.google.com [IPv6:2607:f8b0:400e:c05::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id E22526E5F7 for ; Thu, 11 May 2017 23:02:39 +0000 (UTC) Received: by mail-pg0-x233.google.com with SMTP id u28so21307734pgn.1 for ; Thu, 11 May 2017 16:02:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=zSjlCM+RaaiDROzNSo/6fTvJ6+D6ue+cUtr1TNrTBTo=; b=ajO3tKhD6b5izgYi8yD7ff00yfT0/yWFuyzHcrXeVcSitRtCq0V4JQpHVhSJTTps+i L0bSrFNu7oqRUSNzN11OpoyarrgZHzaRnB8RIkyXmPAs5JX8CtLhU++O3BnELrddHXwM gaHrUpeVauLHtoW/EOfnvvh9rQVNwXYtjasPCakn5ka5/zwFoI/tHHBoWM1Sxv+GKNjY ZGitdxWUac/VMj0BopCZRSEnlWORVsCOZy9NCn7ORKDR9gnrNCB546Hj62vHS+/RR8Xj 4JR569dLEV9bGmHTiZbq7tQy/E+gJ4l7F/wBPZfTpY6uPvUEdsKh36ErYUOKoVc7MVec 44jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=zSjlCM+RaaiDROzNSo/6fTvJ6+D6ue+cUtr1TNrTBTo=; b=b1Ga7296IXySgy5VW9iipkSJvAgYTXr1uHEH/cIJfQgvqvx9patUGrQjnfUYcMlgMZ +FUlhDadQIKpmofJeZCm8B97rbB5LE4ALPy89D37oPULtTF62B9jRqm8Cr3OWHGVcCAU JX7M4ecqIi0X69ZoxzEBHRjqPBvqaQI6ulM6SFmmZICh40dUqlUY+eOi8Gs9NZSGL1bm VUikGmaSDhYNdJOazmSrILj/jutLyErmfAC4axapiZjBQIGC788rGwSU0hCYKSa3KXdt SnYTMlwjJtPdl+TI8dHRdK7aJzfGtQD0AzTeMgLleA74QC7uviIdX0dzcD86nJ8lA8+L CVYg== X-Gm-Message-State: AODbwcBUaWPfd3ra9LB+4BM0OELb/U1tCQMnQJVckPVuvXjkdXEOOMtS AOw4pu+8uW12gf8Z X-Received: by 10.99.117.26 with SMTP id q26mr983173pgc.21.1494543759349; Thu, 11 May 2017 16:02:39 -0700 (PDT) Received: from puthik2.mtv.corp.google.com ([2620:0:1000:1301:e1bd:1991:2100:b4ef]) by smtp.gmail.com with ESMTPSA id q27sm1848502pfk.4.2017.05.11.16.02.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 May 2017 16:02:38 -0700 (PDT) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id 8650411F8A3; Thu, 11 May 2017 16:02:37 -0700 (PDT) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org, Dhinakaran Pandiyan Date: Thu, 11 May 2017 16:02:19 -0700 Message-Id: <20170511230225.142870-4-puthik@chromium.org> X-Mailer: git-send-email 2.13.0.rc2.291.g57267f2277-goog In-Reply-To: <20170511230225.142870-1-puthik@chromium.org> References: <20170511230225.142870-1-puthik@chromium.org> Cc: Puthikorn Voravootivat , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v7 3/9] drm/i915: Drop AUX backlight enable check for backlight control 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 There are some panel that (1) does not support display backlight enable via AUX (2) support display backlight adjustment via AUX (3) support display backlight enable via eDP BL_ENABLE pin The current driver required that (1) must be support to enable (2). This patch drops that requirement. Signed-off-by: Puthikorn Voravootivat --- drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c index 870c03fc0f3a..c22712762957 100644 --- a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c +++ b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c @@ -28,6 +28,10 @@ static void set_aux_backlight_enable(struct intel_dp *intel_dp, bool enable) { uint8_t reg_val = 0; + /* Early return when display use other mechanism to enable backlight. */ + if (!(intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP)) + return; + if (drm_dp_dpcd_readb(&intel_dp->aux, DP_EDP_DISPLAY_CONTROL_REGISTER, ®_val) < 0) { DRM_DEBUG_KMS("Failed to read DPCD register 0x%x\n", @@ -164,7 +168,6 @@ intel_dp_aux_display_control_capable(struct intel_connector *connector) * the panel can support backlight control over the aux channel */ if (intel_dp->edp_dpcd[1] & DP_EDP_TCON_BACKLIGHT_ADJUSTMENT_CAP && - (intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_AUX_ENABLE_CAP) && (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_AUX_SET_CAP) && !((intel_dp->edp_dpcd[1] & DP_EDP_BACKLIGHT_PIN_ENABLE_CAP) || (intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP))) {