From patchwork Mon Nov 14 14:44:53 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 624871 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F23C3C4332F for ; Mon, 14 Nov 2022 14:46:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230520AbiKNOqi (ORCPT ); Mon, 14 Nov 2022 09:46:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50248 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235697AbiKNOqf (ORCPT ); Mon, 14 Nov 2022 09:46:35 -0500 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 B9E5FA1A1 for ; Mon, 14 Nov 2022 06:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668437110; 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=RTMQzN6tVBQDJG2lWc9zMg8QJWAHWlE00U7jOaw5n1s=; b=geouQ7jv17cpw5QrSkmpQ6K3bL5vekTGhz4FZgKI2H9cgTGKZIZqgFZaL2cfZCtn2Hw9EX DApPmjJFrlx951nEpocLGucDShtEtATLtX/k4XUqM0gHij6YpZsXUTYUGbP1OHoXCabG6I O+rNQmbneH/BCssseBijNb4FHT/8LJc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-483-yBluBb-iOlaVnvw0JwKAnA-1; Mon, 14 Nov 2022 09:45:07 -0500 X-MC-Unique: yBluBb-iOlaVnvw0JwKAnA-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 23360800B23; Mon, 14 Nov 2022 14:45:07 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id C241C1415102; Mon, 14 Nov 2022 14:45:05 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , Len Brown , Matthew Garrett , linux-acpi@vger.kernel.org Subject: [PATCH 1/7] ACPI: video: Add a few bugtracker links to DMI quirks Date: Mon, 14 Nov 2022 15:44:53 +0100 Message-Id: <20221114144459.455519-2-hdegoede@redhat.com> In-Reply-To: <20221114144459.455519-1-hdegoede@redhat.com> References: <20221114144459.455519-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Add a couple of missing bugtracker links to DMI quirks Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index b2a616287638..bb8052fc3fee 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -166,6 +166,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { }, }, { + /* https://bugs.launchpad.net/bugs/1000146 */ .callback = video_detect_force_vendor, /* Asus X101CH */ .matches = { @@ -190,6 +191,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { }, }, { + /* https://bugs.launchpad.net/bugs/1000146 */ .callback = video_detect_force_vendor, /* Asus 1015CX */ .matches = { @@ -233,6 +235,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { }, }, { + /* https://bugzilla.kernel.org/show_bug.cgi?id=202401 */ .callback = video_detect_force_vendor, /* Sony VPCEH3U1E */ .matches = { @@ -400,8 +403,8 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "530U4E/540U4E"), }, }, - /* https://bugs.launchpad.net/bugs/1894667 */ { + /* https://bugs.launchpad.net/bugs/1894667 */ .callback = video_detect_force_video, /* HP 635 Notebook */ .matches = { From patchwork Mon Nov 14 14:44:54 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 624869 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F70AC4332F for ; Mon, 14 Nov 2022 14:46:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236302AbiKNOqq (ORCPT ); Mon, 14 Nov 2022 09:46:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50304 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235905AbiKNOqk (ORCPT ); Mon, 14 Nov 2022 09:46:40 -0500 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 7BF59BE37 for ; Mon, 14 Nov 2022 06:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668437112; 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=4r1SO73JXNiY1yhNk5QogmxIUjJ6QS53qM9eFo1IoOo=; b=hGP0N3CwaoHMHGwk2U6j5TVJxHwuBuOIBTw2SJchE2XDPaV4OpzCRRqpmltWsEQZY1OlKp oR7V3tjZRmXAkGm6ZyltwtMu/tD+waP2kfA0XcPSPNPlKlT81DrrfmCyzw1o/LGeEbROvU 8EzgFesRCnDVC0kqyD2KoaU4p8XigIc= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-549-DUQQT_5-PUif3L3TCW67Xg-1; Mon, 14 Nov 2022 09:45:09 -0500 X-MC-Unique: DUQQT_5-PUif3L3TCW67Xg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A765287B2A0; Mon, 14 Nov 2022 14:45:08 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 72EF01415102; Mon, 14 Nov 2022 14:45:07 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , Len Brown , Matthew Garrett , linux-acpi@vger.kernel.org, "Jasper St . Pierre" Subject: [PATCH 2/7] ACPI: video: Change GIGABYTE GB-BXBT-2807 quirk to force_none Date: Mon, 14 Nov 2022 15:44:54 +0100 Message-Id: <20221114144459.455519-3-hdegoede@redhat.com> In-Reply-To: <20221114144459.455519-1-hdegoede@redhat.com> References: <20221114144459.455519-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The GIGABYTE GB-BXBT-2807 DMI quirk was added by commit 25417185e9b5 ("ACPI: video: Add DMI quirk for GIGABYTE GB-BXBT-2807") which says the following in its commit message: "The GIGABYTE GB-BXBT-2807 is a mini-PC which uses off the shelf components, like an Intel GPU which is meant for mobile systems. As such, it, by default, has a backlight controller exposed. Unfortunately, the backlight controller only confuses userspace, which sees the existence of a backlight device node and has the unrealistic belief that there is actually a backlight there! Add a DMI quirk to force the backlight off on this system." So in essence this quirk was using a video_detect_force_vendor quirk to disable backlight control. Now a days we have a specific "none" backlight type for this. Change the quirk to video_detect_force_none and group it together with the other force_none quirks. Cc: Jasper St. Pierre Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index bb8052fc3fee..a1ac7de186be 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -199,14 +199,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "1015CX"), }, }, - { - .callback = video_detect_force_vendor, - /* GIGABYTE GB-BXBT-2807 */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), - DMI_MATCH(DMI_PRODUCT_NAME, "GB-BXBT-2807"), - }, - }, { .callback = video_detect_force_vendor, /* Samsung N150/N210/N220 */ @@ -674,6 +666,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "OptiPlex 9020M"), }, }, + { + .callback = video_detect_force_none, + /* GIGABYTE GB-BXBT-2807 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "GIGABYTE"), + DMI_MATCH(DMI_PRODUCT_NAME, "GB-BXBT-2807"), + }, + }, { .callback = video_detect_force_none, /* MSI MS-7721 */ From patchwork Mon Nov 14 14:44:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 624870 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B115BC433FE for ; Mon, 14 Nov 2022 14:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235984AbiKNOqk (ORCPT ); Mon, 14 Nov 2022 09:46:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50326 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235636AbiKNOqi (ORCPT ); Mon, 14 Nov 2022 09:46:38 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4946F26FB for ; Mon, 14 Nov 2022 06:45:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668437114; 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=xHIQBUfqD0ipeTA29MoZZ4xWXf/VHbmW4bpPAmWI8kk=; b=Xt/n6+mhQ1G1/nZE3YL7i54iNjEPJFBgIqfVgaWzKzkRrb2/d3OZV8HWTD1Q+qQm/MkgIP p/jvvRmiVrkmsbshzvJ/gxBL1vuMxFEJ7NMWgI1wBN4ngt/r+C9X7UGw0004zLTp9VDW/d kVQ7nHzNdL/yYc0BF09f7CF3FUiZtQs= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-624-BzDQyg3KOiCO0cZRtFbJFg-1; Mon, 14 Nov 2022 09:45:11 -0500 X-MC-Unique: BzDQyg3KOiCO0cZRtFbJFg-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A25B687B2A0; Mon, 14 Nov 2022 14:45:10 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 2AF1B1401C21; Mon, 14 Nov 2022 14:45:08 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , Len Brown , Matthew Garrett , linux-acpi@vger.kernel.org Subject: [PATCH 3/7] ACPI: video: Change Sony Vaio VPCEH3U1E quirk to force_native Date: Mon, 14 Nov 2022 15:44:55 +0100 Message-Id: <20221114144459.455519-4-hdegoede@redhat.com> In-Reply-To: <20221114144459.455519-1-hdegoede@redhat.com> References: <20221114144459.455519-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org According to: https://bugzilla.kernel.org/show_bug.cgi?id=202401 the Sony Vaio VPCEH3U1E quirk was added to disable the acpi_video0 backlight interface because that was not working, so that userspace will pick the actually working native nv_backlight interface instead. With the new kernel behavior of hiding native interfaces unless acpi_video_get_backlight_type() returns native, the current video_detect_force_vendor quirk will cause the working nv_backlight interface will be disabled too. Change the quirk to video_detect_force_native to get the desired result of only registering the nv_backlight interface. After this all currently remaining force_vendor quirks in video_detect_dmi_table[] are there to prefer a vendor interface over a non working ACPI video interface, add a comment to document this. Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index a1ac7de186be..327e0967ba54 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -132,6 +132,10 @@ static int video_detect_force_none(const struct dmi_system_id *d) } static const struct dmi_system_id video_detect_dmi_table[] = { + /* + * Models which should use the vendor backlight interface, + * because of broken ACPI video backlight control. + */ { /* https://bugzilla.redhat.com/show_bug.cgi?id=1128309 */ .callback = video_detect_force_vendor, @@ -226,15 +230,6 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_BOARD_NAME, "NC210/NC110"), }, }, - { - /* https://bugzilla.kernel.org/show_bug.cgi?id=202401 */ - .callback = video_detect_force_vendor, - /* Sony VPCEH3U1E */ - .matches = { - DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), - DMI_MATCH(DMI_PRODUCT_NAME, "VPCEH3U1E"), - }, - }, { .callback = video_detect_force_vendor, /* Xiaomi Mi Pad 2 */ @@ -604,6 +599,15 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_BOARD_NAME, "N250P"), }, }, + { + /* https://bugzilla.kernel.org/show_bug.cgi?id=202401 */ + .callback = video_detect_force_native, + /* Sony Vaio VPCEH3U1E */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "VPCEH3U1E"), + }, + }, /* * These Toshibas have a broken acpi-video interface for brightness From patchwork Mon Nov 14 14:44:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 624868 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 379D9C4332F for ; Mon, 14 Nov 2022 14:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235697AbiKNOq4 (ORCPT ); Mon, 14 Nov 2022 09:46:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50322 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236238AbiKNOqn (ORCPT ); Mon, 14 Nov 2022 09:46:43 -0500 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 B03496377 for ; Mon, 14 Nov 2022 06:45:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668437117; 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=pLKwd7LdFoY3d3OGGTqZ2TY1L53YOPPgucadnQcACLc=; b=Hl5G5nlK3YGkOJ4/rEW6yR2N42WjHknu0ql3lqVAO3S8serLPE9DFEpF13oq1C5iUSO9R4 g/NeJW34G/VbbiUyY770UaRHr8sItPHt5m5xNCbYqmSG4nygFTewLq2ZU9rNL2Nr8AgXgj 922vkW6mUxvpcjwW8YwwO922+G4nRAE= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-651-gA0E6UgPMCq1Vd5ER2K7Sw-1; Mon, 14 Nov 2022 09:45:12 -0500 X-MC-Unique: gA0E6UgPMCq1Vd5ER2K7Sw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id E779A800B23; Mon, 14 Nov 2022 14:45:11 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1D7D61415102; Mon, 14 Nov 2022 14:45:10 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , Len Brown , Matthew Garrett , linux-acpi@vger.kernel.org Subject: [PATCH 4/7] ACPI: video: Add force_vendor quirk for Sony Vaio PCG-FRV35 Date: Mon, 14 Nov 2022 15:44:56 +0100 Message-Id: <20221114144459.455519-5-hdegoede@redhat.com> In-Reply-To: <20221114144459.455519-1-hdegoede@redhat.com> References: <20221114144459.455519-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The Sony Vaio PCG-FRV35 advertises both native and vendor backlight control interfaces. With the upcoming changes to prefer native over vendor acpi_video_get_backlight_type() will start returning native on these laptops. But the native radeon_bl0 interface does not work, where as the sony vendor interface does work. Add a quirk to force use of the vendor interface. Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 327e0967ba54..43f667523ab0 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -239,6 +239,19 @@ static const struct dmi_system_id video_detect_dmi_table[] = { }, }, + /* + * Models which should use the vendor backlight interface, + * because of broken native backlight control. + */ + { + .callback = video_detect_force_vendor, + /* Sony Vaio PCG-FRV35 */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "PCG-FRV35"), + }, + }, + /* * Toshiba models with Transflective display, these need to use * the toshiba_acpi vendor driver for proper Transflective handling. From patchwork Mon Nov 14 14:44:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 624566 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E6FD3C433FE for ; Mon, 14 Nov 2022 14:46:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236023AbiKNOqm (ORCPT ); Mon, 14 Nov 2022 09:46:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235697AbiKNOqk (ORCPT ); Mon, 14 Nov 2022 09:46:40 -0500 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 3F3CFE46 for ; Mon, 14 Nov 2022 06:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668437118; 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=lx77Uu3RmvwS92rQG/csxWjuY8OH5waxBoCdeMtlmWg=; b=BYcseoIGwmmdlWWOT/GI6C8NSb9HqJuMFIPvmhv6Hsb7wzS37BGAKtd8GWHQab8zu5LkF1 LHKJSnJ43g/lTytEkj6sdr6mHtoBtunM908O0Seelt5nwGmE+bH7+w5MmZyrwO6OhMMJWm VIGVHWqqpr73Av3HWGYjMC7yDs4FdNI= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-w4_Nx4c3MqWP3ODQaiKpFw-1; Mon, 14 Nov 2022 09:45:14 -0500 X-MC-Unique: w4_Nx4c3MqWP3ODQaiKpFw-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 922E0185A792; Mon, 14 Nov 2022 14:45:13 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 55FEE1415134; Mon, 14 Nov 2022 14:45:12 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , Len Brown , Matthew Garrett , linux-acpi@vger.kernel.org, Stefan Joosten Subject: [PATCH 5/7] ACPI: video: Add force_native quirk for Sony Vaio VPCY11S1E Date: Mon, 14 Nov 2022 15:44:57 +0100 Message-Id: <20221114144459.455519-6-hdegoede@redhat.com> In-Reply-To: <20221114144459.455519-1-hdegoede@redhat.com> References: <20221114144459.455519-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org The Sony Vaio VPCY11S1E advertises both native and ACPI video backlight control interfaces, but only the native interface works and the default heuristics end up picking ACPI video on this model. Add a video_detect_force_native DMI quirk for this. Reported-by: Stefan Joosten Signed-off-by: Hans de Goede --- 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 43f667523ab0..0e217bf79f17 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -621,6 +621,14 @@ static const struct dmi_system_id video_detect_dmi_table[] = { DMI_MATCH(DMI_PRODUCT_NAME, "VPCEH3U1E"), }, }, + { + .callback = video_detect_force_native, + /* Sony Vaio VPCY11S1E */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), + DMI_MATCH(DMI_PRODUCT_NAME, "VPCY11S1E"), + }, + }, /* * These Toshibas have a broken acpi-video interface for brightness From patchwork Mon Nov 14 14:44:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 624567 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4228DC4332F for ; Mon, 14 Nov 2022 14:46:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235825AbiKNOqj (ORCPT ); Mon, 14 Nov 2022 09:46:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49964 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235697AbiKNOqi (ORCPT ); Mon, 14 Nov 2022 09:46:38 -0500 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 8594814D13 for ; Mon, 14 Nov 2022 06:45:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668437118; 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=C2Q29vIxPQqeJaBK9aZ1aaVxGc8pT8CVQDk/KC5p1EM=; b=jPgSJ5EOk6uF550BEyILoogiZNs/8dJmcNRIc9kw4DOeiahtDXFVRJkbp9bAU/72nzWweT eM1BKuDY073/QcG99Xi7C4/EER1jcB8tQGQOPcHdWnbC8W5at6mrNJwULviEAJPybXlCYe MiVLt6GFP1GixpQYBgulllowHnIU9/k= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-395-TZI7O_5UP_COHbEb8DgXLQ-1; Mon, 14 Nov 2022 09:45:15 -0500 X-MC-Unique: TZI7O_5UP_COHbEb8DgXLQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 1150C87B2A2; Mon, 14 Nov 2022 14:45:15 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id F0E7E1415102; Mon, 14 Nov 2022 14:45:13 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , Len Brown , Matthew Garrett , linux-acpi@vger.kernel.org Subject: [PATCH 6/7] ACPI: video: Simplify __acpi_video_get_backlight_type() Date: Mon, 14 Nov 2022 15:44:58 +0100 Message-Id: <20221114144459.455519-7-hdegoede@redhat.com> In-Reply-To: <20221114144459.455519-1-hdegoede@redhat.com> References: <20221114144459.455519-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Simplify __acpi_video_get_backlight_type() removing a nested if which makes the flow harder to follow. This also results in having only 1 exit point with return acpi_backlight_native instead of 2. Note this drops the (video_caps & ACPI_VIDEO_BACKLIGHT) check from the if (acpi_osi_is_win8() && native_available) return native path. Windows 8's hardware certification requirements include that there must be ACPI video bus backlight control, so the ACPI_VIDEO_BACKLIGHT check is redundant. Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 0e217bf79f17..5da6b1b449d5 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -715,6 +715,16 @@ static bool google_cros_ec_present(void) return acpi_dev_found("GOOG0004") || acpi_dev_found("GOOG000C"); } +/* + * Windows 8 and newer no longer use the ACPI video interface, so it often + * does not work. So on win8+ systems prefer native brightness control. + * Chromebooks should always prefer native backlight control. + */ +static bool prefer_native_over_acpi_video(void) +{ + return acpi_osi_is_win8() || google_cros_ec_present(); +} + /* * Determine which type of backlight interface to use on this system, * First check cmdline, then dmi quirks, then do autodetect. @@ -760,26 +770,14 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) if (apple_gmux_present()) return acpi_backlight_apple_gmux; - /* Chromebooks should always prefer native backlight control. */ - if (google_cros_ec_present() && native_available) - return acpi_backlight_native; + /* Use ACPI video if available, except when native should be preferred. */ + if ((video_caps & ACPI_VIDEO_BACKLIGHT) && + !(native_available && prefer_native_over_acpi_video())) + return acpi_backlight_video; - /* On systems with ACPI video use either native or ACPI video. */ - if (video_caps & ACPI_VIDEO_BACKLIGHT) { - /* - * Windows 8 and newer no longer use the ACPI video interface, - * so it often does not work. If the ACPI tables are written - * for win8 and native brightness ctl is available, use that. - * - * The native check deliberately is inside the if acpi-video - * block on older devices without acpi-video support native - * is usually not the best choice. - */ - if (acpi_osi_is_win8() && native_available) - return acpi_backlight_native; - else - return acpi_backlight_video; - } + /* Use native if available */ + if (native_available && prefer_native_over_acpi_video()) + return acpi_backlight_native; /* No ACPI video (old hw), use vendor specific fw methods. */ return acpi_backlight_vendor; From patchwork Mon Nov 14 14:44:59 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hans de Goede X-Patchwork-Id: 624565 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E8B4C43217 for ; Mon, 14 Nov 2022 14:47:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235636AbiKNOqz (ORCPT ); Mon, 14 Nov 2022 09:46:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50324 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235697AbiKNOqn (ORCPT ); Mon, 14 Nov 2022 09:46:43 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BEAD5E21 for ; Mon, 14 Nov 2022 06:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1668437118; 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=TvY9w8CYZaac4npN7JxtQrCbvWhms6Flr5tbiuBECqw=; b=LzJ27qEBLe5V63msdj4bykq/Vho4XU8jZc1E9XzUUXMBUf1gi+8UrkDZdBdZmD02qqLYwG XvVcNumyLFixRc+sjkRu9an4ChF8/eWgLXbZVa1ETIm0YS0PqF34/uyJe04kUhhpwxMVxK qlabEUlcQcW+YaaFK5M4zoD+6vKefrQ= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-546-TR8JUTGYPa-foAHfK2U3jQ-1; Mon, 14 Nov 2022 09:45:16 -0500 X-MC-Unique: TR8JUTGYPa-foAHfK2U3jQ-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.rdu2.redhat.com [10.11.54.7]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 3EA772A2AD4A; Mon, 14 Nov 2022 14:45:16 +0000 (UTC) Received: from x1.localdomain.com (unknown [10.39.193.154]) by smtp.corp.redhat.com (Postfix) with ESMTP id 449D41415134; Mon, 14 Nov 2022 14:45:15 +0000 (UTC) From: Hans de Goede To: "Rafael J . Wysocki" Cc: Hans de Goede , Len Brown , Matthew Garrett , linux-acpi@vger.kernel.org Subject: [PATCH 7/7] ACPI: video: Prefer native over vendor Date: Mon, 14 Nov 2022 15:44:59 +0100 Message-Id: <20221114144459.455519-8-hdegoede@redhat.com> In-Reply-To: <20221114144459.455519-1-hdegoede@redhat.com> References: <20221114144459.455519-1-hdegoede@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.1 on 10.11.54.7 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org When available prefer native backlight control over vendor backlight control. Testing has shown that there are quite a few laptop models which rely on native backlight control (they don't have ACPI video bus backlight control) and on which acpi_osi_is_win8() returns false. Currently __acpi_video_get_backlight_type() returns vendor on these laptops, leading to an empty /sys/class/backlight. As a workaround for this acpi_video_backlight_use_native() has been temporarily changed to always return true. This re-introduces the problem of having multiple backlight devices under /sys/class/backlight for a single panel. Change __acpi_video_get_backlight_type() to prefer native over vendor when available. So that it returns native on these models. And change acpi_video_backlight_use_native() back to only return true when __acpi_video_get_backlight_type() returns native. Signed-off-by: Hans de Goede --- drivers/acpi/video_detect.c | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c index 5da6b1b449d5..a934bbc9dd37 100644 --- a/drivers/acpi/video_detect.c +++ b/drivers/acpi/video_detect.c @@ -776,10 +776,10 @@ static enum acpi_backlight_type __acpi_video_get_backlight_type(bool native) return acpi_backlight_video; /* Use native if available */ - if (native_available && prefer_native_over_acpi_video()) + if (native_available) return acpi_backlight_native; - /* No ACPI video (old hw), use vendor specific fw methods. */ + /* No ACPI video/native (old hw), use vendor specific fw methods. */ return acpi_backlight_vendor; } @@ -791,18 +791,6 @@ EXPORT_SYMBOL(acpi_video_get_backlight_type); bool acpi_video_backlight_use_native(void) { - /* - * Call __acpi_video_get_backlight_type() to let it know that - * a native backlight is available. - */ - __acpi_video_get_backlight_type(true); - - /* - * For now just always return true. There is a whole bunch of laptop - * models where (video_caps & ACPI_VIDEO_BACKLIGHT) is false causing - * __acpi_video_get_backlight_type() to return vendor, while these - * models only have a native backlight control. - */ - return true; + return __acpi_video_get_backlight_type(true) == acpi_backlight_native; } EXPORT_SYMBOL(acpi_video_backlight_use_native);