From patchwork Tue May 23 22:38:01 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Puthikorn Voravootivat X-Patchwork-Id: 9744391 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 0FB5D6032B for ; Tue, 23 May 2017 22:38:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0333528818 for ; Tue, 23 May 2017 22:38:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC39C2885E; Tue, 23 May 2017 22:38:22 +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 AEC9728818 for ; Tue, 23 May 2017 22:38:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 481156E39C; Tue, 23 May 2017 22:38:21 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) by gabe.freedesktop.org (Postfix) with ESMTPS id E1A806E39D for ; Tue, 23 May 2017 22:38:16 +0000 (UTC) Received: by mail-pf0-x233.google.com with SMTP id 9so127550049pfj.1 for ; Tue, 23 May 2017 15:38:16 -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=yr0oM4D09jGEW+23fc0YXNAuACOMHHHo0IymKML9NDE=; b=gjV3XQGnKTNOU6MomUY9AGWdg5s/9py3dOQGit8LTiRZmOxkhxnR+i0Io3iU0+L7b+ Ywhk+I74QB1cN3BNZnUgtfLDztz6B2WEr0OoB1paV9dMSXY+fGd6DGR2gpBttwxeIOSn Jsgjn2ug47nHOPV9pPxmX/Qn0su2mfzxubggmtPpQgLyExdq2PvwCJx9MyvPBqFC2mbQ fMiZWdttQ6DzF1qMBda0HkbSQE7JzPDOAEAUB4YNdH5HNVPDgr3Jv6+h6NAyfErR0SQl kYp4YjEQAcHGw7PNsgdFTuileXf3oJJxfIB9am0s6I4+msY8KLnFF6DSH4sA+CklTFDa uKoA== 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=yr0oM4D09jGEW+23fc0YXNAuACOMHHHo0IymKML9NDE=; b=X/XGmUWUjaoNbyaEeA80qvEcmWL7E3CJ+Tw/LIyL/d1ZHvgLpI0hM0Ewlvr+ndd+Bx jLblstYV1S5RF9FsGaFmhDoWwXkcCC42aoQULkHwIvXCHCnGqNnteb6rOkqUiaYAaVbe ISAmQrm2yfwKM5LMd733kwuXPvjJZdIJ5rqHKzaW0ucTBAmtYAs8dm9zRZII4MXjpjAP P8UGQ/DU+awvHDBLxUzoOhzmTh8S9ynYKGwrnJf94cPD3TQNvHPNiyuw+WzPU+XYgckZ z2zEisROXF2vTYDi+bc3sWwJ6xqXVnMMHTFz1vZdlAVapduYIcHq8CSbhum5B5UaoXel fEew== X-Gm-Message-State: AODbwcBCzpvandq+pOw9aFCWJ8hggFlTvt9lH7eYelAew2grtEBfD+lq AcxLWE9aVkQskK2Z X-Received: by 10.84.218.133 with SMTP id r5mr39873047pli.19.1495579096325; Tue, 23 May 2017 15:38:16 -0700 (PDT) Received: from puthik2.mtv.corp.google.com ([172.22.64.53]) by smtp.gmail.com with ESMTPSA id e64sm3823704pfl.49.2017.05.23.15.38.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 23 May 2017 15:38:15 -0700 (PDT) Received: by puthik2.mtv.corp.google.com (Postfix, from userid 218808) id 7F36311F926; Tue, 23 May 2017 15:38:12 -0700 (PDT) From: Puthikorn Voravootivat To: intel-gfx@lists.freedesktop.org, Dhinakaran Pandiyan , Jani Nikula Date: Tue, 23 May 2017 15:38:01 -0700 Message-Id: <20170523223805.46372-2-puthik@chromium.org> X-Mailer: git-send-email 2.13.0.219.gdb65acc882-goog In-Reply-To: <20170523223805.46372-1-puthik@chromium.org> References: <20170523223805.46372-1-puthik@chromium.org> Cc: Puthikorn Voravootivat , dri-devel@lists.freedesktop.org Subject: [Intel-gfx] [PATCH v9 1/5] 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 Reviewed-by: Jani Nikula --- drivers/gpu/drm/i915/intel_dp_aux_backlight.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/intel_dp_aux_backlight.c index b87c5a381d6a..a0995c00fc84 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", @@ -165,10 +169,8 @@ 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))) { + !(intel_dp->edp_dpcd[2] & DP_EDP_BACKLIGHT_BRIGHTNESS_PWM_PIN_CAP)) { DRM_DEBUG_KMS("AUX Backlight Control Supported!\n"); return true; }