Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7544205rwi; Mon, 24 Oct 2022 16:31:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4/CxKeHncIOwDdbyVedVEP18MkvBT+cm1nVYOxuTK9SPm7Eh2KZtCq9/xXmxuXQAM4LhLZ X-Received: by 2002:a63:5a0b:0:b0:434:4748:4e7a with SMTP id o11-20020a635a0b000000b0043447484e7amr29810558pgb.561.1666654296096; Mon, 24 Oct 2022 16:31:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666654296; cv=none; d=google.com; s=arc-20160816; b=PSw0vUTLUmXI0pqrHL1m3qVJ5OI3crw5r0arZp+pzfUZfu2BL/3C4+la3q13y1+mIA FoO2NEW7SB2CiW7/ZwICR38KeWCokTTSLJYiJcjY/kCr6/dn3WezfnL8trK/RVY/ALj+ MdtbTV0wZVLTxsiyTO7vP0+Uv6uYAseTSnt99a38dBFuT9riL6cMmq4U8iUnQxrE7xIe YJb7QvQHLoBW/Y2UwHFq+Ktq/AX1ENPapm8yyyL0vbY+l78X6laGE5M4cDIrNA3/0R/Y PVLnHzL7O4jyrsq0AjrIMmPj+dWQkGGjq4CsZgNgq1kXvXIhD5HqALmr+dhhxbw+U+e3 xykg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=6q/xMoeVmga+HpwADG17OmHFg0oiwCuCqYr1QHNmRRc=; b=nlvqS7aupFPeln+EL46xdQ9q7xLXaCDm7fORPdR8zRCwo1OvsW8ZSn5mj4IMZB91zT SkGpkoLMnW4Nj9GU0SIM35Wj5ZbLyYucu2L00vpMBJ8xngt2LJwEYU30d4XMsxn9AMOM 6mO0SP0+2zQRDdhRVDa6kbx+HXjJkeN/WjexbE/itl0nud6Dr7n5p23qxCX+vjdMj063 gDhYfXbDZhBzn0VwYiQA6LBUKwYc0vajc2bamAXZX4RWY9omTvBej46z7AZMrV4FLkyC SdLDP3T/UwpWIUxQSVaOMekZeQpTa15bns+Oa6jo8Yj6flJf5RUnZ/k+3rhZLSiNQQ2R qaLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=BXVKUeC8; 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=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 85-20020a630158000000b0045b96ba46desi981253pgb.792.2022.10.24.16.31.24; Mon, 24 Oct 2022 16:31:36 -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=@redhat.com header.s=mimecast20190719 header.b=BXVKUeC8; 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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231418AbiJXXFO (ORCPT + 99 others); Mon, 24 Oct 2022 19:05:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56588 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231389AbiJXXEy (ORCPT ); Mon, 24 Oct 2022 19:04:54 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43BCEB44AF for ; Mon, 24 Oct 2022 14:26:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1666646701; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=6q/xMoeVmga+HpwADG17OmHFg0oiwCuCqYr1QHNmRRc=; b=BXVKUeC87urDv6wAsWjId0aF0A6g8HJI5paKzXTHwCVC59IGhY09vkjp2EIgPOwVkIZfHf mIiibgkNESMVt8wWert+fgmNzrt8tNZkwnmcCG7xCvnyaduTlfg4LVDkY9QrJmtrHepfrW qfp16T1hAyjwS7nXZq5A44DXq2JOAuQ= Received: from mail-ed1-f70.google.com (mail-ed1-f70.google.com [209.85.208.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-231-xG1g7r9ANciKM84jX_2J9A-1; Mon, 24 Oct 2022 09:46:19 -0400 X-MC-Unique: xG1g7r9ANciKM84jX_2J9A-1 Received: by mail-ed1-f70.google.com with SMTP id y14-20020a056402440e00b0044301c7ccd9so9701388eda.19 for ; Mon, 24 Oct 2022 06:46:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6q/xMoeVmga+HpwADG17OmHFg0oiwCuCqYr1QHNmRRc=; b=HMucqc/Ds26uA2g1cD02jwBdqvpXaL5pAC1Bamw047EXpl7E8Ch8MXoBW/Qs09ZTVj ox2l5bpHn1MTAcjbGKFwtNLAunEcY2l3cHYJEhecPrFUNImZn9OiJLzNYDx0nkyB0d9H ANdIVTmSQy4+CkkXcD7A00czqkmX50OfJ7qHvAkcJC8ttxm5J5Isra1o3zcho2R0LrTo yc49glJJyF0Ks+jmPfQ2PPw600PczaZNDE7LizRU00dN1dXJZRS/+ZQENvx92CE0fh7M cymCThSIAdGqrEQrU1W3HI9DuOuYo5agndpOxJMxWvhmnioaft1UHJRn0/QEpDtZ/up+ Ko2g== X-Gm-Message-State: ACrzQf1MugfJ3xcY1VhN4fF1auhx042uvkgNtJbtL55gXCOYviqhhW4T 6KaVHhrcXyVwgDpC0ssTatE1AqOaFgI73hxlaGdUudQpNDOr5B49FpGBzAlqp7yJnunVG9MOj0L zoGN1WRZ5I7LzIRUyrpHZ+GIh X-Received: by 2002:a17:906:da86:b0:740:7120:c6e6 with SMTP id xh6-20020a170906da8600b007407120c6e6mr27436724ejb.44.1666619178178; Mon, 24 Oct 2022 06:46:18 -0700 (PDT) X-Received: by 2002:a17:906:da86:b0:740:7120:c6e6 with SMTP id xh6-20020a170906da8600b007407120c6e6mr27436705ejb.44.1666619177956; Mon, 24 Oct 2022 06:46:17 -0700 (PDT) Received: from [10.40.98.142] ([78.108.130.194]) by smtp.gmail.com with ESMTPSA id i1-20020a170906250100b0077a11b79b9bsm15523488ejb.133.2022.10.24.06.46.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 06:46:17 -0700 (PDT) Message-ID: <92e9d424-0672-b37e-b8b3-cac431ade7f7@redhat.com> Date: Mon, 24 Oct 2022 15:46:16 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH v1] ACPI: video: Fix missing native backlight on Chromebooks Content-Language: en-US To: Dmitry Osipenko , "Rafael J. Wysocki" , Len Brown , Akihiko Odaki , Dmitry Torokhov , Sean Paul Cc: kernel@collabora.com, linux-acpi@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org References: <20221024133201.43753-1-dmitry.osipenko@collabora.com> From: Hans de Goede In-Reply-To: <20221024133201.43753-1-dmitry.osipenko@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=unavailable 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Fixes: b1d36e73cc1c ("drm/i915: Don't register backlight when another backlight should be used (v2)") > Signed-off-by: Dmitry Osipenko > --- > 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