Mesa (master): panfrost: split asserts in pandecode

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Apr 12 05:13:33 UTC 2019


Module: Mesa
Branch: master
Commit: c35ae93803aead8f28f039a7fd1c1251cacfd827
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=c35ae93803aead8f28f039a7fd1c1251cacfd827

Author: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Date:   Thu Apr 11 09:09:17 2019 +0200

panfrost: split asserts in pandecode

Signed-off-by: Tomeu Vizoso <tomeu.vizoso at collabora.com>
Reviewed-by: Eric Engestrom <eric.engestrom at intel.com>
Reviewed-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>

---

 src/gallium/drivers/panfrost/pandecode/mmap.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/gallium/drivers/panfrost/pandecode/mmap.h b/src/gallium/drivers/panfrost/pandecode/mmap.h
index 1a208336e81..e9acae877f7 100644
--- a/src/gallium/drivers/panfrost/pandecode/mmap.h
+++ b/src/gallium/drivers/panfrost/pandecode/mmap.h
@@ -54,9 +54,8 @@ __pandecode_fetch_gpu_mem(const struct pandecode_mapped_memory *mem,
         if (!mem)
                 mem = pandecode_find_mapped_gpu_mem_containing(gpu_va);
 
-        if (!mem ||
-                        size + (gpu_va - mem->gpu_va) > mem->length)
-                assert(0);
+        assert(mem);
+        assert(size + (gpu_va - mem->gpu_va) <= mem->length);
 
         return mem->addr + gpu_va - mem->gpu_va;
 }




More information about the mesa-commit mailing list