summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/freedreno
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-01-27 00:12:37 +0100
committerMarek Olšák <[email protected]>2017-02-14 21:46:16 +0100
commit55ad59d2b72d6d6e38bd0a54586b713a7a93bb10 (patch)
treeeb46201b7ce87773e0199399a75a469c389f3dc7 /src/gallium/drivers/freedreno
parent998396c32e4e95fef5a1efef6cb1a9efb0868aa6 (diff)
gallium: set pipe_context uploaders in drivers (v3)
Notes: - make sure the default size is large enough to handle all state trackers - pipe wrappers don't receive transfer calls from stream_uploader, because pipe_context::stream_uploader points directly to the underlying driver's stream_uploader (to keep it simple for now) v2: add error handling to nv50, nvc0, noop v3: set const_uploader Reviewed-by: Nicolai Hähnle <[email protected]> Tested-by: Edmondo Tommasina <[email protected]> (v1) Tested-by: Charmaine Lee <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno')
-rw-r--r--src/gallium/drivers/freedreno/freedreno_context.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_context.c b/src/gallium/drivers/freedreno/freedreno_context.c
index 348cc60e9ca..4d8c4251a8b 100644
--- a/src/gallium/drivers/freedreno/freedreno_context.c
+++ b/src/gallium/drivers/freedreno/freedreno_context.c
@@ -37,6 +37,7 @@
#include "freedreno_query.h"
#include "freedreno_query_hw.h"
#include "freedreno_util.h"
+#include "util/u_upload_mgr.h"
static void
fd_context_flush(struct pipe_context *pctx, struct pipe_fence_handle **fence,
@@ -125,6 +126,9 @@ fd_context_destroy(struct pipe_context *pctx)
if (ctx->blitter)
util_blitter_destroy(ctx->blitter);
+ if (pctx->stream_uploader)
+ u_upload_destroy(pctx->stream_uploader);
+
if (ctx->clear_rs_state)
pctx->delete_rasterizer_state(pctx, ctx->clear_rs_state);
@@ -269,6 +273,11 @@ fd_context_init(struct fd_context *ctx, struct pipe_screen *pscreen,
pctx->create_fence_fd = fd_create_fence_fd;
pctx->fence_server_sync = fd_fence_server_sync;
+ pctx->stream_uploader = u_upload_create_default(pctx);
+ if (!pctx->stream_uploader)
+ goto fail;
+ pctx->const_uploader = pctx->stream_uploader;
+
/* TODO what about compute? Ideally it creates it's own independent
* batches per compute job (since it isn't using tiling, so no point
* in getting involved with the re-ordering madness)..