[PATCH] drm/radeon: reject bo creation from ioctl when the gpu is disabled

Christian König christian.koenig at amd.com
Thu Apr 27 12:00:21 UTC 2017


Am 27.04.2017 um 12:57 schrieb Julien Isorce:
> 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

NAK, even if accel isn't working we want to display something and for 
that we need to be able to create BOs.

Christian.

>
> 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,




More information about the amd-gfx mailing list