Commit | Line | Data |
---|---|---|
2874c5fd | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
7415287e GH |
2 | /* |
3 | * Copyright (C) 2016 Noralf Trønnes | |
7415287e GH |
4 | */ |
5 | ||
6 | #ifndef __LINUX_DRM_FORMAT_HELPER_H | |
7 | #define __LINUX_DRM_FORMAT_HELPER_H | |
8 | ||
4a85b0b5 TZ |
9 | #include <linux/types.h> |
10 | ||
11 | struct drm_device; | |
452290f3 | 12 | struct drm_format_info; |
7415287e GH |
13 | struct drm_framebuffer; |
14 | struct drm_rect; | |
15 | ||
4a85b0b5 TZ |
16 | struct iosys_map; |
17 | ||
452290f3 TZ |
18 | unsigned int drm_fb_clip_offset(unsigned int pitch, const struct drm_format_info *format, |
19 | const struct drm_rect *clip); | |
20 | ||
edbe262a | 21 | void drm_fb_memcpy(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 22 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
edbe262a | 23 | const struct drm_rect *clip); |
ce582859 | 24 | void drm_fb_swab(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 25 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
ce582859 | 26 | const struct drm_rect *clip, bool cached); |
e13140a0 | 27 | void drm_fb_xrgb8888_to_rgb332(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 28 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
e13140a0 | 29 | const struct drm_rect *clip); |
ab298c29 | 30 | void drm_fb_xrgb8888_to_rgb565(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 31 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
ab298c29 | 32 | const struct drm_rect *clip, bool swab); |
10cd592e TZ |
33 | void drm_fb_xrgb8888_to_xrgb1555(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 | void drm_fb_xrgb8888_to_argb1555(struct iosys_map *dst, const unsigned int *dst_pitch, | |
37 | const struct iosys_map *src, const struct drm_framebuffer *fb, | |
38 | const struct drm_rect *clip); | |
39 | void drm_fb_xrgb8888_to_rgba5551(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); | |
c4863ce0 | 42 | void drm_fb_xrgb8888_to_rgb888(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 43 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
c4863ce0 | 44 | const struct drm_rect *clip); |
175073d6 TZ |
45 | void drm_fb_xrgb8888_to_argb8888(struct iosys_map *dst, const unsigned int *dst_pitch, |
46 | const struct iosys_map *src, const struct drm_framebuffer *fb, | |
47 | const struct drm_rect *clip); | |
ce73f456 | 48 | void drm_fb_xrgb8888_to_xrgb2101010(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 49 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
ce73f456 | 50 | const struct drm_rect *clip); |
56119bfb TZ |
51 | void drm_fb_xrgb8888_to_argb2101010(struct iosys_map *dst, const unsigned int *dst_pitch, |
52 | const struct iosys_map *src, const struct drm_framebuffer *fb, | |
53 | const struct drm_rect *clip); | |
7bef6449 | 54 | void drm_fb_xrgb8888_to_gray8(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 55 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
7bef6449 | 56 | const struct drm_rect *clip); |
7415287e | 57 | |
71bf5587 | 58 | int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format, |
504a51d7 | 59 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
71bf5587 | 60 | const struct drm_rect *rect); |
900d3e4a | 61 | |
b3aca563 | 62 | void drm_fb_xrgb8888_to_mono(struct iosys_map *dst, const unsigned int *dst_pitch, |
504a51d7 | 63 | const struct iosys_map *src, const struct drm_framebuffer *fb, |
b3aca563 | 64 | const struct drm_rect *clip); |
bcf8b616 | 65 | |
4a85b0b5 TZ |
66 | size_t drm_fb_build_fourcc_list(struct drm_device *dev, |
67 | const u32 *native_fourccs, size_t native_nfourccs, | |
68 | const u32 *extra_fourccs, size_t extra_nfourccs, | |
69 | u32 *fourccs_out, size_t nfourccs_out); | |
70 | ||
7415287e | 71 | #endif /* __LINUX_DRM_FORMAT_HELPER_H */ |