gallium: remove user_buffer_create from the interface
authorMarek Olšák <maraeo@gmail.com>
Sat, 12 May 2012 11:08:02 +0000 (13:08 +0200)
committerMarek Olšák <maraeo@gmail.com>
Sat, 12 May 2012 21:13:45 +0000 (23:13 +0200)
Nothing uses it now.

21 files changed:
src/gallium/auxiliary/util/u_inlines.h
src/gallium/auxiliary/util/u_slab.h
src/gallium/drivers/galahad/glhd_screen.c
src/gallium/drivers/i915/i915_resource.c
src/gallium/drivers/identity/id_screen.c
src/gallium/drivers/llvmpipe/lp_texture.c
src/gallium/drivers/noop/noop_pipe.c
src/gallium/drivers/nv30/nv30_resource.c
src/gallium/drivers/nv50/nv50_resource.c
src/gallium/drivers/nvc0/nvc0_resource.c
src/gallium/drivers/r600/r600_buffer.c
src/gallium/drivers/r600/r600_pipe.h
src/gallium/drivers/r600/r600_resource.c
src/gallium/drivers/radeonsi/r600_buffer.c
src/gallium/drivers/radeonsi/r600_resource.c
src/gallium/drivers/radeonsi/radeonsi_pipe.h
src/gallium/drivers/rbug/rbug_screen.c
src/gallium/drivers/softpipe/sp_texture.c
src/gallium/drivers/svga/svga_resource.c
src/gallium/drivers/trace/tr_screen.c
src/gallium/include/pipe/p_screen.h

index 2ec1ccfe9d3204cf85aeb0f80118ee18037d0c2d..2ec153c582371547e19d8f494372f7d1a13d3a5d 100644 (file)
@@ -233,14 +233,6 @@ pipe_buffer_create( struct pipe_screen *screen,
    return screen->resource_create(screen, &buffer);
 }
 
