Mesa (staging/21.0): radeonsi: check that surface->alignment is != 0

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sun May 9 07:31:04 UTC 2021


Module: Mesa
Branch: staging/21.0
Commit: 3e3e6cf759aef66dedef5f8ef2a57b51d6d886db
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=3e3e6cf759aef66dedef5f8ef2a57b51d6d886db

Author: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Date:   Fri May  7 09:26:29 2021 +0200

radeonsi: check that surface->alignment is != 0

This is a workaround for issue 4605: alignment should always be
at least 256 but in this specific case it seems to be 0.

Skip the check in this case to "fix" the regression.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4605
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10680>

---

 src/amd/common/ac_surface.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c
index e534c16b69d..f010e76d071 100644
--- a/src/amd/common/ac_surface.c
+++ b/src/amd/common/ac_surface.c
@@ -2878,7 +2878,7 @@ bool ac_surface_override_offset_stride(const struct radeon_info *info, struct ra
       }
    }
 
-   if (offset & (surf->alignment - 1) ||
+   if ((surf->alignment && offset & (surf->alignment - 1)) ||
        offset >= UINT64_MAX - surf->total_size)
       return false;
 



More information about the mesa-commit mailing list