mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
drm/amdgpu: Control NPA DMA-buf importing
NPA DMA-Bufs can only be imported on the same device as the original BO. In source-identification mode NPA addresses are importer-specific. Each GPU needs to import the UALink handle by themselves. Sharing the NPA addresses between devices is meaningless and potentially dangerous. Put controls to ensure this is not violated. Signed-off-by: Mukul Joshi <mukul.joshi@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
42cb7c53fa
commit
89496dcdca
|
|
@ -558,6 +558,11 @@ struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev,
|
|||
*/
|
||||
drm_gem_object_get(obj);
|
||||
return obj;
|
||||
} else {
|
||||
struct ttm_resource *mem = gem_to_amdgpu_bo(obj)->tbo.resource;
|
||||
/* NPA DMA-buf can only be imported on the same device. */
|
||||
if (mem && mem->mem_type == AMDGPU_PL_NPA)
|
||||
return ERR_PTR(-EPERM);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user