public inbox for linux-acpi@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] ACPI: video: Fix missing backlight node creation on Zhaoxin platforms
@ 2025-09-10  7:47 Zihuan Zhang
  2025-09-10  9:37 ` Hans de Goede
  0 siblings, 1 reply; 10+ messages in thread
From: Zihuan Zhang @ 2025-09-10  7:47 UTC (permalink / raw)
  To: Rafael J . wysocki, Hans de Goede
  Cc: Len Brown, Mario Limonciello, linux-acpi, linux-kernel,
	Zihuan Zhang, stable

Some recent Lenovo and Inspur machines with Zhaoxin CPUs fail to create
/sys/class/backlight/acpi_video0 on v6.6 kernels, while the same hardware
works correctly on v5.4.

Our analysis shows that the current implementation assumes the presence of a
GPU. The backlight registration is only triggered if a GPU is detected, but on
these platforms the backlight is handled purely by the EC without any GPU.
As a result, the detection path does not create the expected backlight node.

To fix this, move the following logic:

/* 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;

above the if (auto_detect) *auto_detect = true; statement.

This ensures that the ACPI video backlight node is created even when no GPU is
present, restoring the correct behavior observed on older kernels.

Fixes: 78dfc9d1d1ab ("ACPI: video: Add auto_detect arg to __acpi_video_get_backlight_type()")
Cc: stable@vger.kernel.org
Signed-off-by: Zihuan Zhang <zhangzihuan@kylinos.cn>
---
 drivers/acpi/video_detect.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
index d507d5e08435..c1bb22b57f56 100644
--- a/drivers/acpi/video_detect.c
+++ b/drivers/acpi/video_detect.c
@@ -1011,6 +1011,11 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
 	if (acpi_backlight_dmi != acpi_backlight_undef)
 		return acpi_backlight_dmi;
 
+	/* 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;
+
 	if (auto_detect)
 		*auto_detect = true;
 
@@ -1024,11 +1029,6 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
 	if (dell_uart_present)
 		return acpi_backlight_dell_uart;
 
-	/* 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;
-
 	/* Use native if available */
 	if (native_available)
 		return acpi_backlight_native;
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2025-09-18  7:33 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-09-10  7:47 [PATCH v1] ACPI: video: Fix missing backlight node creation on Zhaoxin platforms Zihuan Zhang
2025-09-10  9:37 ` Hans de Goede
2025-09-10  9:58   ` Hans de Goede
2025-09-11  7:45     ` [PATCH v1] ACPI: video: Fix missing backlight node creation on Zihuan Zhang
2025-09-11 10:38       ` Hans de Goede
2025-09-12  1:11         ` Zihuan Zhang
2025-09-12  8:59           ` Hans de Goede
2025-09-12 10:35             ` Zihuan Zhang
2025-09-18  0:36               ` Zihuan Zhang
2025-09-18  7:33                 ` Hans de Goede

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox