Module: Mesa Branch: main Commit: db208af9670623be4a0f6429da1b4877e025bc69 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=db208af9670623be4a0f6429da1b4877e025bc69
Author: Zhang Ning <[email protected]> Date: Tue Nov 21 20:01:57 2023 +0800 lima: Support parameter queries for PIPE_RESOURCE_PARAM_NPLANES use helper to get lima_resource and support PIPE_RESOURCE_PARAM_NPLANES Signed-off-by: Zhang Ning <[email protected]> Reviewed-by: Erico Nunes <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26311> --- src/gallium/drivers/lima/lima_resource.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/lima/lima_resource.c b/src/gallium/drivers/lima/lima_resource.c index f63099b0dcd..56302e06726 100644 --- a/src/gallium/drivers/lima/lima_resource.c +++ b/src/gallium/drivers/lima/lima_resource.c @@ -28,6 +28,7 @@ #include "util/u_inlines.h" #include "util/u_math.h" #include "util/u_debug.h" +#include "util/u_resource.h" #include "util/u_transfer.h" #include "util/u_surface.h" #include "util/u_transfer_helper.h" @@ -447,7 +448,8 @@ lima_resource_get_param(struct pipe_screen *pscreen, enum pipe_resource_param param, unsigned usage, uint64_t *value) { - struct lima_resource *res = lima_resource(pres); + struct lima_resource *res = + (struct lima_resource *)util_resource_at_index(pres, plane); switch (param) { case PIPE_RESOURCE_PARAM_STRIDE: @@ -461,7 +463,9 @@ lima_resource_get_param(struct pipe_screen *pscreen, *value = DRM_FORMAT_MOD_ARM_16X16_BLOCK_U_INTERLEAVED; else *value = DRM_FORMAT_MOD_LINEAR; - + return true; + case PIPE_RESOURCE_PARAM_NPLANES: + *value = util_resource_num(pres); return true; default: return false;
