Message ID | 20221024141210.67784-1-dmitry.osipenko@collabora.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp569452wru; Mon, 24 Oct 2022 10:28:26 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4UdzHI/Xyzp9UsJS+RnPN0nwDEijlYjTdJDf6Imh0fd34dppMC9qnFDrVeO4vn/EHoQqil X-Received: by 2002:a17:90a:6045:b0:212:fe9a:5792 with SMTP id h5-20020a17090a604500b00212fe9a5792mr9608067pjm.178.1666632506065; Mon, 24 Oct 2022 10:28:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666632506; cv=none; d=google.com; s=arc-20160816; b=Gk1viMiNL26n8NAhTfin3tO5NZmDPExg0bVJhlLpJtb0GY0btfbHVDzQshGmYZXw2Q HoeVgsWT/Fqq1v8eNPZmKHK1apB5UlW8XKlYGo97CS/bNZNC9FHP6+5I/52lLaImx3FB DB7+qRa1v2CFefKogq4KKjFmuF1Ws8tdIj+q/X5vCWivDHDa6Gvrk+yZZdCxmCuJBpbz I9mx7MXrGCZLjPgRk8+cJgOmrcqcmmrI+lx5hV9QL/aDaj+ExHWSrvHu3MenlB6Ul+ZP DXKLudJHOSVsvuc2f2a5t2bK+wgtqN3UJmbR/goHwVaZorgLS5yPzh9Dhyflkn+d7qX9 4OYg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=iPaHlUhJDubT83upCP//b4X4/sgCrtrM/PF2UuonlQ8=; b=ziVF62iaMnjJd/LizUwTjWdgdOKbOgQz6dOoYzOATYmN8+u6XPlFVfiEZG+phuioZf HJngeyW8phoMz7jv3dCoLvc1vch85QwL6irX90JtREYzpd57zgdyhLx86g6Y9OXner+r MAPnGj62/SdyOOXnvlPz+wu8QCmlPHTF0+kLxxMXPY62A+hQV+SvVZ23E5tqfeZG7h3R e/7JjTLPEr5PazrB6XqQBCuprf78IL7uSuU7DZYtzL5LtN7pWy0uxVkruEQhXLk4W60Y 8R1a59MFbM1SOYTTmIg9PE9ZVb4ccG4kLwOyEJdR5UEPQnTzzGUPL7GAc2pQqfHmEr7N 7gXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BX4v4wwl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc7-20020a170902930700b001867ea919bdsi94686plb.25.2022.10.24.10.28.12; Mon, 24 Oct 2022 10:28:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=BX4v4wwl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232477AbiJXRQ2 (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Mon, 24 Oct 2022 13:16:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46546 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230483AbiJXRPr (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Oct 2022 13:15:47 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0D311057D7; Mon, 24 Oct 2022 08:51:00 -0700 (PDT) Received: from dimapc.. (109-252-112-196.nat.spd-mgts.ru [109.252.112.196]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: dmitry.osipenko) by madras.collabora.co.uk (Postfix) with ESMTPSA id 9D3136602390; Mon, 24 Oct 2022 15:12:24 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666620745; bh=Q+4AswO00Nv3cSoxhgG3pbKKgBU8khIrJ9IPMDqjLhM=; h=From:To:Cc:Subject:Date:From; b=BX4v4wwl71EG6cAbPY4kIPmUD5EAK8yw3SwFizvk8menDgKGNFbUp+LWQSgVm1do/ CjR3LkdhpvTKq+QsndmvG6LMybi5UhroTz7ClD8VD7QbiWJBuC3cgb/Y9sZeeMRi1I jAVX9uLRP3GYZtvjxj/lnXUkbdIALmeDbAsvPX5zvSl9uaFKhbAXm6QgUXT56bm/XV iDtys/1MHprPhKIOddRRqBK6gMEL7d37ugQHFYlhfkEn0qw1hRWm/g4X+S81BD40Tq Sh/roxAT4B4mAOImsoGYXUWwP6mam4OiBVe+VGa/oTd6u/nBK1yQUozURtHaDYWj/7 XBKRWjZswx00g== From: Dmitry Osipenko <dmitry.osipenko@collabora.com> To: "Rafael J. Wysocki" <rafael@kernel.org>, Len Brown <lenb@kernel.org>, Hans de Goede <hdegoede@redhat.com>, Akihiko Odaki <akihiko.odaki@daynix.com>, Dmitry Torokhov <dmitry.torokhov@gmail.com>, Sean Paul <seanpaul@chromium.org> Cc: kernel@collabora.com, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] ACPI: video: Fix missing native backlight on Chromebooks Date: Mon, 24 Oct 2022 17:12:10 +0300 Message-Id: <20221024141210.67784-1-dmitry.osipenko@collabora.com> X-Mailer: git-send-email 2.37.3 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747587762876285681?= X-GMAIL-MSGID: =?utf-8?q?1747590846568319185?= |
Series |
[v2] ACPI: video: Fix missing native backlight on Chromebooks
|
|
Commit Message
Dmitry Osipenko
Oct. 24, 2022, 2:12 p.m. UTC
Chromebooks don't have backlight in ACPI table, they suppose to use
native backlight in this case. Check presence of the CrOS embedded
controller ACPI device and prefer the native backlight if EC found.
Suggested-by: Hans de Goede <hdegoede@redhat.com>
Fixes: 2600bfa3df99 ("ACPI: video: Add acpi_video_backlight_use_native() helper")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
Changelog:
v2: - Added explanatory comment to the code and added check for the
native backlight presence, like was requested by Hans de Goede.
drivers/acpi/video_detect.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
Comments
On Mon, Oct 24, 2022 at 4:32 PM Hans de Goede <hdegoede@redhat.com> wrote: > > Hi, > > On 10/24/22 16:12, Dmitry Osipenko wrote: > > Chromebooks don't have backlight in ACPI table, they suppose to use > > native backlight in this case. Check presence of the CrOS embedded > > controller ACPI device and prefer the native backlight if EC found. > > > > Suggested-by: Hans de Goede <hdegoede@redhat.com> > > Fixes: 2600bfa3df99 ("ACPI: video: Add acpi_video_backlight_use_native() helper") > > Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> > > --- > > > > Changelog: > > > > v2: - Added explanatory comment to the code and added check for the > > native backlight presence, like was requested by Hans de Goede. > > Thanks this version looks good to me: > > Reviewed-by: Hans de Goede <hdegoede@redhat.com> > > Rafael, can you pick this up and send it in a fixes pull-req > for 6.1 to Linus? Or shall I pick this one up and include it > in my next pull-req? It would be better if you could pick this up IMV, so please free to add Acled-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> to it. Thanks! > > > > drivers/acpi/video_detect.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c > > index 0d9064a9804c..9cd8797d12bb 100644 > > --- a/drivers/acpi/video_detect.c > > +++ b/drivers/acpi/video_detect.c > > @@ -668,6 +668,11 @@ static const struct dmi_system_id video_detect_dmi_table[] = { > > { }, > > }; > > > > +static bool google_cros_ec_present(void) > > +{ > > + return acpi_dev_found("GOOG0004"); > > +} > > + > > /* > > * Determine which type of backlight interface to use on this system, > > * First check cmdline, then dmi quirks, then do autodetect. > > @@ -730,6 +735,13 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) > > return acpi_backlight_video; > > } > > > > + /* > > + * Chromebooks that don't have backlight handle in ACPI table > > + * are supposed to use native backlight if it's available. > > + */ > > + if (google_cros_ec_present() && native_available) > > + return acpi_backlight_native; > > + > > /* No ACPI video (old hw), use vendor specific fw methods. */ > > return acpi_backlight_vendor; > > } >
Hi, On 10/24/22 16:52, Akihiko Odaki wrote: > On 2022/10/24 23:12, Dmitry Osipenko wrote: >> Chromebooks don't have backlight in ACPI table, they suppose to use >> native backlight in this case. Check presence of the CrOS embedded >> controller ACPI device and prefer the native backlight if EC found. >> >> Suggested-by: Hans de Goede <hdegoede@redhat.com> >> Fixes: 2600bfa3df99 ("ACPI: video: Add acpi_video_backlight_use_native() helper") >> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> >> --- >> >> Changelog: >> >> v2: - Added explanatory comment to the code and added check for the >> native backlight presence, like was requested by Hans de Goede. >> >> drivers/acpi/video_detect.c | 12 ++++++++++++ >> 1 file changed, 12 insertions(+) >> >> diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c >> index 0d9064a9804c..9cd8797d12bb 100644 >> --- a/drivers/acpi/video_detect.c >> +++ b/drivers/acpi/video_detect.c >> @@ -668,6 +668,11 @@ static const struct dmi_system_id video_detect_dmi_table[] = { >> { }, >> }; >> +static bool google_cros_ec_present(void) >> +{ >> + return acpi_dev_found("GOOG0004"); >> +} >> + >> /* >> * Determine which type of backlight interface to use on this system, >> * First check cmdline, then dmi quirks, then do autodetect. >> @@ -730,6 +735,13 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) >> return acpi_backlight_video; >> } >> + /* >> + * Chromebooks that don't have backlight handle in ACPI table >> + * are supposed to use native backlight if it's available. >> + */ >> + if (google_cros_ec_present() && native_available) >> + return acpi_backlight_native; >> + >> /* No ACPI video (old hw), use vendor specific fw methods. */ >> return acpi_backlight_vendor; >> } > > Hi, > > The native_available check does not prevent duplicate registration if vendor backlight registers first. It was enough for the combination of ACPI video and native because ACPI video delays its registration, but it is not the case for vendor/native combination. There are no drivers providing acpi_backlight_vendor functionality on chromebooks. All the drivers providing acpi_backlight_vendor functionality use vendor (Dell, Acer, Asus, etc.) specific firmware (smbios, EC bitbanging or ACPI) backlight control method which are not available on CoreBoot based ChromeBooks. Also notice that the theoretical problem of a vendor driver loading first was already present before the backlight refactor which landed in 6.1 and this has never been an issue. Regards, Hans
Hi, On 10/24/22 16:45, Rafael J. Wysocki wrote: > On Mon, Oct 24, 2022 at 4:32 PM Hans de Goede <hdegoede@redhat.com> wrote: >> >> Hi, >> >> On 10/24/22 16:12, Dmitry Osipenko wrote: >>> Chromebooks don't have backlight in ACPI table, they suppose to use >>> native backlight in this case. Check presence of the CrOS embedded >>> controller ACPI device and prefer the native backlight if EC found. >>> >>> Suggested-by: Hans de Goede <hdegoede@redhat.com> >>> Fixes: 2600bfa3df99 ("ACPI: video: Add acpi_video_backlight_use_native() helper") >>> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> >>> --- >>> >>> Changelog: >>> >>> v2: - Added explanatory comment to the code and added check for the >>> native backlight presence, like was requested by Hans de Goede. >> >> Thanks this version looks good to me: >> >> Reviewed-by: Hans de Goede <hdegoede@redhat.com> >> >> Rafael, can you pick this up and send it in a fixes pull-req >> for 6.1 to Linus? Or shall I pick this one up and include it >> in my next pull-req? > > It would be better if you could pick this up IMV, so please free to add > > Acled-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Ok, I've merged this now and I'll send out fixes pull-req with this to Linus before coming Friday. Dmitry, Thank you for your patch, I've applied this patch to my fixes branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=fixes Regards, Hans > > to it. > > Thanks! > >>> >>> drivers/acpi/video_detect.c | 12 ++++++++++++ >>> 1 file changed, 12 insertions(+) >>> >>> diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c >>> index 0d9064a9804c..9cd8797d12bb 100644 >>> --- a/drivers/acpi/video_detect.c >>> +++ b/drivers/acpi/video_detect.c >>> @@ -668,6 +668,11 @@ static const struct dmi_system_id video_detect_dmi_table[] = { >>> { }, >>> }; >>> >>> +static bool google_cros_ec_present(void) >>> +{ >>> + return acpi_dev_found("GOOG0004"); >>> +} >>> + >>> /* >>> * Determine which type of backlight interface to use on this system, >>> * First check cmdline, then dmi quirks, then do autodetect. >>> @@ -730,6 +735,13 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) >>> return acpi_backlight_video; >>> } >>> >>> + /* >>> + * Chromebooks that don't have backlight handle in ACPI table >>> + * are supposed to use native backlight if it's available. >>> + */ >>> + if (google_cros_ec_present() && native_available) >>> + return acpi_backlight_native; >>> + >>> /* No ACPI video (old hw), use vendor specific fw methods. */ >>> return acpi_backlight_vendor; >>> } >> >
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 0d9064a9804c..9cd8797d12bb 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -668,6 +668,11 @@ static const struct dmi_system_id video_detect_dmi_table[] = { { }, }; +static bool google_cros_ec_present(void) +{ + return acpi_dev_found("GOOG0004"); +} + /* * Determine which type of backlight interface to use on this system, * First check cmdline, then dmi quirks, then do autodetect. @@ -730,6 +735,13 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) return acpi_backlight_video; } + /* + * Chromebooks that don't have backlight handle in ACPI table + * are supposed to use native backlight if it's available. + */ + if (google_cros_ec_present() && native_available) + return acpi_backlight_native; + /* No ACPI video (old hw), use vendor specific fw methods. */ return acpi_backlight_vendor; }