Message ID | 20221024133201.43753-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 l7csp584116wru; Mon, 24 Oct 2022 11:05:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7HzDGKrZfCXXX7a6PmzqrEluN8fW4VjWdDsDqrqSh8I1aRZGvJHnTsFRMBqsp1L7lkhIv9 X-Received: by 2002:a05:6402:5202:b0:461:b7e3:e6b7 with SMTP id s2-20020a056402520200b00461b7e3e6b7mr7274037edd.282.1666634741008; Mon, 24 Oct 2022 11:05:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666634741; cv=none; d=google.com; s=arc-20160816; b=KpNAHGAXasQpEzyDHVtljlSGlEGf+Nt39z+VbtSdkmeI/aienAdCzRZRaoc5nAdlC1 CNFh33+HDnxfShGnTuEPY9Q4zP5VSc5uL2uqraV+Fl9+QuYUiLscpu1Od/LBeydVNn6b RTrDkhSM6h/Do8HN3J6ybF6pDxBJgrqgy5TrdTD+lDoi/XNyRz65qNhzY8IY0xW8B7vh jv+LdD9ur+bk0rh1jOHnd9TMYoAdc9Eejd8QlmYRsDBTB2rolrdK3usVc6q+IMaAi3Iw /bk81kD0eik15fU1RrWIu3Cy0T/Zv8Auq/OCAIejIbjuEGzrYanLoL/IyBzuGkL+CpOz u+7A== 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=+IzqDSOU2aJi4aKyvZGyP8u9UM3BXBifIM/ysO9RMHI=; b=UO+DPEcMu2dMRFUeZj/XESBW0yeT9qoy7lMkPGO+blcj2Oex2bKGU2+QiQpeqCWhuo rHO2G6fGR5Uw9y+m//Zi+IhlsZ7ld+Fe+k6PZZXE+hPloTU73QISaWjCynI70Y7W/A6j hNouRSHW8bsKA4bDaA+DGuJIQfXaBur7dIVAP6JS14KV+3zJNViWpktpxhu1puGCiUYP fQH4AzrLoLk3VT7ga0IFwwQCZcQHE40ksREM63BXXccR8M7e0FfBARx2ubWrEwkmbC35 vF5r0ztCDlD4SXLSttm9SOQgOoa5dFKV3n/Ai7iakfujoZuSR1aD4CtzsSEwakftjLgH ZkXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=Gfl5BW51; 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 y6-20020a50eb86000000b004602a1b7da9si365043edr.133.2022.10.24.11.05.16; Mon, 24 Oct 2022 11:05:40 -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=Gfl5BW51; 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 S233417AbiJXRqc (ORCPT <rfc822;pwkd43@gmail.com> + 99 others); Mon, 24 Oct 2022 13:46:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44514 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231410AbiJXRqI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 24 Oct 2022 13:46:08 -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 C91371402B; Mon, 24 Oct 2022 09:21:47 -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 B44C26602392; Mon, 24 Oct 2022 14:32:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1666618362; bh=u87ew5WStQa1OcE49Cx4+qk9li4JUF1ysNYDmcXZvW8=; h=From:To:Cc:Subject:Date:From; b=Gfl5BW51TJWaPipe7us0VY0nkPs169wp2yrEQ6roCLJ9fciK0Cl35mQK2rQEAMIm7 g53nXlsVVwWLTuSjdY4Jxc6Q7tA0VcG1c+3tctEyit+jKgZ8tkbo7ZdQ1DFoMTMk5R nUDnk6LNdv0ZmsXrJFaDs9TC0kgR8h1kHQmxl33GJQqcfY6//V+pk2YKhGVQFaDjWH 85TeW2MQvl6zLyGJltO5TiHMyQV2Ni3cJWrvYBKSWRLH5Vvt5AXE2OxE7lz02IAp9y EyZrzyV4UWmkk7rY17smLOy1DO++qHTd7QgoaT4rapJohI/YIT+4h6WDQDJ2UTJngg W3traQREgX7Rw== 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> Cc: kernel@collabora.com, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH v1] ACPI: video: Fix missing native backlight on Chromebooks Date: Mon, 24 Oct 2022 16:32:01 +0300 Message-Id: <20221024133201.43753-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?1747593190026193133?= |
Series |
[v1] ACPI: video: Fix missing native backlight on Chromebooks
|
|
Commit Message
Dmitry Osipenko
Oct. 24, 2022, 1:32 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: b1d36e73cc1c ("drm/i915: Don't register backlight when another backlight should be used (v2)")
Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
---
drivers/acpi/video_detect.c | 8 ++++++++
1 file changed, 8 insertions(+)
Comments
Hi, On 10/24/22 15:32, 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. Thank you for this patch! > Suggested-by: Hans de Goede <hdegoede@redhat.com> > Fixes: b1d36e73cc1c ("drm/i915: Don't register backlight when another backlight should be used (v2)") > Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> > --- > drivers/acpi/video_detect.c | 8 ++++++++ > 1 file changed, 8 insertions(+) > > diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c > index 0d9064a9804c..8ed5021de6fb 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,9 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) > return acpi_backlight_video; > } > > + if (google_cros_ec_present()) > + return acpi_backlight_native; > + Nice, a couple of remarks: 1. Maybe add a small comment explaining why, like all the other tests in the function have a small comment ? 2. I think it would be better to do: if (google_cros_ec_present() && native_available) return acpi_backlight_native; I can e.g. imagine in the future some chromebooks where for some reason native GPU backlight control is not available using the EC for backlight control and then having the chrome-ec code register a backlight with "vendor" type ? 3. This will also trigger on the Framework laptops and possible other new non Chromebook designs which choose to use the Chrome EC code for their EC, I don't expect these devices to get to this point of __acpi_video_get_backlight_type() (they will hit the earlier acpi_video / native paths) but still I want to at least point this out in case someone sees a potential issue with this? If you can address 1. and 2. from above (or explain why 2. is a bad idea) then I believe that the next version of this can get merged to resolve the chromebook backlight issues introduced in 6.1-rc1, thank you! > /* No ACPI video (old hw), use vendor specific fw methods. */ > return acpi_backlight_vendor; > } Regards, Hans
On 10/24/22 16:46, Hans de Goede wrote: > Hi, > > On 10/24/22 15:32, 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. > > Thank you for this patch! > >> Suggested-by: Hans de Goede <hdegoede@redhat.com> >> Fixes: b1d36e73cc1c ("drm/i915: Don't register backlight when another backlight should be used (v2)") >> Signed-off-by: Dmitry Osipenko <dmitry.osipenko@collabora.com> >> --- >> drivers/acpi/video_detect.c | 8 ++++++++ >> 1 file changed, 8 insertions(+) >> >> diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c >> index 0d9064a9804c..8ed5021de6fb 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,9 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) >> return acpi_backlight_video; >> } >> >> + if (google_cros_ec_present()) >> + return acpi_backlight_native; >> + > > Nice, a couple of remarks: > > 1. Maybe add a small comment explaining why, like all the other tests in the function have a small comment ? > > 2. I think it would be better to do: > > if (google_cros_ec_present() && native_available) > return acpi_backlight_native; > > I can e.g. imagine in the future some chromebooks where for some reason native > GPU backlight control is not available using the EC for backlight control > and then having the chrome-ec code register a backlight with "vendor" type ? > > 3. This will also trigger on the Framework laptops and possible other new > non Chromebook designs which choose to use the Chrome EC code for their EC, > I don't expect these devices to get to this point of __acpi_video_get_backlight_type() > (they will hit the earlier acpi_video / native paths) but still I want to > at least point this out in case someone sees a potential issue with this? > > > If you can address 1. and 2. from above (or explain why 2. is a bad idea) > then I believe that the next version of this can get merged to resolve > the chromebook backlight issues introduced in 6.1-rc1, thank you! I don't have anything against 2., it also works. Thank you for the review!
diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 0d9064a9804c..8ed5021de6fb 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,9 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) return acpi_backlight_video; } + if (google_cros_ec_present()) + return acpi_backlight_native; + /* No ACPI video (old hw), use vendor specific fw methods. */ return acpi_backlight_vendor; }