summaryrefslogtreecommitdiff
path: root/src/gallium/state_trackers/g3dvl/vl_screen.c
blob: 484f63b0d4d4b19251bf92db9e4fdceb3ea024b9 (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#define VL_INTERNAL
#include "vl_screen.h"
#include <assert.h>
#include <stdlib.h>

int vlCreateScreen
(
	struct vlDisplay *display,
	int screen,
	struct pipe_screen *pscreen,
	struct vlScreen **vl_screen
)
{
	struct vlScreen *scrn;

	assert(display);
	assert(pscreen);
	assert(vl_screen);

	scrn = calloc(1, sizeof(struct vlScreen));

	if (!scrn)
		return 1;

	scrn->display = display;
	scrn->ordinal = screen;
	scrn->pscreen = pscreen;
	*vl_screen = scrn;

	return 0;
}

int vlDestroyScreen
(
	struct vlScreen *screen
)
{
	assert(screen);

	free(screen);

	return 0;
}

struct vlDisplay* vlGetDisplay
(
	struct vlScreen *screen
)
{
	assert(screen);

	return screen->display;
}

struct pipe_screen* vlGetPipeScreen
(
	struct vlScreen *screen
)
{
	assert(screen);

	return screen->pscreen;
}

unsigned int vlGetMaxProfiles
(
	struct vlScreen *screen
)
{
	assert(screen);

	return vlProfileCount;
}

int vlQueryProfiles
(
	struct vlScreen *screen,
	enum vlProfile *profiles
)
{
	assert(screen);
	assert(profiles);

	profiles[0] = vlProfileMpeg2Simple;
	profiles[1] = vlProfileMpeg2Main;

	return 0;
}

unsigned int vlGetMaxEntryPoints
(
	struct vlScreen *screen
)
{
	assert(screen);

	return vlEntryPointCount;
}

int vlQueryEntryPoints
(
	struct vlScreen *screen,
	enum vlProfile profile,
	enum vlEntryPoint *entry_points
)
{
	assert(screen);
	assert(entry_points);

	entry_points[0] = vlEntryPointIDCT;
	entry_points[1] = vlEntryPointMC;
	entry_points[2] = vlEntryPointCSC;

	return 0;
}