Merge commit 'origin/master' into gallium-map-range
[mesa.git] / src / gallium / include / state_tracker / drm_api.h
1
2 #ifndef _DRM_API_H_
3 #define _DRM_API_H_
4
5 #include "pipe/p_compiler.h"
6
7 struct pipe_screen;
8 struct pipe_winsys;
9 struct pipe_buffer;
10 struct pipe_context;
11 struct pipe_texture;
12
13 struct drm_api
14 {
15 /**
16 * Special buffer functions
17 */
18 /*@{*/
19 struct pipe_screen* (*create_screen)(int drmFB, int pciID);
20 struct pipe_context* (*create_context)(struct pipe_screen *screen);
21 /*@}*/
22
23 /**
24 * Special buffer functions
25 */
26 /*@{*/
27 boolean (*buffer_from_texture)(struct pipe_texture *texture,
28 struct pipe_buffer **buffer,
29 unsigned *stride);
30 struct pipe_buffer* (*buffer_from_handle)(struct pipe_screen *screen,
31 const char *name,
32 unsigned handle);
33 boolean (*handle_from_buffer)(struct pipe_screen *screen,
34 struct pipe_buffer *buffer,
35 unsigned *handle);
36 boolean (*global_handle_from_buffer)(struct pipe_screen *screen,
37 struct pipe_buffer *buffer,
38 unsigned *handle);
39 /*@}*/
40 };
41
42 /**
43 * A driver needs to export this symbol
44 */
45 extern struct drm_api drm_api_hocks;
46
47 #endif