~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/drm/drm_format_helper.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  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 #include <linux/types.h>
 10 
 11 struct drm_device;
 12 struct drm_format_info;
 13 struct drm_framebuffer;
 14 struct drm_rect;
 15 
 16 struct iosys_map;
 17 
 18 /**
 19  * struct drm_format_conv_state - Stores format-conversion state
 20  *
 21  * DRM helpers for format conversion store temporary state in
 22  * struct drm_xfrm_buf. The buffer's resources can be reused
 23  * among multiple conversion operations.
 24  *
 25  * All fields are considered private.
 26  */
 27 struct drm_format_conv_state {
 28         /* private: */
 29         struct {
 30                 void *mem;
 31                 size_t size;
 32                 bool preallocated;
 33         } tmp;
 34 };
 35 
 36 #define __DRM_FORMAT_CONV_STATE_INIT(_mem, _size, _preallocated) { \
 37                 .tmp = { \
 38                         .mem = (_mem), \
 39                         .size = (_size), \
 40                         .preallocated = (_preallocated), \
 41                 } \
 42         }
 43 
 44 /**
 45  * DRM_FORMAT_CONV_STATE_INIT - Initializer for struct drm_format_conv_state
 46  *
 47  * Initializes an instance of struct drm_format_conv_state to default values.
 48  */
 49 #define DRM_FORMAT_CONV_STATE_INIT \
 50         __DRM_FORMAT_CONV_STATE_INIT(NULL, 0, false)
 51 
 52 /**
 53  * DRM_FORMAT_CONV_STATE_INIT_PREALLOCATED - Initializer for struct drm_format_conv_state
 54  * @_mem: The preallocated memory area
 55  * @_size: The number of bytes in _mem
 56  *
 57  * Initializes an instance of struct drm_format_conv_state to preallocated
 58  * storage. The caller is responsible for releasing the provided memory range.
 59  */
 60 #define DRM_FORMAT_CONV_STATE_INIT_PREALLOCATED(_mem, _size) \
 61         __DRM_FORMAT_CONV_STATE_INIT(_mem, _size, true)
 62 
 63 void drm_format_conv_state_init(struct drm_format_conv_state *state);
 64 void drm_format_conv_state_copy(struct drm_format_conv_state *state,
 65                                 const struct drm_format_conv_state *old_state);
 66 void *drm_format_conv_state_reserve(struct drm_format_conv_state *state,
 67                                     size_t new_size, gfp_t flags);
 68 void drm_format_conv_state_release(struct drm_format_conv_state *state);
 69 
 70 unsigned int drm_fb_clip_offset(unsigned int pitch, const struct drm_format_info *format,
 71                                 const struct drm_rect *clip);
 72 
 73 void drm_fb_memcpy(struct iosys_map *dst, const unsigned int *dst_pitch,
 74                    const struct iosys_map *src, const struct drm_framebuffer *fb,
 75                    const struct drm_rect *clip);
 76 void drm_fb_swab(struct iosys_map *dst, const unsigned int *dst_pitch,
 77                  const struct iosys_map *src, const struct drm_framebuffer *fb,
 78                  const struct drm_rect *clip, bool cached,
 79                  struct drm_format_conv_state *state);
 80 void drm_fb_xrgb8888_to_rgb332(struct iosys_map *dst, const unsigned int *dst_pitch,
 81                                const struct iosys_map *src, const struct drm_framebuffer *fb,
 82                                const struct drm_rect *clip, struct drm_format_conv_state *state);
 83 void drm_fb_xrgb8888_to_rgb565(struct iosys_map *dst, const unsigned int *dst_pitch,
 84                                const struct iosys_map *src, const struct drm_framebuffer *fb,
 85                                const struct drm_rect *clip, struct drm_format_conv_state *state,
 86                                bool swab);
 87 void drm_fb_xrgb8888_to_xrgb1555(struct iosys_map *dst, const unsigned int *dst_pitch,
 88                                  const struct iosys_map *src, const struct drm_framebuffer *fb,
 89                                  const struct drm_rect *clip, struct drm_format_conv_state *state);
 90 void drm_fb_xrgb8888_to_argb1555(struct iosys_map *dst, const unsigned int *dst_pitch,
 91                                  const struct iosys_map *src, const struct drm_framebuffer *fb,
 92                                  const struct drm_rect *clip, struct drm_format_conv_state *state);
 93 void drm_fb_xrgb8888_to_rgba5551(struct iosys_map *dst, const unsigned int *dst_pitch,
 94                                  const struct iosys_map *src, const struct drm_framebuffer *fb,
 95                                  const struct drm_rect *clip, struct drm_format_conv_state *state);
 96 void drm_fb_xrgb8888_to_rgb888(struct iosys_map *dst, const unsigned int *dst_pitch,
 97                                const struct iosys_map *src, const struct drm_framebuffer *fb,
 98                                const struct drm_rect *clip, struct drm_format_conv_state *state);
 99 void drm_fb_xrgb8888_to_argb8888(struct iosys_map *dst, const unsigned int *dst_pitch,
100                                  const struct iosys_map *src, const struct drm_framebuffer *fb,
101                                  const struct drm_rect *clip, struct drm_format_conv_state *state);
102 void drm_fb_xrgb8888_to_xrgb2101010(struct iosys_map *dst, const unsigned int *dst_pitch,
103                                     const struct iosys_map *src, const struct drm_framebuffer *fb,
104                                     const struct drm_rect *clip,
105                                     struct drm_format_conv_state *state);
106 void drm_fb_xrgb8888_to_argb2101010(struct iosys_map *dst, const unsigned int *dst_pitch,
107                                     const struct iosys_map *src, const struct drm_framebuffer *fb,
108                                     const struct drm_rect *clip,
109                                     struct drm_format_conv_state *state);
110 void drm_fb_xrgb8888_to_gray8(struct iosys_map *dst, const unsigned int *dst_pitch,
111                               const struct iosys_map *src, const struct drm_framebuffer *fb,
112                               const struct drm_rect *clip, struct drm_format_conv_state *state);
113 
114 int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format,
115                 const struct iosys_map *src, const struct drm_framebuffer *fb,
116                 const struct drm_rect *clip, struct drm_format_conv_state *state);
117 
118 void drm_fb_xrgb8888_to_mono(struct iosys_map *dst, const unsigned int *dst_pitch,
119                              const struct iosys_map *src, const struct drm_framebuffer *fb,
120                              const struct drm_rect *clip, struct drm_format_conv_state *state);
121 
122 size_t drm_fb_build_fourcc_list(struct drm_device *dev,
123                                 const u32 *native_fourccs, size_t native_nfourccs,
124                                 u32 *fourccs_out, size_t nfourccs_out);
125 
126 #endif /* __LINUX_DRM_FORMAT_HELPER_H */
127 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php