hc
2024-08-12 233ab1bd4c5697f5cdec94e60206e8c6ac609b4c
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/*
 * This confidential and proprietary software may be used only as
 * authorised by a licensing agreement from ARM Limited
 * (C) COPYRIGHT 2014-2015 ARM Limited
 * ALL RIGHTS RESERVED
 * The entire notice above must be reproduced on all authorised
 * copies and copies may only be made to the extent permitted
 * by a licensing agreement from ARM Limited.
 */
#ifndef _MALI_FBDEV_TYPES_H_
#define _MALI_FBDEV_TYPES_H_
 
typedef struct fbdev_window
{
   unsigned short width;
   unsigned short height;
} fbdev_window;
 
typedef struct mali_native_window
{
   unsigned short width;
   unsigned short height;
} mali_native_window;
 
typedef union mem_handle
{
   int fd;                    /* fd to dma memory */
} mem_handle;
 
typedef struct egl_linux_pixmap
{
   int width, height;
 
   struct
   {
       /** @brief The line stride of each plane.
        * For each plane required by the format, the number of bytes from one line of samples to the next. Other entries in
        * the array should be 0.
        */
       khronos_usize_t stride;
       /** @brief The byte size of each plane.
        * For each plane required by the format, the number of bytes taken up by that plane. That includes any space wasted
        * in partially-used blocks.
        */
       khronos_usize_t size;
       /** @brief The offset from the memory handle to each plane.
        * For each plane required by the format, the number of bytes from the start of the UMP region to the start of that
        * plane. Other entries in the array should be 0.
        */
       khronos_usize_t offset;
   }
   planes[3];
 
   /** An integer that specifies the format of the pixmap. Its meaning is known by tpi and winsys. */
   uint64_t pixmap_format;
 
   /** Three buffers that can be used by this pixmap. In case of RGB pixmap only the first one is going to be
    * used. In case of YUV pixmap all three of them can be used for storing Y, U and V color coordinates separately.*/
   mem_handle handles[3];
} egl_linux_pixmap;
 
typedef struct dummy_display
{
   int width;
   int height;
   int bytes_per_pixel;
   int red_mask;
   int green_mask;
   int blue_mask;
   int alpha_mask;
   unsigned char *front_buffer;
} dummy_display;
 
/** Converts a pixmap ID to the corresponding pixmap structure.
 *
 * @param[in] id The pixmap ID to lookup
 *
 * @return A pointer to the pixmap structure or NULL on failure
 */
egl_linux_pixmap* egl_lookup_pixmap_ID_mapping(int32_t id);
 
/** Creates a pixmap ID from a pixmap structure.
 *
 * @param[in] pixmap
 *
 * @return The pixmap ID or -1 on failure
 */
int32_t egl_create_pixmap_ID_mapping(egl_linux_pixmap* pixmap);
 
/** Destroy a pixmap ID to pixmap structure mapping. The caller is responsible for
 *  destroying the pixmap structure.
 *
 * @param[in] id The pixmap ID for which the corresponding
 *               mapping should be destroyed
 *
 * @return EGL_TRUE on success or EGL_FALSE on failure
 */
unsigned int egl_destroy_pixmap_ID_mapping(int32_t id);
 
#endif /* _MALI_FBDEV_TYPES_H_ */