diff options
author | Junwei Zhang <Jerry.Zhang@amd.com> | 2018-08-30 17:35:40 +0800 |
---|---|---|
committer | Christian König <christian.koenig@amd.com> | 2018-09-01 11:57:34 +0200 |
commit | f17725108809efaaf139f141808d537d14db3708 (patch) | |
tree | 94157e38cb6f8599c1db3999bce1178a888cb62f /amdgpu/amdgpu_bo.c | |
parent | f3d90e8db42d8d8a839558c0bc4c368c0107a4b9 (diff) | |
download | external_libdrm-f17725108809efaaf139f141808d537d14db3708.tar.gz external_libdrm-f17725108809efaaf139f141808d537d14db3708.tar.bz2 external_libdrm-f17725108809efaaf139f141808d537d14db3708.zip |
amdgpu: add error return value for finding bo by cpu mapping (v2)
If nothing is found, error should be returned.
v2: udpate the error value different from parameter check
Signed-off-by: Junwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Diffstat (limited to 'amdgpu/amdgpu_bo.c')
-rw-r--r-- | amdgpu/amdgpu_bo.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/amdgpu/amdgpu_bo.c b/amdgpu/amdgpu_bo.c index 2f4f90f6..a2fc5250 100644 --- a/amdgpu/amdgpu_bo.c +++ b/amdgpu/amdgpu_bo.c @@ -549,8 +549,9 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev, amdgpu_bo_handle *buf_handle, uint64_t *offset_in_bo) { - uint32_t i; struct amdgpu_bo *bo; + uint32_t i; + int r = 0; if (cpu == NULL || size == 0) return -EINVAL; @@ -577,10 +578,11 @@ int amdgpu_find_bo_by_cpu_mapping(amdgpu_device_handle dev, } else { *buf_handle = NULL; *offset_in_bo = 0; + r = -ENXIO; } pthread_mutex_unlock(&dev->bo_table_mutex); - return 0; + return r; } int amdgpu_create_bo_from_user_mem(amdgpu_device_handle dev, |