diff options
Diffstat (limited to 'src/gallium/winsys/drm/intel/gem/intel_be_device.h')
-rw-r--r-- | src/gallium/winsys/drm/intel/gem/intel_be_device.h | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/src/gallium/winsys/drm/intel/gem/intel_be_device.h b/src/gallium/winsys/drm/intel/gem/intel_be_device.h index f06890163c..47d2176cb4 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_be_device.h +++ b/src/gallium/winsys/drm/intel/gem/intel_be_device.h @@ -18,6 +18,8 @@ struct intel_be_device int fd; /**< Drm file discriptor */ + unsigned id; + size_t max_batch_size; size_t max_vertex_size; @@ -26,12 +28,15 @@ struct intel_be_device } pools; }; +static INLINE struct intel_be_device * +intel_be_device(struct pipe_winsys *winsys) +{ + return (struct intel_be_device *)winsys; +} + boolean intel_be_init_device(struct intel_be_device *device, int fd, unsigned id); -void -intel_be_destroy_device(struct intel_be_device *dev); - /* * Buffer */ @@ -39,6 +44,8 @@ intel_be_destroy_device(struct intel_be_device *dev); struct intel_be_buffer { struct pipe_buffer base; drm_intel_bo *bo; + boolean flinked; + unsigned flink; }; /** @@ -47,7 +54,7 @@ struct intel_be_buffer { * Takes a reference. */ struct pipe_buffer * -intel_be_buffer_from_handle(struct pipe_winsys *winsys, +intel_be_buffer_from_handle(struct pipe_screen *screen, const char* name, unsigned handle); /** @@ -55,9 +62,20 @@ intel_be_buffer_from_handle(struct pipe_winsys *winsys, * * If buffer is destroyed handle may become invalid. */ -unsigned -intel_be_handle_from_buffer(struct pipe_winsys *winsys, - struct pipe_buffer *buffer); +boolean +intel_be_handle_from_buffer(struct pipe_screen *screen, + struct pipe_buffer *buffer, + unsigned *handle); + +/** + * Gets the global handle from a buffer. + * + * If buffer is destroyed handle may become invalid. + */ +boolean +intel_be_global_handle_from_buffer(struct pipe_screen *screen, + struct pipe_buffer *buffer, + unsigned *handle); static INLINE struct intel_be_buffer * intel_be_buffer(struct pipe_buffer *buf) |