From 55ad59d2b72d6d6e38bd0a54586b713a7a93bb10 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 27 Jan 2017 00:12:37 +0100 Subject: gallium: set pipe_context uploaders in drivers (v3) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Tested-by: Edmondo Tommasina (v1) Tested-by: Charmaine Lee --- src/gallium/drivers/nouveau/nv30/nv30_context.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/gallium/drivers/nouveau/nv30') diff --git a/src/gallium/drivers/nouveau/nv30/nv30_context.c b/src/gallium/drivers/nouveau/nv30/nv30_context.c index 3ed088912e2..716d2bbe4c1 100644 --- a/src/gallium/drivers/nouveau/nv30/nv30_context.c +++ b/src/gallium/drivers/nouveau/nv30/nv30_context.c @@ -24,6 +24,7 @@ */ #include "draw/draw_context.h" +#include "util/u_upload_mgr.h" #include "nv_object.xml.h" #include "nv30/nv30-40_3d.xml.h" @@ -165,6 +166,9 @@ nv30_context_destroy(struct pipe_context *pipe) 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); @@ -205,6 +209,13 @@ nv30_context_create(struct pipe_screen *pscreen, void *priv, unsigned ctxflags) 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; -- cgit v1.2.3