Subversion Repositories Kolibri OS

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
3770 Serge 1
 
2
#define _DRM_DRIVER_H_
3
4
 
5
6
 
7
struct pipe_context;
8
struct pipe_resource;
9
10
 
11
#define DRM_API_HANDLE_TYPE_KMS    1
12
13
 
14
 * For use with pipe_screen::{texture_from_handle|texture_get_handle}.
15
 */
16
struct winsys_handle
17
{
18
   /**
19
    * Unused for texture_from_handle, always
20
    * DRM_API_HANDLE_TYPE_SHARED.  Input to texture_get_handle,
21
    * use TEXTURE_USAGE to select handle for kms or ipc.
22
    */
23
   unsigned type;
24
   /**
25
    * Input to texture_from_handle.
26
    * Output for texture_get_handle.
27
    */
28
   unsigned handle;
29
   /**
30
    * Input to texture_from_handle.
31
    * Output for texture_get_handle.
32
    */
33
   unsigned stride;
34
};
35
36
 
37
 
38
 
39
 * Configuration queries.
40
 */
41
enum drm_conf {
42
   /* How many frames to allow before throttling. Or -1 to indicate any number */
43
   DRM_CONF_THROTTLE, /* DRM_CONF_INT. */
44
   DRM_CONF_MAX
45
};
46
47
 
48
 * Type of configuration answer
49
 */
50
enum drm_conf_type {
51
   DRM_CONF_INT,
52
   DRM_CONF_BOOL,
53
   DRM_CONF_FLOAT,
54
   DRM_CONF_POINTER
55
};
56
57
 
58
 * Return value from the configuration function.
59
 */
60
struct drm_conf_ret {
61
   enum drm_conf_type type;
62
   union {
63
      int val_int;
64
      bool val_bool;
65
      float val_float;
66
      void *val_pointer;
67
   } val;
68
};
69
70
 
71
{
72
   /**
73
    * Identifying sufix/prefix of the binary, used by egl.
74
    */
75
   const char *name;
76
77
 
78
    * Kernel driver name, as accepted by drmOpenByName.
79
    */
80
   const char *driver_name;
81
82
 
83
    * Create a pipe srcreen.
84
    *
85
    * This function does any wrapping of the screen.
86
    * For example wrapping trace or rbug debugging drivers around it.
87
    */
88
   struct pipe_screen* (*create_screen)(int drm_fd);
89
90
 
91
 
92
    * Return a configuration value.
93
    *
94
    * If this function is NULL, or if it returns NULL
95
    * the state tracker- or state
96
    * tracker manager should provide a reasonable default value.
97
    */
98
   const struct drm_conf_ret *(*configuration) (enum drm_conf conf);
99
};
100
101
 
102
103
 
104
 * Instantiate a drm_driver_descriptor struct.
105
 */
106
#define DRM_DRIVER_DESCRIPTOR(name_str, driver_name_str, func, conf) \
107
struct drm_driver_descriptor driver_descriptor = {             \
108
   .name = name_str,                                           \
109
   .driver_name = driver_name_str,                             \
110
   .create_screen = func,                                      \
111
   .configuration = (conf),				       \
112
};
113
114
 
115