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 (
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: mesa/mesa#1423Reviewed-by: Michel Dänzer's avatarMichel Dänzer <>
Reviewed-by: default avatarMarek Olšák <>
parent bb4e154d
Pipeline #127892 passed with stage
in 1 minute and 18 seconds
......@@ -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 {
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment