mirror of
https://gitlab.freedesktop.org/mesa/drm.git
synced 2025-12-29 22:00:17 +01:00
amdgpu: do not call BO_LIST ioctl when no resource referred
Signed-off-by: monk.liu <monk.liu@amd.com> Reviewed-by: Christian König <christian.koenig@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
37d8b734a6
commit
d8e8dee7ce
1 changed files with 9 additions and 0 deletions
|
|
@ -635,6 +635,12 @@ static int amdgpu_cs_create_bo_list(amdgpu_device_handle dev,
|
|||
int r;
|
||||
|
||||
num_resources = request->number_of_resources;
|
||||
|
||||
if (!num_resources) {
|
||||
*handle = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (fence_ib)
|
||||
++num_resources;
|
||||
|
||||
|
|
@ -671,6 +677,9 @@ static int amdgpu_cs_free_bo_list(amdgpu_device_handle dev, uint32_t handle)
|
|||
union drm_amdgpu_bo_list args;
|
||||
int r;
|
||||
|
||||
if (!handle)
|
||||
return 0;
|
||||
|
||||
memset(&args, 0, sizeof(args));
|
||||
args.in.operation = AMDGPU_BO_LIST_OP_DESTROY;
|
||||
args.in.list_handle = handle;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue