Commit 9c979e0e authored by Marek Olšák's avatar Marek Olšák
Browse files

amdgpu: add amdgpu_bo_handle_type_kms_noimport


Reviewed-by: Junwei Zhang's avatarJunwei Zhang <Jerry.Zhang@amd.com>
Reviewed-by: Christian König's avatarChristian König <christian.koenig@amd.com>
parent 68bd236a
......@@ -84,7 +84,12 @@ enum amdgpu_bo_handle_type {
amdgpu_bo_handle_type_kms = 1,
/** DMA-buf fd handle */
amdgpu_bo_handle_type_dma_buf_fd = 2
amdgpu_bo_handle_type_dma_buf_fd = 2,
/** KMS handle, but re-importing as a DMABUF handle through
* drmPrimeHandleToFD is forbidden. (Glamor does that)
*/
amdgpu_bo_handle_type_kms_noimport = 3,
};
/** Define known types of GPU VM VA ranges */
......
......@@ -241,6 +241,8 @@ int amdgpu_bo_export(amdgpu_bo_handle bo,
case amdgpu_bo_handle_type_kms:
amdgpu_add_handle_to_table(bo);
/* fall through */
case amdgpu_bo_handle_type_kms_noimport:
*shared_handle = bo->handle;
return 0;
......@@ -306,6 +308,7 @@ int amdgpu_bo_import(amdgpu_device_handle dev,
break;
case amdgpu_bo_handle_type_kms:
case amdgpu_bo_handle_type_kms_noimport:
/* Importing a KMS handle in not allowed. */
pthread_mutex_unlock(&dev->bo_table_mutex);
return -EPERM;
......@@ -375,6 +378,7 @@ int amdgpu_bo_import(amdgpu_device_handle dev,
break;
case amdgpu_bo_handle_type_kms:
case amdgpu_bo_handle_type_kms_noimport:
assert(0); /* unreachable */
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment