Mesa (main): panfrost: Only handle 2D in should_linear_convert
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Sat Apr 16 14:13:59 UTC 2022
Module: Mesa
Branch: main
Commit: 594653173b741a5eaf5459afe6bcba0fc02dbfef
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=594653173b741a5eaf5459afe6bcba0fc02dbfef
Author: Alyssa Rosenzweig <alyssa at collabora.com>
Date: Thu Apr 7 14:46:55 2022 -0400
panfrost: Only handle 2D in should_linear_convert
The tiled->linear conversion mechanism is meant for 2D and doesn't handle tiled
+ 3D. This use case is not expected application behaviour, it's not worth the
complexity to try to handle.
Signed-off-by: Alyssa Rosenzweig <alyssa at collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15803>
---
src/gallium/drivers/panfrost/pan_resource.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/gallium/drivers/panfrost/pan_resource.c b/src/gallium/drivers/panfrost/pan_resource.c
index 2f7a9bf5cc1..8d23bf74a87 100644
--- a/src/gallium/drivers/panfrost/pan_resource.c
+++ b/src/gallium/drivers/panfrost/pan_resource.c
@@ -1125,18 +1125,18 @@ panfrost_should_linear_convert(struct panfrost_device *dev,
*
* For now we just switch to linear after a number of complete
* overwrites to keep things simple, but we could do better.
+ *
+ * This mechanism is only implemented for 2D resources. This suffices
+ * for video players, its intended use case.
*/
- unsigned depth = prsrc->base.target == PIPE_TEXTURE_3D ?
- prsrc->base.depth0 : prsrc->base.array_size;
bool entire_overwrite =
+ panfrost_is_2d(prsrc) &&
prsrc->base.last_level == 0 &&
transfer->box.width == prsrc->base.width0 &&
transfer->box.height == prsrc->base.height0 &&
- transfer->box.depth == depth &&
transfer->box.x == 0 &&
- transfer->box.y == 0 &&
- transfer->box.z == 0;
+ transfer->box.y == 0;
if (entire_overwrite)
++prsrc->modifier_updates;
More information about the mesa-commit
mailing list