From: Alex Deucher Date: Thu, 23 Apr 2020 20:45:10 +0000 (-0400) Subject: drm/amdgpu: check ring type for secure IBs X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=b33f9d70b36889abafec3b638925640ac7c7fe12;p=linux.git drm/amdgpu: check ring type for secure IBs We don't support secure operation on compute rings at the moment so reject them. Reviewed-by: Andrey Grodzovsky Reviewed-by: Aaron Liu Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c index 24ae9f6c4255c..aebbbb573884c 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c @@ -162,6 +162,12 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs, return -EINVAL; } + if ((ib->flags & AMDGPU_IB_FLAGS_SECURE) && + (ring->funcs->type == AMDGPU_RING_TYPE_COMPUTE)) { + dev_err(adev->dev, "secure submissions not supported on compute rings\n"); + return -EINVAL; + } + alloc_size = ring->funcs->emit_frame_size + num_ibs * ring->funcs->emit_ib_size;