1
2#ifndef _WINSYS_HANDLE_H_
3#define _WINSYS_HANDLE_H_
4
5#ifdef __cplusplus
6extern "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
14/**
15 * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
16 */
17struct winsys_handle
18{
19   /**
20    * Input for texture_from_handle, valid values are
21    * WINSYS_HANDLE_TYPE_SHARED or WINSYS_HANDLE_TYPE_FD.
22    * Input to texture_get_handle,
23    * to select handle for kms, flink, or prime.
24    */
25   unsigned type;
26   /**
27    * Input for texture_get_handle, allows to export the offset
28    * of a specific layer of an array texture.
29    */
30   unsigned layer;
31   /**
32    * Input to texture_from_handle.
33    * Output for texture_get_handle.
34    */
35   unsigned handle;
36   /**
37    * Input to texture_from_handle.
38    * Output for texture_get_handle.
39    */
40   unsigned stride;
41   /**
42    * Input to texture_from_handle.
43    * Output for texture_get_handle.
44    */
45   unsigned offset;
46
47   /**
48    * Input to resource_from_handle.
49    * Output from resource_get_handle.
50    */
51   uint64_t modifier;
52};
53
54#ifdef __cplusplus
55}
56#endif
57
58#endif /* _WINSYS_HANDLE_H_ */
59