diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2021-01-12 14:40:18 +0100 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-01-12 22:40:44 +0000 |
commit | 6aed981e9dea77c90efacc768a6590280dbaebb6 (patch) | |
tree | 0a283e90395b32868f8d720d2767cbc489cc5d7b /src | |
parent | fff77e4b434a4989e6c54ab7ef8d1aa22fe81b3a (diff) |
panfrost: Get layer stride of level 0 on staging resources
Staging resources have one level, we shouldn't query the stride of
level > 0.
Fixes: 3c92abe35937 ("panfrost: Use panfrost_get_layer_stride() instead of open-coding it")
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8449>
Diffstat (limited to 'src')
-rw-r--r-- | src/gallium/drivers/panfrost/pan_resource.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c index 9c534497372..88d296bb62e 100644 --- a/src/gallium/drivers/panfrost/pan_resource.c +++ b/src/gallium/drivers/panfrost/pan_resource.c @@ -929,9 +929,13 @@ panfrost_ptr_map(struct pipe_context *pctx, /* We don't have s/w routines for AFBC, so use a staging texture */ if (drm_is_afbc(rsrc->layout.modifier)) { struct panfrost_resource *staging = pan_alloc_staging(ctx, rsrc, level, box); + + /* Staging resources have one LOD: level 0. Query the strides + * on this LOD. + */ transfer->base.stride = staging->layout.slices[0].line_stride; transfer->base.layer_stride = - panfrost_get_layer_stride(&staging->layout, level); + panfrost_get_layer_stride(&staging->layout, 0); transfer->staging.rsrc = &staging->base; |