Merge commit 'origin/gallium-master-merge'
[mesa.git] / src / gallium / winsys / drm / intel / gem / intel_be_context.h
1
2 #ifndef INTEL_BE_CONTEXT_H
3 #define INTEL_BE_CONTEXT_H
4
5 #include "i915simple/i915_winsys.h"
6
7 struct intel_be_context
8 {
9 /** Interface to i915simple driver */
10 struct i915_winsys base;
11
12 struct intel_be_device *device;
13 struct intel_be_batchbuffer *batch;
14
15 /*
16 * Hardware lock functions.
17 *
18 * Needs to be filled in by the winsys.
19 */
20 void (*hardware_lock)(struct intel_be_context *context);
21 void (*hardware_unlock)(struct intel_be_context *context);
22 boolean (*hardware_locked)(struct intel_be_context *context);
23 };
24
25 static INLINE struct intel_be_context *
26 intel_be_context(struct i915_winsys *sws)
27 {
28 return (struct intel_be_context *)sws;
29 }
30
31 /**
32 * Intialize a allocated intel_be_context struct.
33 *
34 * Remember to set the hardware_* functions.
35 */
36 boolean
37 intel_be_init_context(struct intel_be_context *intel,
38 struct intel_be_device *device);
39
40 /**
41 * Destroy a intel_be_context.
42 *
43 * Does not free the struct that is up to the winsys.
44 */
45 void
46 intel_be_destroy_context(struct intel_be_context *intel);
47
48 #endif