summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/drm/intel/gem/intel_be_context.h
blob: 9cee1a4e52bef4352ca801c2a03d5eff52e3e6a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48

#ifndef INTEL_BE_CONTEXT_H
#define INTEL_BE_CONTEXT_H

#include "i915simple/i915_winsys.h"

struct intel_be_context
{
	/** Interface to i915simple driver */
	struct i915_winsys base;

	struct intel_be_device *device;
	struct intel_be_batchbuffer *batch;

	/*
	 * Hardware lock functions.
	 *
	 * Needs to be filled in by the winsys.
	 */
	void (*hardware_lock)(struct intel_be_context *context);
	void (*hardware_unlock)(struct intel_be_context *context);
	boolean (*hardware_locked)(struct intel_be_context *context);
};

static INLINE struct intel_be_context *
intel_be_context(struct i915_winsys *sws)
{
	return (struct intel_be_context *)sws;
}

/**
 * Intialize a allocated intel_be_context struct.
 *
 * Remember to set the hardware_* functions.
 */
boolean
intel_be_init_context(struct intel_be_context *intel,
		      struct intel_be_device *device);

/**
 * Destroy a intel_be_context.
 *
 * Does not free the struct that is up to the winsys.
 */
void
intel_be_destroy_context(struct intel_be_context *intel);

#endif