aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/winsys/drm/intel/egl/intel_context.c
blob: 57e5ff7bc120c0da6634a99727a727e16bc602b9 (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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83

#include "i915simple/i915_screen.h"

#include "intel_be_device.h"
#include "intel_be_context.h"

#include "pipe/p_defines.h"
#include "pipe/p_context.h"

#include "intel_api.h"

struct intel_context
{
	struct intel_be_context base;

	/* stuff */
};

/*
 * Hardware lock functions.
 * Doesn't do anything in EGL
 */

static void
intel_lock_hardware(struct intel_be_context *context)
{
	(void)context;
}

static void
intel_unlock_hardware(struct intel_be_context *context)
{
	(void)context;
}

static boolean
intel_locked_hardware(struct intel_be_context *context)
{
	(void)context;
	return FALSE;
}


/*
 * Misc functions.
 */
static void
intel_destroy_be_context(struct i915_winsys *winsys)
{
	struct intel_context *intel = (struct intel_context *)winsys;

	intel_be_destroy_context(&intel->base);
	free(intel);
}

struct pipe_context *
intel_create_context(struct pipe_screen *screen)
{
	struct intel_context *intel;
	struct pipe_context *pipe;
	struct intel_be_device *device = (struct intel_be_device *)screen->winsys;

	intel = (struct intel_context *)malloc(sizeof(*intel));
	memset(intel, 0, sizeof(*intel));

	intel->base.hardware_lock = intel_lock_hardware;
	intel->base.hardware_unlock = intel_unlock_hardware;
	intel->base.hardware_locked = intel_locked_hardware;

	intel_be_init_context(&intel->base, device);

	intel->base.base.destroy = intel_destroy_be_context;

#if 0
	pipe = intel_create_softpipe(intel, screen->winsys);
#else
	pipe = i915_create_context(screen, &device->base, &intel->base.base);
#endif

	pipe->priv = intel;

	return pipe;
}