From patchwork Tue May 9 23:40:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9719029 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 3F9266035D for ; Tue, 9 May 2017 23:41:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3147128458 for ; Tue, 9 May 2017 23:41:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 264F22847D; Tue, 9 May 2017 23:41:12 +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 D191228458 for ; Tue, 9 May 2017 23:41:11 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5D00F6E1DA; Tue, 9 May 2017 23:41:11 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pf0-x232.google.com (mail-pf0-x232.google.com [IPv6:2607:f8b0:400e:c00::232]) by gabe.freedesktop.org (Postfix) with ESMTPS id 975D789DC1 for ; Tue, 9 May 2017 23:41:03 +0000 (UTC) Received: by mail-pf0-x232.google.com with SMTP id v14so7162937pfd.2 for ; Tue, 09 May 2017 16:41:03 -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=S+Y77QPkfAHocXR49FRo0ynHegPnAJ29Gl+quIGOXDFfMWoMqMcLNoioOOci0n7mc5 uVt+0ZqI0Pvg9kBlfS2pDsGZ5HSsECzSTYH8qXyIdxoEx7vjFEDt8R+sxBKGohSUDlFS SdbGCCykYcKACwznYkFTglg9tVRDxCd3GWL4o+92Ny99jhg7ZhNKzT8dRYJ7G0sFv3X0 99SiyHFJQXYwe1wziun3+E1+kL4K6tqZXKZzsuv+24etilG+Vm5QlSsonbSKsiGFgFm1 d71gEsE4whGDky6dFTx2MXpQITxq/6l4BwiHPMhjcDWamu0+PweTK+p9tPghxampu7YK boRQ== 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=W5YWTMeHIPjfvACpleFB+Nzgo+DkUjC+Oai3PqEw0ZiG8Ue7+T62hp+0hOlnhnBp6A CdXiXsyXs+KNJ/isW6hIk5K2vt/HTYBJ+AWQkLM1+2dGELX06L8asR1HK4ashQ57tMxd qF9wxooPVDtszWXRI9yvhMlftukl1Ug/THJvu/Y9ZuHibHXv4E8wOBta/pb7051BR4PF Q4z1QOtg9TDtCOTZLA9I1RTSRUIL1G5469vBN31FNdZgEUUCa1tixgyHiq3nkOsA6IAZ meQZwDCSoaooGT0q+6M+aPmgN/AJcJzKzEGk6cnKOX68SgSYgiFLnAQLS/ismt4Dq4Ro ck/A== X-Gm-Message-State: AODbwcDZBfAASWU1at4lClHKSgBfP1iBRcEkbtk3aig9REcNkxedODJz /xqmLkjpyb37g90a X-Received: by 10.99.172.84 with SMTP id z20mr3144277pgn.12.1494373263008; Tue, 09 May 2017 16:41:03 -0700 (PDT) Received: from puthik2.mtv.corp.google.com ([172.22.64.53]) by smtp.gmail.com with ESMTPSA id y190sm1699218pgd.25.2017.05.09.16.41.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 09 May 2017 16:41:01 -0700 (PDT) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id F185E11F91F; Tue, 9 May 2017 16:40:59 -0700 (PDT) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org, Dhinakaran Pandiyan Date: Tue, 9 May 2017 16:40:46 -0700 Message-Id: <20170509234052.189575-4-puthik@chromium.org> X-Mailer: git-send-email 2.13.0.rc2.291.g57267f2277-goog In-Reply-To: <20170509234052.189575-1-puthik@chromium.org> References: <20170509234052.189575-1-puthik@chromium.org> Cc: Puthikorn Voravootivat , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v6 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))) {