vkms_composer.h 752 B

12345678910111213141516171819202122232425262728
  1. /* SPDX-License-Identifier: GPL-2.0+ */
  2. #ifndef _VKMS_COMPOSER_H_
  3. #define _VKMS_COMPOSER_H_
  4. #include <kunit/visibility.h>
  5. #include "vkms_drv.h"
  6. /*
  7. * This enum is related to the positions of the variables inside
  8. * `struct drm_color_lut`, so the order of both needs to be the same.
  9. */
  10. enum lut_channel {
  11. LUT_RED = 0,
  12. LUT_GREEN,
  13. LUT_BLUE,
  14. LUT_RESERVED
  15. };
  16. #if IS_ENABLED(CONFIG_KUNIT)
  17. u16 lerp_u16(u16 a, u16 b, s64 t);
  18. s64 get_lut_index(const struct vkms_color_lut *lut, u16 channel_value);
  19. u16 apply_lut_to_channel_value(const struct vkms_color_lut *lut, u16 channel_value,
  20. enum lut_channel channel);
  21. void apply_3x4_matrix(struct pixel_argb_s32 *pixel, const struct drm_color_ctm_3x4 *matrix);
  22. #endif
  23. #endif /* _VKMS_COMPOSER_H_ */