Link: https://lore.kernel.org/r/20260217200002.683975158@linuxfoundation.org Tested-by: Florian Fainelli <florian.fainelli@broadcom.com> Tested-by: Takeshi Ogasawara <takeshi.ogasawara@futuring-girl.com> Tested-by: Peter Schneider <pschneider1968@googlemail.com> Tested-by: Jon Hunter <jonathanh@nvidia.com> Tested-by: Salvatore Bonaccorso <carnil@debian.org> Tested-by: Brett A C Sheffield <bacs@librecast.net> Tested-by: Mark Brown <broonie@kernel.org> Tested-by: Luna Jernberg <droidbittin@gmail.com> Tested-by: Ronald Warsow <rwarsow@gmx.de> Tested-by: Justin M. Forbes <jforbes@fedoraproject.org> Tested-by: Ron Economos <re@w6rz.net> Tested-by: Miguel Ojeda <ojeda@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
29 lines
752 B
C
29 lines
752 B
C
/* SPDX-License-Identifier: GPL-2.0+ */
|
|
|
|
#ifndef _VKMS_COMPOSER_H_
|
|
#define _VKMS_COMPOSER_H_
|
|
|
|
#include <kunit/visibility.h>
|
|
#include "vkms_drv.h"
|
|
|
|
/*
|
|
* This enum is related to the positions of the variables inside
|
|
* `struct drm_color_lut`, so the order of both needs to be the same.
|
|
*/
|
|
enum lut_channel {
|
|
LUT_RED = 0,
|
|
LUT_GREEN,
|
|
LUT_BLUE,
|
|
LUT_RESERVED
|
|
};
|
|
|
|
#if IS_ENABLED(CONFIG_KUNIT)
|
|
u16 lerp_u16(u16 a, u16 b, s64 t);
|
|
s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value);
|
|
u16 apply_lut_to_channel_value(const struct vkms_color_lut *lut, u16 channel_value,
|
|
enum lut_channel channel);
|
|
void apply_3x4_matrix(struct pixel_argb_s32 *pixel, const struct drm_color_ctm_3x4 *matrix);
|
|
#endif
|
|
|
|
#endif /* _VKMS_COMPOSER_H_ */
|