Mesa (master): winsys/amdgpu: fix the type of memory usage counters

Marek Olšák mareko at kemper.freedesktop.org
Wed Aug 19 10:05:26 UTC 2015


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

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon Aug 17 19:55:57 2015 +0200

winsys/amdgpu: fix the type of memory usage counters

If the 32-bit types overflowed, the driver could submit an IB that uses much
more memory than is available.

Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
Reviewed-by: Edward O'Callaghan <eocallaghan at alterapraxis.com>
Reviewed-by: Michel Dänzer <michel.daenzer at amd.com>

---

 src/gallium/winsys/amdgpu/drm/amdgpu_cs.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
index 0842259..12c6b62 100644
--- a/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
+++ b/src/gallium/winsys/amdgpu/drm/amdgpu_cs.h
@@ -77,8 +77,8 @@ struct amdgpu_cs {
 
    int                         buffer_indices_hashlist[512];
 
-   unsigned                    used_vram;
-   unsigned                    used_gart;
+   uint64_t                    used_vram;
+   uint64_t                    used_gart;
 
    unsigned                    max_dependencies;
 };




More information about the mesa-commit mailing list