1 #ifndef INTEL_DRM_DEVICE_H
2 #define INTEL_DRM_DEVICE_H
4 #include "pipe/internal/p_winsys_screen.h"
5 #include "pipe/p_context.h"
11 struct intel_be_device
13 struct pipe_winsys base
;
18 struct pipe_screen
*screen
;
20 int fd
; /**< Drm file discriptor */
22 size_t max_batch_size
;
23 size_t max_vertex_size
;
25 struct _DriFenceMgr
*fenceMgr
;
27 struct _DriBufferPool
*batchPool
;
28 struct _DriBufferPool
*regionPool
;
29 struct _DriBufferPool
*mallocPool
;
30 struct _DriBufferPool
*vertexPool
;
31 struct _DriBufferPool
*staticPool
;
32 struct _DriFreeSlabManager
*fMan
;
36 intel_be_init_device(struct intel_be_device
*device
, int fd
, unsigned id
);
39 intel_be_destroy_device(struct intel_be_device
*dev
);
45 struct intel_be_buffer
{
46 struct pipe_buffer base
;
47 struct _DriBufferPool
*pool
;
48 struct _DriBufferObject
*driBO
;
52 * Create a be buffer from a drm bo handle
57 intel_be_buffer_from_handle(struct intel_be_device
*device
,
58 const char* name
, unsigned handle
);
60 static INLINE
struct intel_be_buffer
*
61 intel_be_buffer(struct pipe_buffer
*buf
)
63 return (struct intel_be_buffer
*)buf
;
66 static INLINE
struct _DriBufferObject
*
67 dri_bo(struct pipe_buffer
*buf
)
69 return intel_be_buffer(buf
)->driBO
;