Mesa (main): gallium/noop: use threaded_resource
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Mon Aug 9 13:14:25 UTC 2021
Module: Mesa
Branch: main
Commit: f4632f1096994d9e7af32651115be9b145d0b6cb
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=f4632f1096994d9e7af32651115be9b145d0b6cb
Author: Marek Olšák <marek.olsak at amd.com>
Date: Fri Aug 6 16:03:11 2021 -0400
gallium/noop: use threaded_resource
to enable threaded_context later
Acked-By: Mike Blumenkrantz <michael.blumenkrantz at gmail.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12255>
---
src/gallium/auxiliary/driver_noop/noop_pipe.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/src/gallium/auxiliary/driver_noop/noop_pipe.c b/src/gallium/auxiliary/driver_noop/noop_pipe.c
index 0beb0c13dc1..bd3ecbf86d1 100644
--- a/src/gallium/auxiliary/driver_noop/noop_pipe.c
+++ b/src/gallium/auxiliary/driver_noop/noop_pipe.c
@@ -92,7 +92,7 @@ noop_set_active_query_state(struct pipe_context *pipe, bool enable)
* resource
*/
struct noop_resource {
- struct pipe_resource base;
+ struct threaded_resource b;
unsigned size;
char *data;
struct sw_displaytarget *dt;
@@ -109,16 +109,17 @@ static struct pipe_resource *noop_resource_create(struct pipe_screen *screen,
return NULL;
stride = util_format_get_stride(templ->format, templ->width0);
- nresource->base = *templ;
- nresource->base.screen = screen;
+ nresource->b.b = *templ;
+ nresource->b.b.screen = screen;
nresource->size = stride * templ->height0 * templ->depth0;
nresource->data = MALLOC(nresource->size);
- pipe_reference_init(&nresource->base.reference, 1);
+ pipe_reference_init(&nresource->b.b.reference, 1);
if (nresource->data == NULL) {
FREE(nresource);
return NULL;
}
- return &nresource->base;
+ threaded_resource_init(&nresource->b.b);
+ return &nresource->b.b;
}
static struct pipe_resource *noop_resource_from_handle(struct pipe_screen *screen,
@@ -189,6 +190,7 @@ static void noop_resource_destroy(struct pipe_screen *screen,
{
struct noop_resource *nresource = (struct noop_resource *)resource;
+ threaded_resource_deinit(resource);
FREE(nresource->data);
FREE(resource);
}
More information about the mesa-commit
mailing list