-
-static INLINE struct pipe_resource *
-pipe_user_buffer_create( struct pipe_screen *screen, void *ptr, unsigned size,
-                        unsigned usage )
-{
-   return screen->user_buffer_create(screen, ptr, size, usage);
-}
-
 static INLINE void *
 pipe_buffer_map_range(struct pipe_context *pipe,
                      struct pipe_resource *buffer,
index 6b9718d08a7ca481db957774b09e340e3b29563f..3ed8b12d35716afd273c54f0c365ad7a2fde054f 100644 (file)
@@ -28,7 +28,7 @@
  * Good for allocations which have very low lifetime and are allocated
  * and freed very often. Use a profiler first to know if it's worth using it!
  *
- * Candidates: get_transfer, user_buffer_create
+ * Candidates: get_transfer
  *
  * @author Marek Olšák
  */
index 49702b6e424ad310eb8b9235c3b5f7784051fd1c..7d03763a66371c9e78090c8888b473986accdcc4 100644 (file)
@@ -222,28 +222,6 @@ galahad_screen_resource_destroy(struct pipe_screen *screen,
 }
 
 
-static struct pipe_resource *
-galahad_screen_user_buffer_create(struct pipe_screen *_screen,
-                                   void *ptr,
-                                   unsigned bytes,
-                                   unsigned usage)
-{
-   struct galahad_screen *glhd_screen = galahad_screen(_screen);
-   struct pipe_screen *screen = glhd_screen->screen;
-   struct pipe_resource *result;
-
-   result = screen->user_buffer_create(screen,
-                                       ptr,
-                                       bytes,
-                                       usage);
-
-   if (result)
-      return galahad_resource_create(glhd_screen, result);
-   return NULL;
-}
-
-
-
 static void
 galahad_screen_flush_frontbuffer(struct pipe_screen *_screen,
                                   struct pipe_resource *_resource,
@@ -323,7 +301,6 @@ galahad_screen_create(struct pipe_screen *screen)
    glhd_screen->base.resource_from_handle = galahad_screen_resource_from_handle;
    glhd_screen->base.resource_get_handle = galahad_screen_resource_get_handle;
    glhd_screen->base.resource_destroy = galahad_screen_resource_destroy;
-   glhd_screen->base.user_buffer_create = galahad_screen_user_buffer_create;
    glhd_screen->base.flush_frontbuffer = galahad_screen_flush_frontbuffer;
    glhd_screen->base.fence_reference = galahad_screen_fence_reference;
    glhd_screen->base.fence_signalled = galahad_screen_fence_signalled;
index b4719af1fb6a3f54b6dcd3c40dd24ee16c12508f..253c7d062338e26b910ac351ac5714acbbe3b2f9 100644 (file)
@@ -46,5 +46,4 @@ i915_init_screen_resource_functions(struct i915_screen *is)
    is->base.resource_from_handle = i915_resource_from_handle;
    is->base.resource_get_handle = u_resource_get_handle_vtbl;
    is->base.resource_destroy = u_resource_destroy_vtbl;
-   is->base.user_buffer_create = i915_user_buffer_create;
 }
index a173235b56390727ede076b342ea42fc2be0b2f0..ab82e29cec3f916f1a8a2fd3c33e6882939206ab 100644 (file)
@@ -188,28 +188,6 @@ identity_screen_resource_destroy(struct pipe_screen *screen,
 }
 
 
-static struct pipe_resource *
-identity_screen_user_buffer_create(struct pipe_screen *_screen,
-                                   void *ptr,
-                                   unsigned bytes,
-                                   unsigned usage)
-{
-   struct identity_screen *id_screen = identity_screen(_screen);
-   struct pipe_screen *screen = id_screen->screen;
-   struct pipe_resource *result;
-
-   result = screen->user_buffer_create(screen,
-                                       ptr,
-                                       bytes,
-                                       usage);
-
-   if (result)
-      return identity_resource_create(id_screen, result);
-   return NULL;
-}
-
-
-
 static void
 identity_screen_flush_frontbuffer(struct pipe_screen *_screen,
                                   struct pipe_resource *_resource,
@@ -286,7 +264,6 @@ identity_screen_create(struct pipe_screen *screen)
    id_screen->base.resource_from_handle = identity_screen_resource_from_handle;
    id_screen->base.resource_get_handle = identity_screen_resource_get_handle;
    id_screen->base.resource_destroy = identity_screen_resource_destroy;
-   id_screen->base.user_buffer_create = identity_screen_user_buffer_create;
    id_screen->base.flush_frontbuffer = identity_screen_flush_frontbuffer;
    id_screen->base.fence_reference = identity_screen_fence_reference;
    id_screen->base.fence_signalled = identity_screen_fence_signalled;
index 198874b4fcecbef86e2e7bc1159d311fcbaacf27..4495e8de6cd07fef6564c8ddcb4670f765d8d949 100644 (file)
@@ -1432,8 +1432,6 @@ llvmpipe_init_screen_resource_funcs(struct pipe_screen *screen)
    screen->resource_destroy = llvmpipe_resource_destroy;
    screen->resource_from_handle = llvmpipe_resource_from_handle;
    screen->resource_get_handle = llvmpipe_resource_get_handle;
-   screen->user_buffer_create = llvmpipe_user_buffer_create;
-
 }
 
 
index e47f944b59b5b24e308d08e079aab8fd4e3f3d8b..4c233d1ec41b4d13f5abb010387205a46efa3d59 100644 (file)
@@ -142,23 +142,6 @@ static void noop_resource_destroy(struct pipe_screen *screen,
        FREE(resource);
 }
 
-static struct pipe_resource *noop_user_buffer_create(struct pipe_screen *screen,
-                                                       void *ptr, unsigned bytes,
-                                                       unsigned bind)
-{
-       struct pipe_resource templ;
-
-       templ.target = PIPE_BUFFER;
-       templ.format = PIPE_FORMAT_R8_UNORM;
-       templ.usage = PIPE_USAGE_IMMUTABLE;
-       templ.bind = bind;
-       templ.width0 = bytes;
-       templ.height0 = 1;
-       templ.depth0 = 1;
-       templ.flags = 0;
-       return noop_resource_create(screen, &templ);
-}
-
 
 /*
  * transfer
@@ -392,7 +375,6 @@ struct pipe_screen *noop_screen_create(struct pipe_screen *oscreen)
        screen->resource_from_handle = noop_resource_from_handle;
        screen->resource_get_handle = noop_resource_get_handle;
        screen->resource_destroy = noop_resource_destroy;
-       screen->user_buffer_create = noop_user_buffer_create;
        screen->flush_frontbuffer = noop_flush_frontbuffer;
 
        return screen;
index 6bcee4d029440382c1697ccee2e5cd1b5d470e2a..3d8e7d74b314debac6011b2532f25847dd9b1c42 100644 (file)
@@ -61,7 +61,6 @@ nv30_resource_screen_init(struct pipe_screen *pscreen)
    pscreen->resource_from_handle = nv30_resource_from_handle;
    pscreen->resource_get_handle = u_resource_get_handle_vtbl;
    pscreen->resource_destroy = u_resource_destroy_vtbl;
-   pscreen->user_buffer_create = nouveau_user_buffer_create;
 }
 
 void
index a66a6a026754a0034fa28640750037cb30ecadef..9fe18a6d09dac98784d2bf73c4051e106a0e8f53 100644 (file)
@@ -103,5 +103,4 @@ nv50_screen_init_resource_functions(struct pipe_screen *pscreen)
    pscreen->resource_from_handle = nv50_resource_from_handle;
    pscreen->resource_get_handle = u_resource_get_handle_vtbl;
    pscreen->resource_destroy = u_resource_destroy_vtbl;
-   pscreen->user_buffer_create = nouveau_user_buffer_create;
 }
index e8d83ca5d93ebb2aef7e7729c7851c9f9ca9671e..daf5c907a05b579a7c5ee6c242d7858248712fec 100644 (file)
@@ -61,5 +61,4 @@ nvc0_screen_init_resource_functions(struct pipe_screen *pscreen)
    pscreen->resource_from_handle = nvc0_resource_from_handle;
    pscreen->resource_get_handle = u_resource_get_handle_vtbl;
    pscreen->resource_destroy = u_resource_destroy_vtbl;
-   pscreen->user_buffer_create = nouveau_user_buffer_create;
 }
index 857d860aaeaf72b80809dd3d27252afc8ed3feef..2f7eb513d4e525959a019ec496d6eeb193332f67 100644 (file)
@@ -220,28 +220,3 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
        }
        return &rbuffer->b.b;
 }
-
-struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
-                                             void *ptr, unsigned bytes,
-                                             unsigned bind)
-{
-       struct r600_screen *rscreen = (struct r600_screen*)screen;
-       struct r600_resource *rbuffer;
-
-       rbuffer = util_slab_alloc(&rscreen->pool_buffers);
-
-       pipe_reference_init(&rbuffer->b.b.reference, 1);
-       rbuffer->b.vtbl = &r600_buffer_vtbl;
-       rbuffer->b.b.screen = screen;
-       rbuffer->b.b.target = PIPE_BUFFER;
-       rbuffer->b.b.format = PIPE_FORMAT_R8_UNORM;
-       rbuffer->b.b.usage = PIPE_USAGE_IMMUTABLE;
-       rbuffer->b.b.bind = bind;
-       rbuffer->b.b.width0 = bytes;
-       rbuffer->b.b.height0 = 1;
-       rbuffer->b.b.depth0 = 1;
-       rbuffer->b.b.array_size = 1;
-       rbuffer->b.b.flags = 0;
-       rbuffer->buf = NULL;
-       return &rbuffer->b.b;
-}
index a3ec9e5f7fa51d5d8bfefb820efaba44c1c6210b..d6a970776414589e13a778a6490aaf81ad829983 100644 (file)
@@ -400,9 +400,6 @@ bool r600_init_resource(struct r600_screen *rscreen,
                        unsigned bind, unsigned usage);
 struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
                                         const struct pipe_resource *templ);
-struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
-                                             void *ptr, unsigned bytes,
-                                             unsigned bind);
 
 /* r600_pipe.c */
 void r600_flush(struct pipe_context *ctx, struct pipe_fence_handle **fence,
index de339e035123ba7cfbbb10413c0e36351ccec6ce..ef0b4ceffd0e17859a85d1ae1bef92bd9c420017 100644 (file)
@@ -50,7 +50,6 @@ void r600_init_screen_resource_functions(struct pipe_screen *screen)
        screen->resource_from_handle = r600_resource_from_handle;
        screen->resource_get_handle = u_resource_get_handle_vtbl;
        screen->resource_destroy = u_resource_destroy_vtbl;
-       screen->user_buffer_create = r600_user_buffer_create;
 }
 
 void r600_init_context_resource_functions(struct r600_context *r600)
index c6b707187a880d02fb0d9d606d8157bba376e958..8fd7e2774317292b1198b7dc0bb6db1ec8518bf6 100644 (file)
@@ -178,31 +178,6 @@ struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
        return &rbuffer->b.b;
 }
 
-struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
-                                             void *ptr, unsigned bytes,
-                                             unsigned bind)
-{
-       struct r600_screen *rscreen = (struct r600_screen*)screen;
-       struct r600_resource *rbuffer;
-
-       rbuffer = util_slab_alloc(&rscreen->pool_buffers);
-
-       pipe_reference_init(&rbuffer->b.b.reference, 1);
-       rbuffer->b.vtbl = &r600_buffer_vtbl;
-       rbuffer->b.b.screen = screen;
-       rbuffer->b.b.target = PIPE_BUFFER;
-       rbuffer->b.b.format = PIPE_FORMAT_R8_UNORM;
-       rbuffer->b.b.usage = PIPE_USAGE_IMMUTABLE;
-       rbuffer->b.b.bind = bind;
-       rbuffer->b.b.width0 = bytes;
-       rbuffer->b.b.height0 = 1;
-       rbuffer->b.b.depth0 = 1;
-       rbuffer->b.b.array_size = 1;
-       rbuffer->b.b.flags = 0;
-       rbuffer->buf = NULL;
-       return &rbuffer->b.b;
-}
-
 void r600_upload_index_buffer(struct r600_context *rctx,
                              struct pipe_index_buffer *ib, unsigned count)
 {
index 0e861c12be342900c13d89df4b4ef6bba91bccfc..d9be706b6b8f5badd976497726e46091b9c397b8 100644 (file)
@@ -50,7 +50,6 @@ void r600_init_screen_resource_functions(struct pipe_screen *screen)
        screen->resource_from_handle = r600_resource_from_handle;
        screen->resource_get_handle = u_resource_get_handle_vtbl;
        screen->resource_destroy = u_resource_destroy_vtbl;
-       screen->user_buffer_create = r600_user_buffer_create;
 }
 
 void r600_init_context_resource_functions(struct r600_context *r600)
