Module: Mesa Branch: master Commit: e9724722a3a7d57674474fb347aee292f1d6077c URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=e9724722a3a7d57674474fb347aee292f1d6077c
Author: Dave Airlie <[email protected]> Date: Tue Sep 8 09:00:07 2020 +1000 gallium: add a level parameter to resource parameter get For lavapipe interface to llvmpipe there is a need to retrieve per-level info, so this seems like the best interface to use for it. Reviewed-by: Roland Scheidegger <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6639> --- src/gallium/auxiliary/driver_ddebug/dd_screen.c | 3 ++- src/gallium/auxiliary/driver_noop/noop_pipe.c | 3 ++- src/gallium/auxiliary/driver_rbug/rbug_screen.c | 3 ++- src/gallium/auxiliary/driver_trace/tr_screen.c | 3 ++- src/gallium/auxiliary/util/u_tests.c | 10 +++++----- src/gallium/drivers/iris/iris_resource.c | 1 + src/gallium/drivers/radeonsi/si_texture.c | 5 +++-- src/gallium/frontends/dri/dri2.c | 2 +- src/gallium/include/pipe/p_screen.h | 1 + 9 files changed, 19 insertions(+), 12 deletions(-) diff --git a/src/gallium/auxiliary/driver_ddebug/dd_screen.c b/src/gallium/auxiliary/driver_ddebug/dd_screen.c index 7e8ea4cca48..a0a8ab1b063 100644 --- a/src/gallium/auxiliary/driver_ddebug/dd_screen.c +++ b/src/gallium/auxiliary/driver_ddebug/dd_screen.c @@ -317,6 +317,7 @@ dd_screen_resource_get_param(struct pipe_screen *_screen, struct pipe_resource *resource, unsigned plane, unsigned layer, + unsigned level, enum pipe_resource_param param, unsigned handle_usage, uint64_t *value) @@ -325,7 +326,7 @@ dd_screen_resource_get_param(struct pipe_screen *_screen, struct pipe_context *pipe = _pipe ? dd_context(_pipe)->pipe : NULL; return screen->resource_get_param(screen, pipe, resource, plane, layer, - param, handle_usage, value); + level, param, handle_usage, value); } static void diff --git a/src/gallium/auxiliary/driver_noop/noop_pipe.c b/src/gallium/auxiliary/driver_noop/noop_pipe.c index d31f6134f80..496ccf00dec 100644 --- a/src/gallium/auxiliary/driver_noop/noop_pipe.c +++ b/src/gallium/auxiliary/driver_noop/noop_pipe.c @@ -161,6 +161,7 @@ static bool noop_resource_get_param(struct pipe_screen *pscreen, struct pipe_resource *resource, unsigned plane, unsigned layer, + unsigned level, enum pipe_resource_param param, unsigned handle_usage, uint64_t *value) @@ -175,7 +176,7 @@ static bool noop_resource_get_param(struct pipe_screen *pscreen, if (!tex) return false; - result = screen->resource_get_param(screen, NULL, tex, 0, 0, param, + result = screen->resource_get_param(screen, NULL, tex, 0, 0, 0, param, handle_usage, value); pipe_resource_reference(&tex, NULL); return result; diff --git a/src/gallium/auxiliary/driver_rbug/rbug_screen.c b/src/gallium/auxiliary/driver_rbug/rbug_screen.c index ed6a3da83f9..e115620b558 100644 --- a/src/gallium/auxiliary/driver_rbug/rbug_screen.c +++ b/src/gallium/auxiliary/driver_rbug/rbug_screen.c @@ -268,6 +268,7 @@ rbug_screen_resource_get_param(struct pipe_screen *_screen, struct pipe_resource *_resource, unsigned plane, unsigned layer, + unsigned level, enum pipe_resource_param param, unsigned handle_usage, uint64_t *value) @@ -279,7 +280,7 @@ rbug_screen_resource_get_param(struct pipe_screen *_screen, struct pipe_resource *resource = rb_resource->resource; return screen->resource_get_param(screen, rb_pipe ? rb_pipe->pipe : NULL, - resource, plane, layer, param, + resource, plane, layer, level, param, handle_usage, value); } diff --git a/src/gallium/auxiliary/driver_trace/tr_screen.c b/src/gallium/auxiliary/driver_trace/tr_screen.c index a0943519ea5..56a70de894a 100644 --- a/src/gallium/auxiliary/driver_trace/tr_screen.c +++ b/src/gallium/auxiliary/driver_trace/tr_screen.c @@ -413,6 +413,7 @@ trace_screen_resource_get_param(struct pipe_screen *_screen, struct pipe_resource *resource, unsigned plane, unsigned layer, + unsigned level, enum pipe_resource_param param, unsigned handle_usage, uint64_t *value) @@ -424,7 +425,7 @@ trace_screen_resource_get_param(struct pipe_screen *_screen, /* TODO trace call */ return screen->resource_get_param(screen, tr_pipe ? tr_pipe->pipe : NULL, - resource, plane, layer, param, + resource, plane, layer, level, param, handle_usage, value); } diff --git a/src/gallium/auxiliary/util/u_tests.c b/src/gallium/auxiliary/util/u_tests.c index c78f01d47a2..b149437b201 100644 --- a/src/gallium/auxiliary/util/u_tests.c +++ b/src/gallium/auxiliary/util/u_tests.c @@ -907,7 +907,7 @@ test_nv12(struct pipe_screen *screen) struct pipe_resource *res = i == 2 ? tex->next : tex; unsigned plane = i == 2 ? 0 : i; - if (!screen->resource_get_param(screen, NULL, res, plane, 0, + if (!screen->resource_get_param(screen, NULL, res, plane, 0, 0, PIPE_RESOURCE_PARAM_HANDLE_TYPE_KMS, 0, &handle[i].handle)) { printf("resource_get_param failed\n"); @@ -915,7 +915,7 @@ test_nv12(struct pipe_screen *screen) goto cleanup; } - if (!screen->resource_get_param(screen, NULL, res, plane, 0, + if (!screen->resource_get_param(screen, NULL, res, plane, 0, 0, PIPE_RESOURCE_PARAM_HANDLE_TYPE_FD, 0, &handle[i].dmabuf)) { printf("resource_get_param failed\n"); @@ -923,7 +923,7 @@ test_nv12(struct pipe_screen *screen) goto cleanup; } - if (!screen->resource_get_param(screen, NULL, res, plane, 0, + if (!screen->resource_get_param(screen, NULL, res, plane, 0, 0, PIPE_RESOURCE_PARAM_OFFSET, 0, &handle[i].offset)) { printf("resource_get_param failed\n"); @@ -931,7 +931,7 @@ test_nv12(struct pipe_screen *screen) goto cleanup; } - if (!screen->resource_get_param(screen, NULL, res, plane, 0, + if (!screen->resource_get_param(screen, NULL, res, plane, 0, 0, PIPE_RESOURCE_PARAM_STRIDE, 0, &handle[i].stride)) { printf("resource_get_param failed\n"); @@ -939,7 +939,7 @@ test_nv12(struct pipe_screen *screen) goto cleanup; } - if (!screen->resource_get_param(screen, NULL, res, plane, 0, + if (!screen->resource_get_param(screen, NULL, res, plane, 0, 0, PIPE_RESOURCE_PARAM_NPLANES, 0, &handle[i].planes)) { printf("resource_get_param failed\n"); diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 19b4669c550..8747ef4aa8a 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -1152,6 +1152,7 @@ iris_resource_get_param(struct pipe_screen *pscreen, struct pipe_resource *resource, unsigned plane, unsigned layer, + unsigned level, enum pipe_resource_param param, unsigned handle_usage, uint64_t *value) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index 6aaf9ebfd04..ba419f9e151 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -589,6 +589,7 @@ static bool si_has_displayable_dcc(struct si_texture *tex) static bool si_resource_get_param(struct pipe_screen *screen, struct pipe_context *context, struct pipe_resource *resource, unsigned plane, unsigned layer, + unsigned level, enum pipe_resource_param param, unsigned handle_usage, uint64_t *value) { @@ -654,12 +655,12 @@ static void si_texture_get_info(struct pipe_screen *screen, struct pipe_resource uint64_t value; if (pstride) { - si_resource_get_param(screen, NULL, resource, 0, 0, PIPE_RESOURCE_PARAM_STRIDE, 0, &value); + si_resource_get_param(screen, NULL, resource, 0, 0, 0, PIPE_RESOURCE_PARAM_STRIDE, 0, &value); *pstride = value; } if (poffset) { - si_resource_get_param(screen, NULL, resource, 0, 0, PIPE_RESOURCE_PARAM_OFFSET, 0, &value); + si_resource_get_param(screen, NULL, resource, 0, 0, 0, PIPE_RESOURCE_PARAM_OFFSET, 0, &value); *poffset = value; } } diff --git a/src/gallium/frontends/dri/dri2.c b/src/gallium/frontends/dri/dri2.c index 6571b34cf6b..2215fcf0172 100644 --- a/src/gallium/frontends/dri/dri2.c +++ b/src/gallium/frontends/dri/dri2.c @@ -1215,7 +1215,7 @@ dri2_resource_get_param(__DRIimage *image, enum pipe_resource_param param, return false; return pscreen->resource_get_param(pscreen, NULL, image->texture, - image->plane, 0, param, handle_usage, + image->plane, 0, 0, param, handle_usage, value); } diff --git a/src/gallium/include/pipe/p_screen.h b/src/gallium/include/pipe/p_screen.h index 3002689aeed..53a192b6349 100644 --- a/src/gallium/include/pipe/p_screen.h +++ b/src/gallium/include/pipe/p_screen.h @@ -277,6 +277,7 @@ struct pipe_screen { struct pipe_resource *resource, unsigned plane, unsigned layer, + unsigned level, enum pipe_resource_param param, unsigned handle_usage, uint64_t *value); _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
