dctx->pipe = pipe;
dctx->base.priv = pipe->priv; /* expose wrapped priv data */
dctx->base.screen = &dscreen->base;
+ dctx->base.stream_uploader = pipe->stream_uploader;
+ dctx->base.const_uploader = pipe->const_uploader;
dctx->base.destroy = dd_context_destroy;
#include "util/u_blitter.h"
#include "util/u_memory.h"
#include "util/u_prim.h"
+#include "util/u_upload_mgr.h"
#include "hw/common.xml.h"
if (ctx->blitter)
util_blitter_destroy(ctx->blitter);
+ if (pctx->stream_uploader)
+ u_upload_destroy(pctx->stream_uploader);
+
if (ctx->stream)
etna_cmd_stream_del(ctx->stream);
pctx = &ctx->base;
pctx->priv = ctx;
pctx->screen = pscreen;
+ pctx->stream_uploader = u_upload_create_default(pctx);
+ if (!pctx->stream_uploader)
+ goto fail;
+ pctx->const_uploader = pctx->stream_uploader;
/* context ctxate setup */
ctx->specs = screen->specs;
#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,
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);
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)..
#include "pipe/p_defines.h"
#include "util/u_inlines.h"
#include "util/u_memory.h"
+#include "util/u_upload_mgr.h"
#include "pipe/p_screen.h"
draw_destroy(i915->draw);
+ if (i915->base.stream_uploader)
+ u_upload_destroy(i915->base.stream_uploader);
+
if(i915->batch)
i915->iws->batchbuffer_destroy(i915->batch);
i915->iws = i915_screen(screen)->iws;
i915->base.screen = screen;
i915->base.priv = priv;
+ i915->base.stream_uploader = u_upload_create_default(&i915->base);
+ i915->base.const_uploader = i915->base.stream_uploader;
i915->base.destroy = i915_destroy;
#include "util/u_math.h"
#include "util/u_memory.h"
#include "util/simple_list.h"
+#include "util/u_upload_mgr.h"
#include "lp_clear.h"
#include "lp_context.h"
#include "lp_flush.h"
util_blitter_destroy(llvmpipe->blitter);
}
+ if (llvmpipe->pipe.stream_uploader)
+ u_upload_destroy(llvmpipe->pipe.stream_uploader);
+
/* This will also destroy llvmpipe->setup:
*/
if (llvmpipe->draw)
if (!llvmpipe->setup)
goto fail;
+ llvmpipe->pipe.stream_uploader = u_upload_create_default(&llvmpipe->pipe);
+ if (!llvmpipe->pipe.stream_uploader)
+ goto fail;
+ llvmpipe->pipe.const_uploader = llvmpipe->pipe.stream_uploader;
+
llvmpipe->blitter = util_blitter_create(&llvmpipe->pipe);
if (!llvmpipe->blitter) {
goto fail;
#include "util/u_memory.h"
#include "util/u_inlines.h"
#include "util/u_format.h"
+#include "util/u_upload_mgr.h"
#include "noop_public.h"
DEBUG_GET_ONCE_BOOL_OPTION(noop, "GALLIUM_NOOP", FALSE)
static void noop_destroy_context(struct pipe_context *ctx)
{
+ if (ctx->stream_uploader)
+ u_upload_destroy(ctx->stream_uploader);
+
FREE(ctx);
}
if (!ctx)
return NULL;
+
ctx->screen = screen;
ctx->priv = priv;
+
+ ctx->stream_uploader = u_upload_create_default(ctx);
+ if (!ctx->stream_uploader) {
+ FREE(ctx);
+ return NULL;
+ }
+ ctx->const_uploader = ctx->stream_uploader;
+
ctx->destroy = noop_destroy_context;
ctx->flush = noop_flush;
ctx->clear = noop_clear;
*/
#include "draw/draw_context.h"
+#include "util/u_upload_mgr.h"
#include "nv_object.xml.h"
#include "nv30/nv30-40_3d.xml.h"
if (nv30->draw)
draw_destroy(nv30->draw);
+ if (nv30->base.pipe.stream_uploader)
+ u_upload_destroy(nv30->base.pipe.stream_uploader);
+
if (nv30->blit_vp)
nouveau_heap_free(&nv30->blit_vp);
nv30->base.screen = &screen->base;
nv30->base.copy_data = nv30_transfer_copy_data;
+ nv30->base.pipe.stream_uploader = u_upload_create_default(&nv30->base.pipe);
+ if (!nv30->base.pipe.stream_uploader) {
+ nv30_context_destroy(pipe);
+ return NULL;
+ }
+ nv30->base.pipe.const_uploader = nv30->base.pipe.stream_uploader;
+
pipe = &nv30->base.pipe;
pipe->screen = pscreen;
pipe->priv = priv;
#include "pipe/p_defines.h"
#include "util/u_framebuffer.h"
+#include "util/u_upload_mgr.h"
#include "nv50/nv50_context.h"
#include "nv50/nv50_screen.h"
/* Save off the state in case another context gets created */
nv50->screen->save_state = nv50->state;
}
+
+ if (nv50->base.pipe.stream_uploader)
+ u_upload_destroy(nv50->base.pipe.stream_uploader);
+
nouveau_pushbuf_bufctx(nv50->base.pushbuf, NULL);
nouveau_pushbuf_kick(nv50->base.pushbuf, nv50->base.pushbuf->channel);
nv50->screen = screen;
pipe->screen = pscreen;
pipe->priv = priv;
+ pipe->stream_uploader = u_upload_create_default(pipe);
+ if (!pipe->stream_uploader)
+ goto out_err;
+ pipe->const_uploader = pipe->stream_uploader;
pipe->destroy = nv50_destroy;
return pipe;
out_err:
+ if (pipe->stream_uploader)
+ u_upload_destroy(pipe->stream_uploader);
if (nv50->bufctx_3d)
nouveau_bufctx_del(&nv50->bufctx_3d);
if (nv50->bufctx_cp)
#include "pipe/p_defines.h"
#include "util/u_framebuffer.h"
+#include "util/u_upload_mgr.h"
#include "nvc0/nvc0_context.h"
#include "nvc0/nvc0_screen.h"
nvc0->screen->save_state.tfb = NULL;
}
+ if (nvc0->base.pipe.stream_uploader)
+ u_upload_destroy(nvc0->base.pipe.stream_uploader);
+
/* Unset bufctx, we don't want to revalidate any resources after the flush.
* Other contexts will always set their bufctx again on action calls.
*/
pipe->screen = pscreen;
pipe->priv = priv;
+ pipe->stream_uploader = u_upload_create_default(pipe);
+ if (!pipe->stream_uploader)
+ goto out_err;
+ pipe->const_uploader = pipe->stream_uploader;
pipe->destroy = nvc0_destroy;
out_err:
if (nvc0) {
+ if (pipe->stream_uploader)
+ u_upload_destroy(pipe->stream_uploader);
if (nvc0->bufctx_3d)
nouveau_bufctx_del(&nvc0->bufctx_3d);
if (nvc0->bufctx_cp)
r300->context.create_video_codec = vl_create_decoder;
r300->context.create_video_buffer = vl_video_buffer_create;
- r300->uploader = u_upload_create(&r300->context, 256 * 1024,
+ r300->uploader = u_upload_create(&r300->context, 1024 * 1024,
PIPE_BIND_CUSTOM, PIPE_USAGE_STREAM);
+ r300->context.stream_uploader = r300->uploader;
+ r300->context.const_uploader = r300->uploader;
r300->blitter = util_blitter_create(&r300->context);
if (r300->blitter == NULL)
PIPE_BIND_CONSTANT_BUFFER, PIPE_USAGE_STREAM);
if (!rctx->uploader)
return false;
+ rctx->b.stream_uploader = rctx->uploader;
+ rctx->b.const_uploader = rctx->uploader;
rctx->ctx = rctx->ws->ctx_create(rctx->ws);
if (!rctx->ctx)
rb_pipe->base.screen = _screen;
rb_pipe->base.priv = pipe->priv; /* expose wrapped data */
rb_pipe->base.draw = NULL;
+ rb_pipe->base.stream_uploader = pipe->stream_uploader;
+ rb_pipe->base.const_uploader = pipe->const_uploader;
rb_pipe->base.destroy = rbug_destroy;
rb_pipe->base.draw_vbo = rbug_draw_vbo;
#include "util/u_memory.h"
#include "util/u_pstipple.h"
#include "util/u_inlines.h"
+#include "util/u_upload_mgr.h"
#include "tgsi/tgsi_exec.h"
#include "sp_buffer.h"
#include "sp_clear.h"
if (softpipe->quad.pstipple)
softpipe->quad.pstipple->destroy( softpipe->quad.pstipple );
+ if (softpipe->pipe.stream_uploader)
+ u_upload_destroy(softpipe->pipe.stream_uploader);
+
for (i = 0; i < PIPE_MAX_COLOR_BUFS; i++) {
sp_destroy_tile_cache(softpipe->cbuf_cache[i]);
pipe_surface_reference(&softpipe->framebuffer.cbufs[i], NULL);
softpipe->quad.blend = sp_quad_blend_stage(softpipe);
softpipe->quad.pstipple = sp_quad_polygon_stipple_stage(softpipe);
+ softpipe->pipe.stream_uploader = u_upload_create_default(&softpipe->pipe);
+ if (!softpipe->pipe.stream_uploader)
+ goto fail;
+ softpipe->pipe.const_uploader = softpipe->pipe.stream_uploader;
/*
* Create drawing context and plug our rendering stage into it.
util_bitmask_destroy(svga->stream_output_id_bm);
util_bitmask_destroy(svga->query_id_bm);
u_upload_destroy(svga->const0_upload);
+ u_upload_destroy(svga->pipe.stream_uploader);
+ u_upload_destroy(svga->pipe.const_uploader);
svga_texture_transfer_map_upload_destroy(svga);
/* free user's constant buffers */
svga->pipe.screen = screen;
svga->pipe.priv = priv;
svga->pipe.destroy = svga_destroy;
+ svga->pipe.stream_uploader = u_upload_create(&svga->pipe, 1024 * 1024,
+ PIPE_BIND_VERTEX_BUFFER |
+ PIPE_BIND_INDEX_BUFFER,
+ PIPE_USAGE_STREAM);
+ if (!svga->pipe.stream_uploader)
+ goto cleanup;
+
+ svga->pipe.const_uploader = u_upload_create(&svga->pipe, 128 * 1024,
+ PIPE_BIND_CONSTANT_BUFFER,
+ PIPE_USAGE_STREAM);
+ if (!svga->pipe.const_uploader)
+ goto cleanup;
svga->swc = svgascreen->sws->context_create(svgascreen->sws);
if (!svga->swc)
if (svga->const0_upload)
u_upload_destroy(svga->const0_upload);
+ if (svga->pipe.const_uploader)
+ u_upload_destroy(svga->pipe.const_uploader);
+ if (svga->pipe.stream_uploader)
+ u_upload_destroy(svga->pipe.stream_uploader);
svga_texture_transfer_map_upload_destroy(svga);
if (svga->hwtnl)
svga_hwtnl_destroy(svga->hwtnl);
#include "util/u_inlines.h"
#include "util/u_format.h"
#include "util/u_atomic.h"
+#include "util/u_upload_mgr.h"
extern "C" {
#include "util/u_transfer.h"
pipe_sampler_view_reference(&ctx->sampler_views[PIPE_SHADER_VERTEX][i], NULL);
}
+ if (ctx->pipe.stream_uploader)
+ u_upload_destroy(ctx->pipe.stream_uploader);
+
/* Idle core after destroying buffer resources, but before deleting
* context. Destroying resources has potentially called StoreTiles.*/
SwrWaitForIdle(ctx->swrContext);
swr_draw_init(&ctx->pipe);
swr_query_init(&ctx->pipe);
+ ctx->pipe.stream_uploader = u_upload_create_default(&ctx->pipe);
+ if (!ctx->pipe.stream_uploader)
+ goto fail;
+ ctx->pipe.const_uploader = ctx->pipe.stream_uploader;
+
ctx->pipe.blit = swr_blit;
ctx->blitter = util_blitter_create(&ctx->pipe);
if (!ctx->blitter)
tr_ctx->base.priv = pipe->priv; /* expose wrapped priv data */
tr_ctx->base.screen = &tr_scr->base;
+ tr_ctx->base.stream_uploader = pipe->stream_uploader;
+ tr_ctx->base.const_uploader = pipe->const_uploader;
tr_ctx->base.destroy = trace_context_destroy;
vc4->fd = screen->fd;
slab_create_child(&vc4->transfer_pool, &screen->transfer_pool);
- vc4->blitter = util_blitter_create(pctx);
+
+ vc4->uploader = u_upload_create_default(&vc4->base);
+ vc4->base.stream_uploader = vc4->uploader;
+ vc4->base.const_uploader = vc4->uploader;
+
+ vc4->blitter = util_blitter_create(pctx);
if (!vc4->blitter)
goto fail;
if (!vc4->primconvert)
goto fail;
- vc4->uploader = u_upload_create(pctx, 16 * 1024,
- PIPE_BIND_INDEX_BUFFER,
- PIPE_USAGE_STREAM);
-
vc4_debug |= saved_shaderdb_flag;
vc4->sample_mask = (1 << VC4_MAX_SAMPLES) - 1;
PIPE_BIND_INDEX_BUFFER, PIPE_USAGE_STREAM);
if (!vctx->uploader)
goto fail;
+ vctx->base.stream_uploader = vctx->uploader;
+ vctx->base.const_uploader = vctx->uploader;
vctx->hw_sub_ctx_id = rs->sub_ctx_id++;
virgl_encoder_create_sub_ctx(vctx, vctx->hw_sub_ctx_id);