summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-27 02:06:12 +0100
committerMarek Olšák <[email protected]>2017-02-14 21:46:16 +0100
commitd3de8e1096662d6e0865db5724e550e5f42a36fa (patch)
tree9e1da12e34d0481b0a28a75318cf15e108e3b38e /src
parentb1dc347822ce6931f8e3089f3bdfaa45dac87ebc (diff)
gallium/vl: use the common uploader
Reviewed-by: Christian König <[email protected]> Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> Tested-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src')
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.c14
-rw-r--r--src/gallium/auxiliary/vl/vl_compositor.h1
-rw-r--r--src/gallium/state_trackers/va/context.c4
3 files changed, 2 insertions, 17 deletions
diff --git a/src/gallium/auxiliary/vl/vl_compositor.c b/src/gallium/auxiliary/vl/vl_compositor.c
index 1efcb752526..f98b185f6c8 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.c
+++ b/src/gallium/auxiliary/vl/vl_compositor.c
@@ -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;
diff --git a/src/gallium/auxiliary/vl/vl_compositor.h b/src/gallium/auxiliary/vl/vl_compositor.h
index 54606190fda..535abb75cd1 100644
--- a/src/gallium/auxiliary/vl/vl_compositor.h
+++ b/src/gallium/auxiliary/vl/vl_compositor.h
@@ -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;
diff --git a/src/gallium/state_trackers/va/context.c b/src/gallium/state_trackers/va/context.c
index 357c9be9b81..d749e65308e 100644
--- a/src/gallium/state_trackers/va/context.c
+++ b/src/gallium/state_trackers/va/context.c
@@ -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;