implement intel_user_buffer_create()
authorBrian <brian.paul@tungstengraphics.com>
Thu, 11 Oct 2007 15:10:43 +0000 (09:10 -0600)
committerBrian <brian.paul@tungstengraphics.com>
Thu, 11 Oct 2007 15:10:43 +0000 (09:10 -0600)
src/mesa/drivers/dri/intel_winsys/intel_winsys_pipe.c

index 2b2731446d20423604fcb06b41abc5c1e5b9fed1..72fb24acbf39b26ff8ea7a075d38aa330974bff0 100644 (file)
@@ -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;