1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 /*
3  * Copyright (C) 2016 Noralf Trønnes
4  */
5 
6 #ifndef __LINUX_DRM_FORMAT_HELPER_H
7 #define __LINUX_DRM_FORMAT_HELPER_H
8 
9 struct drm_framebuffer;
10 struct drm_rect;
11 
12 void drm_fb_memcpy(void *dst, void *vaddr, struct drm_framebuffer *fb,
13 		   struct drm_rect *clip);
14 void drm_fb_memcpy_dstclip(void __iomem *dst, unsigned int dst_pitch, void *vaddr,
15 			   struct drm_framebuffer *fb,
16 			   struct drm_rect *clip);
17 void drm_fb_swab(void *dst, void *src, struct drm_framebuffer *fb,
18 		 struct drm_rect *clip, bool cached);
19 void drm_fb_xrgb8888_to_rgb332(void *dst, void *vaddr, struct drm_framebuffer *fb,
20 			       struct drm_rect *clip);
21 void drm_fb_xrgb8888_to_rgb565(void *dst, void *vaddr,
22 			       struct drm_framebuffer *fb,
23 			       struct drm_rect *clip, bool swab);
24 void drm_fb_xrgb8888_to_rgb565_dstclip(void __iomem *dst, unsigned int dst_pitch,
25 				       void *vaddr, struct drm_framebuffer *fb,
26 				       struct drm_rect *clip, bool swab);
27 void drm_fb_xrgb8888_to_rgb888(void *dst, void *src, struct drm_framebuffer *fb,
28 			       struct drm_rect *clip);
29 void drm_fb_xrgb8888_to_rgb888_dstclip(void __iomem *dst, unsigned int dst_pitch,
30 				       void *vaddr, struct drm_framebuffer *fb,
31 				       struct drm_rect *clip);
32 void drm_fb_xrgb8888_to_gray8(u8 *dst, void *vaddr, struct drm_framebuffer *fb,
33 			      struct drm_rect *clip);
34 
35 int drm_fb_blit_rect_dstclip(void __iomem *dst, unsigned int dst_pitch,
36 			     uint32_t dst_format, void *vmap,
37 			     struct drm_framebuffer *fb,
38 			     struct drm_rect *rect);
39 int drm_fb_blit_dstclip(void __iomem *dst, unsigned int dst_pitch,
40 			uint32_t dst_format, void *vmap,
41 			struct drm_framebuffer *fb);
42 
43 #endif /* __LINUX_DRM_FORMAT_HELPER_H */
44