drm/amdgpu: fix the wrong logic checking when secure buffer is created (v3)
authorHuang Rui <ray.huang@amd.com>
Tue, 18 Feb 2020 05:07:42 +0000 (13:07 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 28 Apr 2020 20:20:29 +0000 (16:20 -0400)
While the current amdgpu doesn't support TMZ, it will return the error if user
mode would like to allocate secure buffer.

v2: we didn't need this checking anymore.
v3: only print message once time.

Signed-off-by: Huang Rui <ray.huang@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Acked-by: Nirmoy Das <Nirmoy.Das@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c

index 46cea436945f7a3888dac4af8cd597ace6ede5c2..77d988a0033f223efbd2779c85a68eb613dc8b1e 100644 (file)
@@ -242,8 +242,8 @@ int amdgpu_gem_create_ioctl(struct drm_device *dev, void *data,
        if (args->in.domains & ~AMDGPU_GEM_DOMAIN_MASK)
                return -EINVAL;
 
-       if (amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
-               DRM_ERROR("Cannot allocate secure buffer since TMZ is disabled\n");
+       if (!amdgpu_is_tmz(adev) && (flags & AMDGPU_GEM_CREATE_ENCRYPTED)) {
+               DRM_NOTE_ONCE("Cannot allocate secure buffer since TMZ is disabled\n");
                return -EINVAL;
        }