Skip to contentSkip to conversation

amdgpu: Don't use DRM_ERROR when failing to allocate a BO

PATCH In review Michel Dänzer 3 participants 3 messages Nov 14, 2017 – Nov 15, 2017 2 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 amdgpu: Don't use DRM_ERROR when failing to allocate a BO

From: Michel Dänzer <[email protected]>

This can be triggered by userspace, e.g. trying to allocate too large a BO, so it shouldn't log anything by default.

Callers need to handle failure anyway.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c    | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
index 951d625bbdd7..04ddd782bf6d 100644
@@ -72,7 +72,7 @@ int amdgpu_gem_object_create(struct amdgpu_device *adev, unsigned long size,
 				initial_domain |= AMDGPU_GEM_DOMAIN_GTT;
 				goto retry;
 			}
-			DRM_ERROR("Failed to allocate GEM object (%ld, %d, %u, %d)\n",
+			DRM_DEBUG("Failed to allocate GEM object (%ld, %d, %u, %d)\n",
 				  size, initial_domain, alignment, r);
 		}
 		return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -2
index 5acf20cfb1d0..3233d5988f66 100644
@@ -314,8 +314,8 @@ static bool amdgpu_bo_validate_size(struct amdgpu_device *adev,
 	return true;
 
 fail:
-	DRM_ERROR("BO size %lu > total memory in domain: %llu\n", size,
-					      man->size << PAGE_SHIFT);
+	DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size,
+		  man->size << PAGE_SHIFT);
 	return false;
 }
 
Signature · 6 lines
2.15.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20171114175214.2342-1-michel-otUistvHUpPR7s880joybQ@public.gmane.org

Reviewed-by Alex Deucher
#2 lore raw
Quoted 8 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Tuesday, November 14, 2017 12:52 PM
To: [email protected]
Subject: [PATCH] amdgpu: Don't use DRM_ERROR when failing to allocate a BO

Quoted 8 lines

From: Michel Dänzer <[email protected]>

This can be triggered by userspace, e.g. trying to allocate too large a BO, so it shouldn't log anything by default.

Callers need to handle failure anyway.

Quoted 43 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c    | 2 +-
 drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
index 951d625bbdd7..04ddd782bf6d 100644
@@ -72,7 +72,7 @@ int amdgpu_gem_object_create(struct amdgpu_device
 *adev, unsigned long size,
 				initial_domain |=
 AMDGPU_GEM_DOMAIN_GTT;
 				goto retry;
 			}
-			DRM_ERROR("Failed to allocate GEM object (%ld,
 %d, %u, %d)\n",
+			DRM_DEBUG("Failed to allocate GEM object (%ld,

%d, %u, %d)\n",

drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +0 -0
 				  size, initial_domain, alignment, r);
 		}
 		return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -3
index 5acf20cfb1d0..3233d5988f66 100644
@@ -314,8 +314,8 @@ static bool amdgpu_bo_validate_size(struct
 amdgpu_device *adev,
 	return true;
 
 fail:
-	DRM_ERROR("BO size %lu > total memory in domain: %llu\n", size,
-					      man->size << PAGE_SHIFT);
+	DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size,
+		  man->size << PAGE_SHIFT);
 	return false;
 }
 
--

2.15.0

Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB1652264B02251DCC0278385EF7280-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by
#4 lore raw

Am 14.11.2017 um 18:54 schrieb Deucher, Alexander:

Quoted 10 lines
Quoted 10 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Michel Dänzer
Sent: Tuesday, November 14, 2017 12:52 PM
To: [email protected]
Subject: [PATCH] amdgpu: Don't use DRM_ERROR when failing to allocate a BO

From: Michel Dänzer <[email protected]>

Quoted 7 lines
Quoted 6 lines

This can be triggered by userspace, e.g. trying to allocate too large a BO, so it shouldn't log anything by default.

Callers need to handle failure anyway.

Quoted 44 lines
Quoted 44 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c    | 2 +-
  drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 4 ++--
  2 files changed, 3 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +1 -1
index 951d625bbdd7..04ddd782bf6d 100644
@@ -72,7 +72,7 @@ int amdgpu_gem_object_create(struct amdgpu_device
 *adev, unsigned long size,
  				initial_domain |=
 AMDGPU_GEM_DOMAIN_GTT;
  				goto retry;
  			}
-			DRM_ERROR("Failed to allocate GEM object (%ld,
 %d, %u, %d)\n",
+			DRM_DEBUG("Failed to allocate GEM object (%ld,

%d, %u, %d)\n",
size, initial_domain, alignment, r);
}
return r;

drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +2 -3
index 5acf20cfb1d0..3233d5988f66 100644
@@ -314,8 +314,8 @@ static bool amdgpu_bo_validate_size(struct
 amdgpu_device *adev,
  	return true;
 
  fail:
-	DRM_ERROR("BO size %lu > total memory in domain: %llu\n", size,
-					      man->size << PAGE_SHIFT);
+	DRM_DEBUG("BO size %lu > total memory in domain: %llu\n", size,
+		  man->size << PAGE_SHIFT);
  	return false;
  }
 
--

2.15.0

Quoted 8 lines
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx