screen->tex_surface_destroy = i915_tex_surface_destroy;
}
-boolean i915_get_texture_buffer( struct drm_api *api,
- struct pipe_texture *texture,
+boolean i915_get_texture_buffer( struct pipe_texture *texture,
struct pipe_buffer **buf,
unsigned *stride )
{
struct pipe_fence_handle;
struct pipe_winsys;
struct pipe_screen;
-struct drm_api;
/**
*
* This is needed for example kms.
*/
-boolean i915_get_texture_buffer( struct drm_api *api,
- struct pipe_texture *texture,
+boolean i915_get_texture_buffer( struct pipe_texture *texture,
struct pipe_buffer **buf,
unsigned *stride );
boolean
-softpipe_get_texture_buffer( struct drm_api *api,
- struct pipe_texture *texture,
+softpipe_get_texture_buffer( struct pipe_texture *texture,
struct pipe_buffer **buf,
unsigned *stride )
{
extern "C" {
#endif
-struct drm_api;
+
struct pipe_screen;
struct pipe_winsys;
struct pipe_context;
boolean
-softpipe_get_texture_buffer( struct drm_api *api,
- struct pipe_texture *texture,
+softpipe_get_texture_buffer( struct pipe_texture *texture,
struct pipe_buffer **buf,
unsigned *stride );
.create_context = intel_be_create_context,
/* intel_be_device.c */
.create_screen = intel_be_create_screen,
- .buffer_from_texture = i915_get_texture_buffer,
+ .buffer_from_texture = intel_be_get_texture_buffer,
.buffer_from_handle = intel_be_buffer_from_handle,
.handle_from_buffer = intel_be_handle_from_buffer,
.global_handle_from_buffer = intel_be_global_handle_from_buffer,
return NULL;
}
+boolean
+intel_be_get_texture_buffer(struct drm_api *api,
+ struct pipe_texture *texture,
+ struct pipe_buffer **buffer,
+ unsigned *stride)
+{
+ struct intel_be_device *dev;
+
+ if (!texture)
+ return FALSE;
+
+ dev = intel_be_device(texture->screen->winsys);
+ if (dev->softpipe)
+ return softpipe_get_texture_buffer(texture, buffer, stride);
+ else
+ return i915_get_texture_buffer(texture, buffer, stride);
+}
+
struct pipe_buffer *
intel_be_buffer_from_handle(struct drm_api *api,
struct pipe_screen *screen,
if (dev->softpipe) {
screen = softpipe_create_screen(&dev->base);
- intel_be_drm_api.buffer_from_texture = softpipe_get_texture_buffer;
} else
screen = i915_create_screen(&dev->base, deviceID);
unsigned flink;
};
+/*
+ * Wrapper for driver get_texture_buffer functions.
+ */
+boolean
+intel_be_get_texture_buffer(struct drm_api *api,
+ struct pipe_texture *texture,
+ struct pipe_buffer **buffer,
+ unsigned *stride);
+
/**
* Create a be buffer from a drm bo handle.
*