drm_format_helper.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. /*
  3. * Copyright (C) 2016 Noralf Trønnes
  4. */
  5. #ifndef __LINUX_DRM_FORMAT_HELPER_H
  6. #define __LINUX_DRM_FORMAT_HELPER_H
  7. #include <linux/types.h>
  8. struct drm_device;
  9. struct drm_format_info;
  10. struct drm_framebuffer;
  11. struct drm_rect;
  12. struct iosys_map;
  13. unsigned int drm_fb_clip_offset(unsigned int pitch, const struct drm_format_info *format,
  14. const struct drm_rect *clip);
  15. void drm_fb_memcpy(struct iosys_map *dst, const unsigned int *dst_pitch,
  16. const struct iosys_map *src, const struct drm_framebuffer *fb,
  17. const struct drm_rect *clip);
  18. void drm_fb_swab(struct iosys_map *dst, const unsigned int *dst_pitch,
  19. const struct iosys_map *src, const struct drm_framebuffer *fb,
  20. const struct drm_rect *clip, bool cached);
  21. void drm_fb_xrgb8888_to_rgb332(struct iosys_map *dst, const unsigned int *dst_pitch,
  22. const struct iosys_map *src, const struct drm_framebuffer *fb,
  23. const struct drm_rect *clip);
  24. void drm_fb_xrgb8888_to_rgb565(struct iosys_map *dst, const unsigned int *dst_pitch,
  25. const struct iosys_map *src, const struct drm_framebuffer *fb,
  26. const struct drm_rect *clip, bool swab);
  27. void drm_fb_xrgb8888_to_rgb888(struct iosys_map *dst, const unsigned int *dst_pitch,
  28. const struct iosys_map *src, const struct drm_framebuffer *fb,
  29. const struct drm_rect *clip);
  30. void drm_fb_xrgb8888_to_xrgb2101010(struct iosys_map *dst, const unsigned int *dst_pitch,
  31. const struct iosys_map *src, const struct drm_framebuffer *fb,
  32. const struct drm_rect *clip);
  33. void drm_fb_xrgb8888_to_gray8(struct iosys_map *dst, const unsigned int *dst_pitch,
  34. const struct iosys_map *src, const struct drm_framebuffer *fb,
  35. const struct drm_rect *clip);
  36. int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format,
  37. const struct iosys_map *src, const struct drm_framebuffer *fb,
  38. const struct drm_rect *rect);
  39. void drm_fb_xrgb8888_to_mono(struct iosys_map *dst, const unsigned int *dst_pitch,
  40. const struct iosys_map *src, const struct drm_framebuffer *fb,
  41. const struct drm_rect *clip);
  42. size_t drm_fb_build_fourcc_list(struct drm_device *dev,
  43. const u32 *native_fourccs, size_t native_nfourccs,
  44. const u32 *extra_fourccs, size_t extra_nfourccs,
  45. u32 *fourccs_out, size_t nfourccs_out);
  46. #endif /* __LINUX_DRM_FORMAT_HELPER_H */