Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8930692ybl; Fri, 17 Jan 2020 03:37:28 -0800 (PST) X-Google-Smtp-Source: APXvYqy0nRDgMn0sFvvBc0SSS0C6g2fjFJ44pOzglZjPJ51/V4DibHg3/tBhTDnyBCphT1oR7QnU X-Received: by 2002:a05:6830:10a:: with SMTP id i10mr5494777otp.365.1579261048702; Fri, 17 Jan 2020 03:37:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579261048; cv=none; d=google.com; s=arc-20160816; b=r5jwMzM2kny4HaXWGgbTad0Hjcue1ey8sKWhmJnbnusL8tJMZvWEfvJnIuMjIx3VWZ lYJs8TNp0tg3K2zF9H4rX/TLQOt+6tdwnYW4fHmjwl/zrXOiwY2LTzImLhCTMdnzwk+6 Ia4eLPY7zol7Eu04C8LtaQzseDFPs5lZ7XW7PFs18kugig1WPPkjqM6c8pNeXawFc0Jz EhzVi8zWkF7E4L30gtWWYdD2XIZ1fRY/6bxvuSD5jLSWj1jtNAvH7+S0H/B3FwadoAIM o5eeoqoVbhg/TOZ0WKAKUKx/CsI8+UuruVkBkpjoeZY73hPEReWDbVQWem6vxQKbHhtN Vpqg== 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=iObD5F2p16MEmgb+gR+chk6BQ1UbKhFC0dRBiBEkoFk=; b=NALXx8zxtEFzn3Pk60qKM1KuvbR4Qs0R4xuWHDM0ZqLb2hsR3YQSOdaclps3GtEgYk 1ahYL2DIvFqGIMyMmTmwniPV2zQYy1UzkJXdjvhDpWw7vvA0KoqNiFrDzx1fFaEAZP9+ EaQxurkxle5Oz2KxVsJ5TEfQAm9NPtmFH1ctg1p+nfV4Lz+G/r9mh+5lh04ORwjIDTmO SowPyv28CFAKbHOt2VcJ2C3Myc5SfIkEIxOahVx3g3TCMao2ZFR+NQ5IYC9uDwnTv/C9 EabQflbyCxRR27ep7L+gSrbskOLCc77NKD9qvhND1w3oA56j/0ZPf6zKR0T+2bRxVkj1 4XtQ== 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 u12si14781552otq.51.2020.01.17.03.37.16; Fri, 17 Jan 2020 03:37:28 -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 S1726951AbgAQLgV (ORCPT + 99 others); Fri, 17 Jan 2020 06:36:21 -0500 Received: from mga01.intel.com ([192.55.52.88]:59269 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726785AbgAQLgV (ORCPT ); Fri, 17 Jan 2020 06:36:21 -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 fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 17 Jan 2020 03:36:20 -0800 X-IronPort-AV: E=Sophos;i="5.70,330,1574150400"; d="scan'208";a="218881938" 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; 17 Jan 2020 03:36:15 -0800 From: Jani Nikula To: Lyude Paul , intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, Perry Yuan , AceLan Kao , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , Chris Wilson , Ville =?utf-8?B?U3lyasOkbMOk?= , Juha-Pekka Heikkila , Lee Shawn C , linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 4/5] drm/i915: Don't use VBT for detecting DPCD backlight controls In-Reply-To: <20200116211623.53799-5-lyude@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20200116211623.53799-1-lyude@redhat.com> <20200116211623.53799-5-lyude@redhat.com> Date: Fri, 17 Jan 2020 13:36:12 +0200 Message-ID: <87zhemgvrn.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 Thu, 16 Jan 2020, Lyude Paul wrote: > Despite the fact that the VBT appears to have a field for specifying > that a system is equipped with a panel that supports standard VESA > backlight controls over the DP AUX channel, so far every system we've > spotted DPCD backlight control support on doesn't actually set this > field correctly and all have it set to INTEL_BACKLIGHT_DISPLAY_DDI. > > While we don't know the exact reason for this VBT misuse, talking with > some vendors indicated that there's a good number of laptop panels out > there that supposedly support both PWM backlight controls and DPCD > backlight controls as a workaround until Intel supports DPCD backlight > controls across platforms universally. This being said, the X1 Extreme > 2nd Gen that I have here (note that Lenovo is not the hardware vendor > that informed us of this) PWM backlight controls are advertised, but > only DPCD controls actually function. I'm going to make an educated > guess here and say that on systems like this one, it's likely that PWM > backlight controls might have been intended to work but were never > really tested by QA. > > Since we really need backlights to work without any extra module > parameters, let's take the risk here and rely on the standard DPCD caps > to tell us whether AUX backlight controls are supported or not. We still > check the VBT, but only to make sure that we don't enable DPCD backlight > controls on a panel that uses something other then the standard VESA > interfaces over AUX. Since panels using such non-standard interfaces > should probably have support added to i915, we'll print a warning when > seeing this in the VBT. We can remove this warning later if we end up > adding support for any custom backlight interfaces. > > Signed-off-by: Lyude Paul > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=112376 > Cc: Jani Nikula > Cc: Perry Yuan > Cc: AceLan Kao > --- > .../drm/i915/display/intel_dp_aux_backlight.c | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > > 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 77a759361c5c..3002b600635f 100644 > --- a/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > +++ b/drivers/gpu/drm/i915/display/intel_dp_aux_backlight.c > @@ -330,13 +330,17 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *intel_connector) > struct intel_panel *panel = &intel_connector->panel; > struct drm_i915_private *dev_priv = to_i915(intel_connector->base.dev); > > - if (i915_modparams.enable_dpcd_backlight == 0 || > - (i915_modparams.enable_dpcd_backlight == -1 && > - dev_priv->vbt.backlight.type != INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE)) > - return -ENODEV; > - > - if (!intel_dp_aux_display_control_capable(intel_connector)) > + if (i915_modparams.enable_dpcd_backlight == 0) > return -ENODEV; > + if (i915_modparams.enable_dpcd_backlight == -1) { > + if (dev_priv->vbt.backlight.type > + == INTEL_BACKLIGHT_PANEL_DRIVER_INTERFACE) { > + DRM_WARN("VBT says panel uses custom panel driver interface, not using DPCD backlight controls\n"); > + return -ENODEV; > + } > + if (!intel_dp_aux_display_control_capable(intel_connector)) > + return -ENODEV; Functionally, I'm fine with trying this. But perhaps we should check aux and early return first, and then check what vbt says, to reduce the dmesg noise. I'll probably want to see a debug message if we're enabling aux backlight even if dev_priv->vbt.backlight.type != INTEL_BACKLIGHT_VESA_EDP_AUX_INTERFACE. It's the kind of debug trace you'll really want to get first. BR, Jani. > + } > > panel->backlight.setup = intel_dp_aux_setup_backlight; > panel->backlight.enable = intel_dp_aux_enable_backlight; -- Jani Nikula, Intel Open Source Graphics Center