From: Brian Date: Thu, 11 Oct 2007 15:10:43 +0000 (-0600) Subject: implement intel_user_buffer_create() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=98e638aa8df9f5b789b68a7a742666a4b06b6cb3;p=mesa.git implement intel_user_buffer_create() --- diff --git a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c index 2b2731446d2..72fb24acbf3 100644 --- a/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c +++ b/src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c @@ -151,6 +151,21 @@ intel_buffer_create(struct pipe_winsys *sws, } +static struct pipe_buffer_handle * +intel_user_buffer_create(struct pipe_winsys *sws, void *ptr, unsigned bytes) +{ + struct intel_context *intel = intel_pipe_winsys(sws)->intel; + struct _DriBufferObject *buffer; + + LOCK_HARDWARE( intel ); + driGenUserBuffer( intel->intelScreen->regionPool, + "pipe user buffer", &buffer, ptr, bytes); + UNLOCK_HARDWARE( intel ); + + return pipe_bo(buffer); +} + + static void intel_wait_idle( struct pipe_winsys *sws ) { struct intel_context *intel = intel_pipe_winsys(sws)->intel; @@ -206,6 +221,7 @@ intel_create_pipe_winsys( struct intel_context *intel ) * that rendering be done to an appropriate _DriBufferObject. */ iws->winsys.buffer_create = intel_buffer_create; + iws->winsys.user_buffer_create = intel_user_buffer_create; iws->winsys.buffer_map = intel_buffer_map; iws->winsys.buffer_unmap = intel_buffer_unmap; iws->winsys.buffer_reference = intel_buffer_reference;