Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8365007ybl; Thu, 16 Jan 2020 15:25:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwRPMst4yHzm3SwZjx92NED8UID+9CMo96sveXYKdz4zDE5kwbNrryMNa7Wn8VLVxYNo94I X-Received: by 2002:aca:e106:: with SMTP id y6mr1309661oig.131.1579217126442; Thu, 16 Jan 2020 15:25:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579217126; cv=none; d=google.com; s=arc-20160816; b=KsmAUUM61TW+fxj8j1s/PJurxe0VaEpaJpjEptXbbUP50BgzXiKA2waldSdYWZP9So HOKZSJK62Jhj2uwDCo793pJjiVyLgg0Sli67vafILK0feoGCthQzZ8Cv4tvdttICTo5a aQxQ8KUwSIQ0gT8zmF98HZEjS/PrgSs1SdSWpEuf4AFQNfQNhYIoFmYxI7e0YdsaSWB6 gfNNkQSCJqFB3qeuGBDsIjwrC+BI36WkaSJ+4BYHGFVp9VXndIGpYpB+s4G+5600Q+/z zdIDWgZXDjjsCVdOGIbpljgEZ/NTE8GoCD30DQMutD6aAJ/1YlUrKvhGOofgQf4l/5mG ygTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nFJ6uwOoJtC0MqewmZr1cCXqAoblceejQfDtB1E24lk=; b=m6l5iDj1S1pFjO2S63BpKgig4SUK0LknM+KP1ZAwT4bPpNJL9sTu+raHfmP4mcv1kW RpKK0xukYT9AQWiLEF3s46VHWJIBUwK9FcCkClZ/Jqpt7KxOm6cUVKJoZwaFSDQLQZCV R6n249GTQZyV0pfsQ6L6a4jfIjqeK7AtaCvqAqK9ni2J+g6LR3Psg6Tm9bY1xew0Fjeb wYT1kTm3Dd+J4nXvhlO7KuQCfkuMuuERIpfQxjB39Rk3In2pEdY+2vybvAByQbzcZLRZ JvHFkUDx2piWHHVOjb9TAlNQ6WYbsIPTgbNRWcBwtarQTUr7xeWangP9y3ikq7uZTs9Q 4zAg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Zhwv/exD"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p5si15545573otk.221.2020.01.16.15.25.04; Thu, 16 Jan 2020 15:25:26 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="Zhwv/exD"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388665AbgAPVRD (ORCPT + 99 others); Thu, 16 Jan 2020 16:17:03 -0500 Received: from us-smtp-delivery-1.mimecast.com ([205.139.110.120]:22572 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S2388584AbgAPVRB (ORCPT ); Thu, 16 Jan 2020 16:17:01 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1579209419; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=nFJ6uwOoJtC0MqewmZr1cCXqAoblceejQfDtB1E24lk=; b=Zhwv/exDphH3pmR7FO/yGrR3CZ1W636shsJBD/2Dyi/4wTK7tERe8/VtNbsfFqwR5I1xag b8OSr48oMt5oEqEpd9sY4iHpAEGTYiXOsklTHcZ+lDcQKUf2Y+GgiL8Xbg9YHA2sq+3IFv yj0UA+OzxXsmgEqeJfK5gTLvLOFFnfo= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-322-LFIEQ6_pPeefBuYFJirb_g-1; Thu, 16 Jan 2020 16:16:58 -0500 X-MC-Unique: LFIEQ6_pPeefBuYFJirb_g-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 09E3510054E3; Thu, 16 Jan 2020 21:16:55 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-90.bss.redhat.com [10.20.1.90]) by smtp.corp.redhat.com (Postfix) with ESMTP id EA5F960C84; Thu, 16 Jan 2020 21:16:53 +0000 (UTC) From: Lyude Paul To: intel-gfx@lists.freedesktop.org Cc: dri-devel@lists.freedesktop.org, AceLan Kao , Perry Yuan , Jani Nikula , Joonas Lahtinen , Rodrigo Vivi , David Airlie , Daniel Vetter , linux-kernel@vger.kernel.org Subject: [PATCH v3 5/5] drm/i915: Auto detect DPCD backlight support by default Date: Thu, 16 Jan 2020 16:16:12 -0500 Message-Id: <20200116211623.53799-6-lyude@redhat.com> In-Reply-To: <20200116211623.53799-1-lyude@redhat.com> References: <20200116211623.53799-1-lyude@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Turns out we actually already have some companies, such as Lenovo, shipping machines with AMOLED screens that don't allow controlling the backlight through the usual PWM interface and only allow controlling it through the standard EDP DPCD interface. One example of one of these laptops is the X1 Extreme 2nd Generation. Since we've got systems that need this turned on by default now to have backlight controls working out of the box, let's start auto-detecting it for systems by default based on what the VBT tells us. We do this by changing the default value for the enable_dpcd_backlight module param from 0 to -1. Tested-by: AceLan Kao Tested-by: Perry Yuan Signed-off-by: Lyude Paul Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/i915_params.c | 2 +- drivers/gpu/drm/i915/i915_params.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_params.c b/drivers/gpu/drm/i915/i9= 15_params.c index 64009e99073d..905decc36e53 100644 --- a/drivers/gpu/drm/i915/i915_params.c +++ b/drivers/gpu/drm/i915/i915_params.c @@ -172,7 +172,7 @@ i915_param_named_unsafe(inject_probe_failure, uint, 0= 400, =20 i915_param_named(enable_dpcd_backlight, int, 0600, "Enable support for DPCD backlight control" - "(-1=3Duse per-VBT LFP backlight type setting, 0=3Ddisabled [default], = 1=3Denabled)"); + "(-1=3Duse per-VBT LFP backlight type setting [default], 0=3Ddisabled, = 1=3Denabled)"); =20 #if IS_ENABLED(CONFIG_DRM_I915_GVT) i915_param_named(enable_gvt, bool, 0400, diff --git a/drivers/gpu/drm/i915/i915_params.h b/drivers/gpu/drm/i915/i9= 15_params.h index be6089e4f9e6..947d0a38fa3c 100644 --- a/drivers/gpu/drm/i915/i915_params.h +++ b/drivers/gpu/drm/i915/i915_params.h @@ -66,7 +66,7 @@ struct drm_printer; param(int, reset, 3, 0600) \ param(unsigned int, inject_probe_failure, 0, 0600) \ param(int, fastboot, -1, 0600) \ - param(int, enable_dpcd_backlight, 0, 0600) \ + param(int, enable_dpcd_backlight, -1, 0600) \ param(char *, force_probe, CONFIG_DRM_I915_FORCE_PROBE, 0400) \ param(unsigned long, fake_lmem_start, 0, 0400) \ /* leave bools at the end to not create holes */ \ --=20 2.24.1