summaryrefslogtreecommitdiff
path: root/src/gallium/winsys/common/intel_drm/intel_be_device.h
blob: ec5cace71c8d384bfd41b85c957b012f49f75fde (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
#ifndef INTEL_DRM_DEVICE_H
#define INTEL_DRM_DEVICE_H

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

/*
 * Device
 */

struct intel_be_device
{
	struct pipe_winsys base;

	int fd; /**< Drm file discriptor */

	size_t max_batch_size;
	size_t max_vertex_size;

	struct _DriFenceMgr *fenceMgr;

	struct _DriBufferPool *batchPool;
	struct _DriBufferPool *regionPool;
	struct _DriBufferPool *mallocPool;
	struct _DriBufferPool *vertexPool;
	struct _DriBufferPool *staticPool;
	struct _DriFreeSlabManager *fMan;
};

boolean
intel_be_init_device(struct intel_be_device *device, int fd);

void
intel_be_destroy_device(struct intel_be_device *dev);

/*
 * Buffer
 */

struct intel_be_buffer {
	struct pipe_buffer base;
	struct _DriBufferPool *pool;
	struct _DriBufferObject *driBO;
};

static INLINE struct intel_be_buffer *
intel_be_buffer( struct pipe_buffer *buf )
{
	return (struct intel_be_buffer *)buf;
}

static INLINE struct _DriBufferObject *
dri_bo( struct pipe_buffer *buf )
{
	return intel_be_buffer(buf)->driBO;
}

#endif