Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1275489ybl; Tue, 3 Dec 2019 04:42:02 -0800 (PST) X-Google-Smtp-Source: APXvYqwK+9hz6HDuAvMiDcw5A2CDxigGPsV45OdW35peQe+eAr352qOgRwnAEeklZVfqWsDqZBwE X-Received: by 2002:a05:6830:1d7b:: with SMTP id l27mr2727727oti.251.1575376922391; Tue, 03 Dec 2019 04:42:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575376922; cv=none; d=google.com; s=arc-20160816; b=e4G87FNgvCUS6LxuGK+GqLRfyCTchZxazYFp+hnCowv61QVL6puObsNdDXWXMehkY3 +2ER/LRdG07lQV/ktfQP9febPyPGefgKh0J/3Jomr4bYI43edTR6h74gqB6luGOoxs1H AiqUd3Cfs4HzpMb73GfkgSTW34AFBrymHnEOs7GfAucumRmG5Ohtv+xEq1eAmrLEn4ZN cC+Vzck2BpbOagARU3z9Enw7NbnOsFoTPU1lSCFJd4p7I9RisREbKyGTIZvc0dM48ILV lfxCqF5Ak9njsOj45hdQGIc8avWip5uzbkScY3Gs97MXSFwzWc2WaLTPCIukmHFvwzRn r1fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=RpN5KVuuIE3xNtaw4bagGA/gQmKxiCFacP6rkUKbH9Y=; b=nXrrWxmxcoLoTPF81FbUS2W/n1LSwRqlmSV9ryr9fUGvbPNzzva2VHUNbiEAyJb5Nd gawJ1tn1bI9EfSfj64jNsE6WCL8yN/tlaN4YybsPx1CSwJ77ebrHFICoXBvbIsLkXk4q 1SpVbQsG1FR1TAYAUpnwIENhz4DtnGfVcpXtTBM4Dwkr7WtglBc70qxJZn5ljX3F+D3p FibMmTjAE23fqrk/FsxMgt1RirZyt4ymxJ4OSTuCDQGcYgfrhha9WrjhqU3gcd5eUqqo o8sO2RhirsXbURCVD0z8ECq3LN4sToYUJ1Lr+XVaK1Zu9NRQ4W8F0kUYb4KQWhLInSyI NLGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h22si1107171otn.279.2019.12.03.04.41.50; Tue, 03 Dec 2019 04:42:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726189AbfLCMlH (ORCPT + 99 others); Tue, 3 Dec 2019 07:41:07 -0500 Received: from mga03.intel.com ([134.134.136.65]:17530 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725997AbfLCMlH (ORCPT ); Tue, 3 Dec 2019 07:41:07 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2019 04:41:07 -0800 X-IronPort-AV: E=Sophos;i="5.69,273,1571727600"; d="scan'208";a="204962080" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.161]) by orsmga008-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Dec 2019 04:41:03 -0800 From: Jani Nikula To: Lyude Paul , intel-gfx@lists.freedesktop.org Cc: Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Maarten Lankhorst , Lee Shawn C , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/5] drm/i915: Fix DPCD register order in intel_dp_aux_enable_backlight() In-Reply-To: <20191122231616.2574-4-lyude@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20191122231616.2574-1-lyude@redhat.com> <20191122231616.2574-4-lyude@redhat.com> Date: Tue, 03 Dec 2019 14:41:00 +0200 Message-ID: <87r21lintv.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 22 Nov 2019, Lyude Paul wrote: > For eDP panels, it appears it's expected that so long as the panel is in > DPCD control mode that the brightness value is never set to 0. Instead, > if the desired effect is to set the panel's backlight to 0 we're > expected to simply turn off the backlight through the > DP_EDP_DISPLAY_CONTROL_REGISTER. > > We already do the latter correctly in intel_dp_aux_disable_backlight(). > But, we make the mistake of writing the DPCD registers in the wrong > order when enabling the backlight in intel_dp_aux_enable_backlight() > since we currently enable the backlight through > DP_EDP_DISPLAY_CONTROL_REGISTER before writing the brightness level. On > the X1 Extreme 2nd Generation, this appears to have the potential of > confusing the panel in such a way that further attempts to set the > brightness don't actually change the backlight as expected and leave it > off. Presumably, this happens because the incorrect register writing > order briefly leaves the panel with DPCD mode enabled and a 0 brightness > level set. > > So, reverse the order we write the DPCD registers when enabling the > panel backlight so that we write the brightness value first, and enable > the backlight second. This fix appears to be the final bit needed to get > the backlight on the ThinkPad X1 Extreme 2nd Generation's AMOLED screen > working. > > Signed-off-by: Lyude Paul Reviewed-by: Jani Nikula > --- > drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > index 0bf8772bc7bb..87b59db9ffe3 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > @@ -205,8 +205,9 @@ static void intel_dp_aux_enable_backlight(const struct intel_crtc_state *crtc_st > } > } > > + intel_dp_aux_set_backlight(conn_state, > + connector->panel.backlight.level); > set_aux_backlight_enable(intel_dp, true); > - intel_dp_aux_set_backlight(conn_state, connector->panel.backlight.level); > } > > static void intel_dp_aux_disable_backlight(const struct drm_connector_state *old_conn_state) -- Jani Nikula, Intel Open Source Graphics Center