index bba4cf2369142ddcf39904643051ee02096cc3c6..b16ec1069c9eb26199ebac1a0f31b040ab8ae713 100644 (file)
@@ -384,9 +384,6 @@ bool r600_init_resource(struct r600_screen *rscreen,
                        unsigned bind, unsigned usage);
 struct pipe_resource *r600_buffer_create(struct pipe_screen *screen,
                                         const struct pipe_resource *templ);
-struct pipe_resource *r600_user_buffer_create(struct pipe_screen *screen,
-                                             void *ptr, unsigned bytes,
-                                             unsigned bind);
 void r600_upload_index_buffer(struct r600_context *rctx,
                              struct pipe_index_buffer *ib, unsigned count);
 
index 1b7ca7cb6fe3a0e14f05d883c3dbc52c359ee6a6..2471fdb46610a44923cd0eddaa0391f3496cee67 100644 (file)
@@ -186,28 +186,6 @@ rbug_screen_resource_destroy(struct pipe_screen *screen,
    rbug_resource_destroy(rbug_resource(_resource));
 }
 
-static struct pipe_resource *
-rbug_screen_user_buffer_create(struct pipe_screen *_screen,
-                               void *ptr,
-                               unsigned bytes,
-                               unsigned usage)
-{
-   struct rbug_screen *rb_screen = rbug_screen(_screen);
-   struct pipe_screen *screen = rb_screen->screen;
-   struct pipe_resource *result;
-
-   result = screen->user_buffer_create(screen,
-                                       ptr,
-                                       bytes,
-                                       usage);
-
-   if (result)
-      return rbug_resource_create(rb_screen, result);
-   return NULL;
-}
-
-
-
 static void
 rbug_screen_flush_frontbuffer(struct pipe_screen *_screen,
                               struct pipe_resource *_resource,
@@ -298,7 +276,6 @@ rbug_screen_create(struct pipe_screen *screen)
    rb_screen->base.resource_from_handle = rbug_screen_resource_from_handle;
    rb_screen->base.resource_get_handle = rbug_screen_resource_get_handle;
    rb_screen->base.resource_destroy = rbug_screen_resource_destroy;
-   rb_screen->base.user_buffer_create = rbug_screen_user_buffer_create;
    rb_screen->base.flush_frontbuffer = rbug_screen_flush_frontbuffer;
    rb_screen->base.fence_reference = rbug_screen_fence_reference;
    rb_screen->base.fence_signalled = rbug_screen_fence_signalled;
index ee8d4230dd91db20ff598fbdb69fc3154ba7296b..978fbe1fe6791038b272321da94022351a2bde8b 100644 (file)
@@ -506,6 +506,4 @@ softpipe_init_screen_texture_funcs(struct pipe_screen *screen)
    screen->resource_destroy = softpipe_resource_destroy;
    screen->resource_from_handle = softpipe_resource_from_handle;
    screen->resource_get_handle = softpipe_resource_get_handle;
-   screen->user_buffer_create = softpipe_user_buffer_create;
-
 }
