diff options
| author | Thomas Zimmermann <tzimmermann@suse.de> | 2025-04-01 12:37:21 +0300 |
|---|---|---|
| committer | Thomas Zimmermann <tzimmermann@suse.de> | 2025-04-07 12:02:07 +0300 |
| commit | 814d270b31d27b6ea4f722b8ae2db9802fe332ff (patch) | |
| tree | d47dd60dc865a9ec5cb4a73eadd01df1d3a1e520 /include/linux | |
| parent | 9d0de9e8b7087745e63eef7bee298e103da4f590 (diff) | |
| download | linux-814d270b31d27b6ea4f722b8ae2db9802fe332ff.tar.xz | |
drm/sysfb: vesadrm: Add gamma correction
Add palette support and export GAMMA properties via sysfs. User-space
compositors can use this interface for programming gamma ramps or night
mode.
Vesadrm supports palette updates via VGA DAC registers or VESA palette
calls. Up to 256 palette entries are available. Userspace always supplies
gamma ramps of 256 entries. If the native color format does not match
this because pixel component have less then 8 bits, vesadrm interpolates
among the palette entries.
The code uses CamelCase style in a few places to match the VESA manuals.
v3:
- fix coding style
v2:
- use CONFIG_X86_32 instead of __i386__ (checkpatch)
- protect struct vesadrm.pmi with CONFIG_X86_32
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20250401094056.32904-19-tzimmermann@suse.de
Diffstat (limited to 'include/linux')
| -rw-r--r-- | include/linux/screen_info.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index ab3cffbb58b7..923d68e07679 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h @@ -126,6 +126,13 @@ static inline unsigned int screen_info_video_type(const struct screen_info *si) return VIDEO_TYPE_CGA; } +static inline u32 __screen_info_vesapm_info_base(const struct screen_info *si) +{ + if (si->vesapm_seg < 0xc000) + return 0; + return (si->vesapm_seg << 4) + si->vesapm_off; +} + ssize_t screen_info_resources(const struct screen_info *si, struct resource *r, size_t num); u32 __screen_info_lfb_bits_per_pixel(const struct screen_info *si); |
