[PATCH] drm/radeon: reject bo creation from ioctl when the gpu is disabled
Julien Isorce
julien.isorce at gmail.com
Thu Apr 27 10:57:52 UTC 2017
Like done in radeon_cs_ioctl.
In particular it avoids mesa to call map/unmap:
radeon_create_bo
ioctl(DRM_RADEON_GEM_CREATE) -> ok
ioctl(DRM_RADEON_GEM_VA-MAP)
radeon_destroy_bo
ioctl(DRM_RADEON_GEM_VA-UNMAP)
Encountered also cases where the vm_manager succeeded to be enabled after
a gpu reset while the GFX ring was not responding so accel was disabled.
https://bugs.freedesktop.org/show_bug.cgi?id=96271
Signed-off-by: Julien Isorce <jisorce at oblong.com>
---
drivers/gpu/drm/radeon/radeon_gem.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/drivers/gpu/drm/radeon/radeon_gem.c b/drivers/gpu/drm/radeon/radeon_gem.c
index b97c92b..1030001 100644
--- a/drivers/gpu/drm/radeon/radeon_gem.c
+++ b/drivers/gpu/drm/radeon/radeon_gem.c
@@ -259,6 +259,13 @@ int radeon_gem_create_ioctl(struct drm_device *dev, void *data,
int r;
down_read(&rdev->exclusive_lock);
+
+ if (!rdev->accel_working &&
+ args->initial_domain != RADEON_GEM_DOMAIN_CPU) {
+ up_read(&rdev->exclusive_lock);
+ return -EBUSY;
+ }
+
/* create a gem object to contain this object in */
args->size = roundup(args->size, PAGE_SIZE);
r = radeon_gem_object_create(rdev, args->size, args->alignment,
--
2.7.4
More information about the amd-gfx
mailing list