git: a82a8a5e1935 - main - linuxkpi: Define `backlight_get_brightness()` and `backlight_is_blank()`
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Mon, 13 Feb 2023 21:09:43 UTC
The branch main has been updated by dumbbell (ports committer): URL: https://cgit.FreeBSD.org/src/commit/?id=a82a8a5e193587d819288c3c27f1c9472178e10e commit a82a8a5e193587d819288c3c27f1c9472178e10e Author: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> AuthorDate: 2023-02-08 17:51:16 +0000 Commit: Jean-Sébastien Pédron <dumbbell@FreeBSD.org> CommitDate: 2023-02-13 21:09:26 +0000 linuxkpi: Define `backlight_get_brightness()` and `backlight_is_blank()` This is not used by the DRM driver yet because we comment out the code calling them, but they are easy to implement. Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D38530 --- sys/compat/linuxkpi/common/include/linux/backlight.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/backlight.h b/sys/compat/linuxkpi/common/include/linux/backlight.h index 9591a4b671ab..5a3c7080b55d 100644 --- a/sys/compat/linuxkpi/common/include/linux/backlight.h +++ b/sys/compat/linuxkpi/common/include/linux/backlight.h @@ -91,6 +91,13 @@ backlight_force_update(struct backlight_device *bd, int reason) bd->props.brightness = bd->ops->get_brightness(bd); } +static inline int +backlight_get_brightness(struct backlight_device *bd) +{ + + return (bd->props.brightness); +} + static inline int backlight_device_set_brightness(struct backlight_device *bd, int brightness) { @@ -119,4 +126,11 @@ backlight_disable(struct backlight_device *bd) return (backlight_update_status(bd)); } +static inline bool +backlight_is_blank(struct backlight_device *bd) +{ + + return (bd->props.power != 0/* FB_BLANK_UNBLANK */); +} + #endif /* _LINUXKPI_LINUX_BACKLIGHT_H_ */