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