xref: /OK3568_Linux_fs/kernel/drivers/gpu/drm/rockchip/rockchip_drm_display_pattern.h (revision 4882a59341e53eb6f0b4789bf948001014eff981)
1 /* SPDX-License-Identifier: (GPL-2.0+ OR MIT) */
2 /*
3  * Copyright (c) 2022 Rockchip Electronics Co., Ltd.
4  * Author: Sandy Huang <hjc@rock-chips.com>
5  */
6 
7 #ifndef __ROCKCHIP_DRM_DISPLAY_PATTERN_H__
8 #define __ROCKCHIP_DRM_DISPLAY_PATTERN_H__
9 
10 #include <linux/kernel.h>
11 #include <linux/string.h>
12 #include <drm/drm_fourcc.h>
13 
14 struct util_color_component {
15 	unsigned int length;
16 	unsigned int offset;
17 };
18 
19 struct util_rgb_info {
20 	struct util_color_component red;
21 	struct util_color_component green;
22 	struct util_color_component blue;
23 	struct util_color_component alpha;
24 };
25 
26 enum util_yuv_order {
27 	YUV_YCbCr = 1,
28 	YUV_YCrCb = 2,
29 	YUV_YC = 4,
30 	YUV_CY = 8,
31 };
32 
33 struct util_yuv_info {
34 	enum util_yuv_order order;
35 	unsigned int xsub;
36 	unsigned int ysub;
37 	unsigned int chroma_stride;
38 };
39 
40 struct util_format_info {
41 	uint32_t format;
42 	const char *name;
43 	const struct util_rgb_info rgb;
44 	const struct util_yuv_info yuv;
45 };
46 
47 void rockchip_drm_fill_color_bar(uint32_t format,
48 				 void *planes[3], unsigned int width,
49 				 unsigned int height, unsigned int stride);
50 
51 #endif
52