blob: 39f02007be5e49bf3782e563b42d2f219aeeea84 [file] [log] [blame]
b.liue9582032025-04-17 19:18:16 +08001#ifndef _LCD_FNS_H_
2#define _LCD_FNS_H_
3
4#define STRIDE_ALIGN 16
5#define WIDE_ALIGN(value, base) (((value) + ((base) - 1)) & ~((base) - 1))
6
7enum image_pattern {
8 IMG_PATTERN_RED = 0,
9 IMG_PATTERN_GREEN,
10 IMG_PATTERN_BLUE,
11 IMG_PATTERN_WHITE,
12 IMG_PATTERN_HCB_5,
13 IMG_PATTERN_HCB_2,
14 IMG_PATTERN_VCB_5,
15 IMG_PATTERN_VCB_2,
16 IMG_PATTERN_LINE,
17 IMG_PATTERN_GREY_LEVEL,
18 IMG_PATTERN_AFBC_RGB,
19 IMG_PATTERN_AFBC_YUV,
20 IMG_PATTERN_MAX
21};
22
23struct s_compose_layer_setting {
24 unsigned int addr;
25 unsigned char format;
26 unsigned char alpha_sel;
27 unsigned char layer_en;
28 unsigned char layer_alpha;
29 unsigned int stride;
30};
31
32struct s_compose_setting {
33 unsigned int width;
34 unsigned int height;
35 struct s_compose_layer_setting layer_setting[3];
36 unsigned int dest_addr;
37 unsigned int dest_stride;
38 unsigned char dest_format;
39 unsigned char alpha_mode;
40 unsigned int reserved;
41};
42
43int get_format_plane(unsigned int format);
44int get_format_bpp(unsigned int format);
45int is_format_yuv(unsigned int format);
46int get_uv_height_dividor(unsigned int format);
47
48int lcd_draw_images(unsigned int addr_p1, unsigned int *addr_p2, unsigned int *addr_p3,
49 unsigned int format, unsigned int pattern, unsigned int width,
50 unsigned int height, unsigned int *stride_p1, unsigned int *stride_p2,
51 unsigned int *stride_p3);
52int lcd_compare_buffers(unsigned int src, unsigned int dest, unsigned int width,
53 unsigned int height, unsigned int stride_src, unsigned int stride_dest,
54 unsigned int format, int log);
55int lcd_compare_compose_buffer(struct s_compose_setting *compose_setting, int log);
56
57#endif /*_LCD_FNS_H_*/