diff options
author | Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> | 2020-03-17 16:50:56 +0100 |
---|---|---|
committer | Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com> | 2020-03-23 13:18:01 +0100 |
commit | b9bf42d3e1969248b18f87a2b7973901ffb79b36 (patch) | |
tree | 714d91785e01083f47a750944d21ae5fcb41c975 /amdgpu | |
parent | bb4e154d3dd8ddbe4b19d7ff2439933807318b5a (diff) | |
download | libdrm-b9bf42d3e1969248b18f87a2b7973901ffb79b36.tar.gz libdrm-b9bf42d3e1969248b18f87a2b7973901ffb79b36.tar.bz2 libdrm-b9bf42d3e1969248b18f87a2b7973901ffb79b36.zip |
amdgpu: increase cpu_map_count storage size
Mesa expects to be able to map the same buffer, without unmapping it.
This leads to problem on long-running program.
On the other hand, libdrm uses cpu_map_count as a refcount and expects
its value to decrease so it can unmap buffers.
The previoulsy proprosed fix (https://patchwork.freedesktop.org/patch/258005/)
stopped increased the counter when it went past INT_MAX.
This commit instead proposes to use a larger type to store cpu_map_count.
The outcome is the same: long running apps will not crash, only the
implementation differs.
Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/1423
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Diffstat (limited to 'amdgpu')
-rw-r--r-- | amdgpu/amdgpu_internal.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/amdgpu/amdgpu_internal.h b/amdgpu/amdgpu_internal.h index a340abbd..37a7c9d5 100644 --- a/amdgpu/amdgpu_internal.h +++ b/amdgpu/amdgpu_internal.h @@ -102,7 +102,7 @@ struct amdgpu_bo { pthread_mutex_t cpu_access_mutex; void *cpu_ptr; - int cpu_map_count; + int64_t cpu_map_count; }; struct amdgpu_bo_list { |