Skip to content

Commit 5230488

Browse files
jwrdegoederafaeljw
authored andcommitted
ACPI: video: Add comment about acpi_video_backlight_use_native() usage
Add a comment explaining that acpi_video_backlight_use_native() MUST only be used by GPU drivers and that it must NOT be used on other places. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
1 parent c936954 commit 5230488

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

include/acpi/video.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,15 @@ static inline enum acpi_backlight_type acpi_video_get_backlight_type(void)
7575
return __acpi_video_get_backlight_type(false, NULL);
7676
}
7777

78+
/*
79+
* This function MUST only be called by GPU drivers to check if the driver
80+
* should register a backlight class device. This function not only checks
81+
* if a GPU native backlight device should be registered it *also* tells
82+
* the ACPI video-detect code that native GPU backlight control is available.
83+
* Therefor calling this from any place other then the GPU driver is wrong!
84+
* To check if GPU native backlight control is used in other places instead use:
85+
* if (acpi_video_get_backlight_type() == acpi_backlight_native) { ... }
86+
*/
7887
static inline bool acpi_video_backlight_use_native(void)
7988
{
8089
return __acpi_video_get_backlight_type(true, NULL) == acpi_backlight_native;

0 commit comments

Comments
 (0)