2019-05-27 06:55:01 +00:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2019-04-05 09:52:15 +00:00
|
|
|
/*
|
|
|
|
* Copyright (C) 2016 Noralf Trønnes
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __LINUX_DRM_FORMAT_HELPER_H
|
|
|
|
#define __LINUX_DRM_FORMAT_HELPER_H
|
|
|
|
|
2022-09-05 14:16:48 +00:00
|
|
|
#include <linux/types.h>
|
|
|
|
|
|
|
|
struct drm_device;
|
2021-11-10 10:36:54 +00:00
|
|
|
struct drm_format_info;
|
2019-04-05 09:52:15 +00:00
|
|
|
struct drm_framebuffer;
|
|
|
|
struct drm_rect;
|
|
|
|
|
2022-09-05 14:16:48 +00:00
|
|
|
struct iosys_map;
|
|
|
|
|
2021-11-10 10:36:54 +00:00
|
|
|
unsigned int drm_fb_clip_offset(unsigned int pitch, const struct drm_format_info *format,
|
|
|
|
const struct drm_rect *clip);
|
|
|
|
|
2022-08-08 12:53:55 +00:00
|
|
|
void drm_fb_memcpy(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:53:55 +00:00
|
|
|
const struct drm_rect *clip);
|
2022-08-08 12:53:56 +00:00
|
|
|
void drm_fb_swab(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:53:56 +00:00
|
|
|
const struct drm_rect *clip, bool cached);
|
2022-08-08 12:53:57 +00:00
|
|
|
void drm_fb_xrgb8888_to_rgb332(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:53:57 +00:00
|
|
|
const struct drm_rect *clip);
|
2022-08-08 12:53:58 +00:00
|
|
|
void drm_fb_xrgb8888_to_rgb565(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:53:58 +00:00
|
|
|
const struct drm_rect *clip, bool swab);
|
2022-08-08 12:53:59 +00:00
|
|
|
void drm_fb_xrgb8888_to_rgb888(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:53:59 +00:00
|
|
|
const struct drm_rect *clip);
|
2023-01-02 11:29:21 +00:00
|
|
|
void drm_fb_xrgb8888_to_argb8888(struct iosys_map *dst, const unsigned int *dst_pitch,
|
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
|
|
|
const struct drm_rect *clip);
|
2022-08-08 12:54:02 +00:00
|
|
|
void drm_fb_xrgb8888_to_xrgb2101010(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:54:02 +00:00
|
|
|
const struct drm_rect *clip);
|
2023-01-02 11:29:22 +00:00
|
|
|
void drm_fb_xrgb8888_to_argb2101010(struct iosys_map *dst, const unsigned int *dst_pitch,
|
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
|
|
|
const struct drm_rect *clip);
|
2022-08-08 12:54:03 +00:00
|
|
|
void drm_fb_xrgb8888_to_gray8(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:54:03 +00:00
|
|
|
const struct drm_rect *clip);
|
2019-04-05 09:52:15 +00:00
|
|
|
|
2022-08-08 12:53:54 +00:00
|
|
|
int drm_fb_blit(struct iosys_map *dst, const unsigned int *dst_pitch, uint32_t dst_format,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:53:54 +00:00
|
|
|
const struct drm_rect *rect);
|
2021-04-30 10:58:33 +00:00
|
|
|
|
2022-08-08 12:54:04 +00:00
|
|
|
void drm_fb_xrgb8888_to_mono(struct iosys_map *dst, const unsigned int *dst_pitch,
|
2022-08-08 12:54:06 +00:00
|
|
|
const struct iosys_map *src, const struct drm_framebuffer *fb,
|
2022-08-08 12:54:04 +00:00
|
|
|
const struct drm_rect *clip);
|
2022-02-14 13:37:06 +00:00
|
|
|
|
2022-09-05 14:16:48 +00:00
|
|
|
size_t drm_fb_build_fourcc_list(struct drm_device *dev,
|
|
|
|
const u32 *native_fourccs, size_t native_nfourccs,
|
|
|
|
const u32 *extra_fourccs, size_t extra_nfourccs,
|
|
|
|
u32 *fourccs_out, size_t nfourccs_out);
|
|
|
|
|
2019-04-05 09:52:15 +00:00
|
|
|
#endif /* __LINUX_DRM_FORMAT_HELPER_H */
|