index b86469af12d602bc3c4e140c43d06566910f67dd..890c953a3c260bcabda71394d9777f2ae72a3359 100644 (file)
@@ -73,5 +73,4 @@ svga_init_screen_resource_functions(struct svga_screen *is)
    is->screen.resource_from_handle = svga_resource_from_handle;
    is->screen.resource_get_handle = u_resource_get_handle_vtbl;
    is->screen.resource_destroy = u_resource_destroy_vtbl;
-   is->screen.user_buffer_create = svga_user_buffer_create;
 }
index fd5acbefe51de0131072bea14fa6612b1ad2f2ec..4a1aa997a7b4395f8b7ce45c74a8a9f3e1d33569 100644 (file)
@@ -319,49 +319,6 @@ trace_screen_resource_destroy(struct pipe_screen *_screen,
 }
 
 
-
-/********************************************************************
- * buffer
- */
-
-
-
-static struct pipe_resource *
-trace_screen_user_buffer_create(struct pipe_screen *_screen,
-                                void *data,
-                                unsigned size,
-                               unsigned usage)
-{
-   struct trace_screen *tr_scr = trace_screen(_screen);
-   struct pipe_screen *screen = tr_scr->screen;
-   struct pipe_resource *result;
-
-   trace_dump_call_begin("pipe_screen", "user_buffer_create");
-
-   trace_dump_arg(ptr, screen);
-   trace_dump_arg_begin("data");
-   trace_dump_bytes(data, size);
-   trace_dump_arg_end();
-   trace_dump_arg(uint, size);
-   trace_dump_arg(uint, usage);
-
-   result = screen->user_buffer_create(screen, data, size, usage);
-
-   trace_dump_ret(ptr, result);
-
-   trace_dump_call_end();
-
-   if(result) {
-      assert(!(result->flags & TRACE_FLAG_USER_BUFFER));
-      result->flags |= TRACE_FLAG_USER_BUFFER;
-   }
-
-   return trace_resource_create(tr_scr, result);
-}
-
-
-
-
 /********************************************************************
  * fence
  */
@@ -506,7 +463,6 @@ trace_screen_create(struct pipe_screen *screen)
    tr_scr->base.resource_from_handle = trace_screen_resource_from_handle;
    tr_scr->base.resource_get_handle = trace_screen_resource_get_handle;
    tr_scr->base.resource_destroy = trace_screen_resource_destroy;
-   tr_scr->base.user_buffer_create = trace_screen_user_buffer_create;
    tr_scr->base.fence_reference = trace_screen_fence_reference;
    tr_scr->base.fence_signalled = trace_screen_fence_signalled;
    tr_scr->base.fence_finish = trace_screen_fence_finish;
index 7ae7c9a04e15ad553aa95b8fde3fe2425b9e1cfd..b4a7f01af667d066616795724eebe80fcc437fa1 100644 (file)
@@ -161,32 +161,6 @@ struct pipe_screen {
                            struct pipe_resource *pt);
 
 
-   /**
-    * Create a buffer that wraps user-space data.
-    *
-    * Effectively this schedules a delayed call to buffer_create
-    * followed by an upload of the data at *some point in the future*,
-    * or perhaps never.  Basically the allocate/upload is delayed
-    * until the buffer is actually passed to hardware.
-    *
-    * The intention is to provide a quick way to turn regular data
-    * into a buffer, and secondly to avoid a copy operation if that
-    * data subsequently turns out to be only accessed by the CPU.
-    *
-    * Common example is OpenGL vertex buffers that are subsequently
-    * processed either by software TNL in the driver or by passing to
-    * hardware.
-    *
-    * XXX: What happens if the delayed call to buffer_create() fails?
-    *
-    * Note that ptr may be accessed at any time upto the time when the
-    * buffer is destroyed, so the data must not be freed before then.
-    */
-   struct pipe_resource *(*user_buffer_create)(struct pipe_screen *screen,
-                                              void *ptr,
-                                              unsigned bytes,
-                                              unsigned bind_flags);
-
    /**
     * Do any special operations to ensure frontbuffer contents are
     * displayed, eg copy fake frontbuffer.