summaryrefslogtreecommitdiff
path: root/bsp/allwinner/libraries/libos/include/video/sunxi_metadata.h
blob: 7efb1c20a3f1ed416c91f0dfdc28fc3fb0354fbf (plain)
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/*
 * Allwinner SoCs display driver.
 *
 * Copyright (C) 2016 Allwinner.
 *
 * This file is licensed under the terms of the GNU General Public
 * License version 2.  This program is licensed "as is" without any
 * warranty of any kind, whether express or implied.
 */
#ifndef __SUNXI_METADATA_H__
#define __SUNXI_METADATA_H__

enum {
    /* hdr static metadata is available */
    SUNXI_METADATA_FLAG_HDR_SATIC_METADATA   = 0x00000001,
    /* hdr dynamic metadata is available */
    SUNXI_METADATA_FLAG_HDR_DYNAMIC_METADATA = 0x00000002,

    /* afbc header data is available */
    SUNXI_METADATA_FLAG_AFBC_HEADER          = 0x00000010,
};

struct afbc_header {
    u32 signature;
    u16 filehdr_size;
    u16 version;
    u32 body_size;
    u8 ncomponents;
    u8 header_layout;
    u8 yuv_transform;
    u8 block_split;
    u8 inputbits[4];
    u16 block_width;
    u16 block_height;
    u16 width;
    u16 height;
    u8  left_crop;
    u8  top_crop;
    u16 block_layout;
};

struct display_master_data {
    /* display primaries */
    u16 display_primaries_x[3];
    u16 display_primaries_y[3];

    /* white_point */
    u16 white_point_x;
    u16 white_point_y;

    /* max/min display mastering luminance */
    u32 max_display_mastering_luminance;
    u32 min_display_mastering_luminance;
};

/* static metadata type 1 */
struct hdr_static_metadata {
    struct display_master_data disp_master;

    u16 maximum_content_light_level;
    u16 maximum_frame_average_light_level;
};

/* sunxi video metadata for ve and de */
struct sunxi_metadata {
    struct hdr_static_metadata hdr_smetada;
    struct afbc_header afbc_head;
};

#endif /* #ifndef __SUNXI_METADATA_H__ */