• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 
2 #ifndef _WINSYS_HANDLE_H_
3 #define _WINSYS_HANDLE_H_
4 
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8 
9 #define WINSYS_HANDLE_TYPE_SHARED 0
10 #define WINSYS_HANDLE_TYPE_KMS    1
11 #define WINSYS_HANDLE_TYPE_FD     2
12 #define WINSYS_HANDLE_TYPE_SHMID   3
13 #define WINSYS_HANDLE_TYPE_D3D12_RES 4
14 
15 /**
16  * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
17  */
18 struct winsys_handle
19 {
20    /**
21     * Input for texture_from_handle, valid values are
22     * WINSYS_HANDLE_TYPE_SHARED or WINSYS_HANDLE_TYPE_FD.
23     * Input to texture_get_handle,
24     * to select handle for kms, flink, or prime.
25     */
26    unsigned type;
27    /**
28     * Input for texture_get_handle, allows to export the offset
29     * of a specific layer of an array texture.
30     */
31    unsigned layer;
32    /**
33     * Input for texture_get_handle, allows to export of a specific plane of a
34     * texture.
35     */
36    unsigned plane;
37    /**
38     * Input to texture_from_handle.
39     * Output for texture_get_handle.
40     */
41    unsigned handle;
42    /**
43     * Input to texture_from_handle.
44     * Output for texture_get_handle.
45     */
46    unsigned stride;
47    /**
48     * Input to texture_from_handle.
49     * Output for texture_get_handle.
50     */
51    unsigned offset;
52 
53    /**
54     * Input to resource_from_handle.
55     * Output from resource_get_handle.
56     */
57    uint64_t format;
58 
59    /**
60     * Input to resource_from_handle.
61     * Output from resource_get_handle.
62     */
63    uint64_t modifier;
64 
65    /**
66     * Input to resource_from_handle.
67     * Output for resource_get_handle.
68     */
69    void *com_obj;
70 };
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif /* _WINSYS_HANDLE_H_ */
77