gallium/vl: use the common uploader
authorMarek Olšák <marek.olsak@amd.com>
Fri, 27 Jan 2017 01:06:12 +0000 (02:06 +0100)
committerMarek Olšák <marek.olsak@amd.com>
Tue, 14 Feb 2017 20:46:16 +0000 (21:46 +0100)
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Tested-by: Edmondo Tommasina <edmondo.tommasina@gmail.com>
Tested-by: Charmaine Lee <charmainel@vmware.com>
src/gallium/auxiliary/vl/vl_compositor.c
src/gallium/auxiliary/vl/vl_compositor.h
src/gallium/state_trackers/va/context.c

index 1efcb75..f98b185 100644 (file)
@@ -782,7 +782,7 @@ gen_vertex_data(struct vl_compositor *c, struct vl_compositor_state *s, struct u
    assert(c);
 
    /* Allocate new memory for vertices. */
-   u_upload_alloc(c->upload, 0,
+   u_upload_alloc(c->pipe->stream_uploader, 0,
                   c->vertex_buf.stride * VL_COMPOSITOR_MAX_LAYERS * 4, /* size */
                   4, /* alignment */
                   &c->vertex_buf.buffer_offset, &c->vertex_buf.buffer,
@@ -817,7 +817,7 @@ gen_vertex_data(struct vl_compositor *c, struct vl_compositor_state *s, struct u
       }
    }
 
-   u_upload_unmap(c->upload);
+   u_upload_unmap(c->pipe->stream_uploader);
 }
 
 static void
@@ -913,7 +913,6 @@ vl_compositor_cleanup(struct vl_compositor *c)
 {
    assert(c);
 
-   u_upload_destroy(c->upload);
    cleanup_buffers(c);
    cleanup_shaders(c);
    cleanup_pipe_state(c);
@@ -1197,25 +1196,16 @@ vl_compositor_init(struct vl_compositor *c, struct pipe_context *pipe)
 
    c->pipe = pipe;
 
-   c->upload = u_upload_create(pipe, 128 * 1024, PIPE_BIND_VERTEX_BUFFER,
-                               PIPE_USAGE_STREAM);
-
-   if (!c->upload)
-      return false;
-
    if (!init_pipe_state(c)) {
-      u_upload_destroy(c->upload);
       return false;
    }
 
    if (!init_shaders(c)) {
-      u_upload_destroy(c->upload);
       cleanup_pipe_state(c);
       return false;
    }
 
    if (!init_buffers(c)) {
-      u_upload_destroy(c->upload);
       cleanup_shaders(c);
       cleanup_pipe_state(c);
       return false;
index 5460619..535abb7 100644 (file)
@@ -99,7 +99,6 @@ struct vl_compositor_state
 struct vl_compositor
 {
    struct pipe_context *pipe;
-   struct u_upload_mgr *upload;
 
    struct pipe_framebuffer_state fb_state;
    struct pipe_vertex_buffer vertex_buf;
index 357c9be..d749e65 100644 (file)
@@ -230,10 +230,6 @@ vlVaCreateContext(VADriverContextP ctx, VAConfigID config_id, int picture_width,
 
    if (is_vpp) {
       context->decoder = NULL;
-      if (!drv->compositor.upload) {
-         FREE(context);
-         return VA_STATUS_ERROR_INVALID_CONTEXT;
-      }
    } else {
       context->templat.profile = config->profile;
       context->templat.entrypoint = config->entrypoint;