[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20250911074543.106620-1-zhangzihuan@kylinos.cn>
Date: Thu, 11 Sep 2025 15:45:43 +0800
From: Zihuan Zhang <zhangzihuan@...inos.cn>
To: hansg@...nel.org
Cc: lenb@...nel.org,
linux-acpi@...r.kernel.org,
linux-kernel@...r.kernel.org,
mario.limonciello@....com,
rafael@...nel.org,
stable@...r.kernel.org,
zhangzihuan@...inos.cn
Subject: Re: [PATCH v1] ACPI: video: Fix missing backlight node creation on
> Oh wait, now I understand the trick is that you now return
> acpi_backlight_video without setting *auto_detect = true.
>
> Which in turn causes this code in drivers/acpi/acpi_video.c:
>
> /*
> * If backlight-type auto-detection is used then a native backlight may
> * show up later and this may change the result from video to native.
> * Therefor normally the userspace visible /sys/class/backlight device
> * gets registered separately by the GPU driver calling
> * acpi_video_register_backlight() when an internal panel is detected.
> * Register the backlight now when not using auto-detection, so that
> * when the kernel cmdline or DMI-quirks are used the backlight will
> * get registered even if acpi_video_register_backlight() is not called.
> */
> acpi_video_run_bcl_for_osi(video);
> if (__acpi_video_get_backlight_type(false, &auto_detect) == acpi_backlight_video &&
> !auto_detect)
> acpi_video_bus_register_backlight(video);
>
> To immediately register the backlight rather then waiting for the native
> GPU driver to call acpi_video_register_backlight() after the native GPU
> driver has completed probing for native GPU backlight control which is
> often preferred.
>
> So as you say the issue is that you have no native GPU driver calling
> acpi_video_register_backlight().
I'm very happy that you got it.
> First of all I assume that there is some sort of builtin GPU on these
> Lenovo and Inspur machines with Zhaoxin CPUs. Even if the GPU driver
> is not in the mainline kernel then I assume there is some out of tree
> driver. Can that driver not call acpi_video_register_backlight() ?
We are currently working with Zhaoxin on this matter, and we expect to have some results in a few days.
I will keep you updated once we have progress.
> If this is not possible then we will need to add some quirk based
> on CPUID matching e.g. something like this:
>
> diff --git a/drivers/acpi/video_detect.c b/drivers/acpi/video_detect.c
> index d507d5e08435..24dd79ec1b72 100644
> --- a/drivers/acpi/video_detect.c
> +++ b/drivers/acpi/video_detect.c
> @@ -1011,6 +1011,18 @@ enum acpi_backlight_type __acpi_video_get_backlight_type(bool native, bool *auto
> if (acpi_backlight_dmi != acpi_backlight_undef)
> return acpi_backlight_dmi;
>
> + /*
> + * ATM Zhaoxin CPU systems have no native GPU driver, instead ACPI video
> + * should be used to control the backlight. The lack of a GPU driver
> + * means that acpi_video_register_backlight() will never get called
> + * causing things to not work.
> + * This special case for these systems returns acpi_backlight_video
> + * without setting auto_detect = true, causing acpi_video.c to
> + * immediately register the backlight, working around this issue.
> + */
> + if ((video_caps & ACPI_VIDEO_BACKLIGHT) && cpu_is_zhaoxin())
> + return acpi_backlight_video;
> +
> if (auto_detect)
> *auto_detect = true;
>
>
> Note you will need to provide a cpu_is_zhaoxin() helper for this.
Thanks a lot for your patch and for looking into this issue.
At the moment, we are still confirming with Zhaoxin whether this behavior is consistent across all their platforms,
so we are not sure if the special handling should always apply.
Also, on kernel 5.4 these machines seem to work fine without requiring a native GPU driver, while on 6.6+ the backlight node is missing.
Could you please clarify what design change or intention caused this behavioral difference between 5.4 and newer kernels?
Powered by blists - more mailing lists