[PATCH] drm/radeon: don't init gpuvm if accel is disabled (v2)
Christian König
deathsimple at vodafone.de
Fri Jan 30 01:18:08 PST 2015
Am 29.01.2015 um 16:35 schrieb Alex Deucher:
> If acceleration is disabled, it does not make sense
> to init gpuvm since nothing will use it. Moreover,
> if radeon_vm_init() gets called it uses accel to try
> and clear the pde tables, etc. which results in a bug.
>
> v2: handle vm_fini as well
>
> Bug:
> https://bugs.freedesktop.org/show_bug.cgi?id=88786
>
> Signed-off-by: Alex Deucher <alexander.deucher at amd.com>
> Cc: stable at vger.kernel.org
Reviewed-by: Christian König <christian.koenig at amd.com>
> ---
> drivers/gpu/drm/radeon/radeon_kms.c | 16 ++++++++--------
> 1 file changed, 8 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
> index 3cf9c1f..686411e 100644
> --- a/drivers/gpu/drm/radeon/radeon_kms.c
> +++ b/drivers/gpu/drm/radeon/radeon_kms.c
> @@ -605,14 +605,14 @@ int radeon_driver_open_kms(struct drm_device *dev, struct drm_file *file_priv)
> return -ENOMEM;
> }
>
> - vm = &fpriv->vm;
> - r = radeon_vm_init(rdev, vm);
> - if (r) {
> - kfree(fpriv);
> - return r;
> - }
> -
> if (rdev->accel_working) {
> + vm = &fpriv->vm;
> + r = radeon_vm_init(rdev, vm);
> + if (r) {
> + kfree(fpriv);
> + return r;
> + }
> +
> r = radeon_bo_reserve(rdev->ring_tmp_bo.bo, false);
> if (r) {
> radeon_vm_fini(rdev, vm);
> @@ -668,9 +668,9 @@ void radeon_driver_postclose_kms(struct drm_device *dev,
> radeon_vm_bo_rmv(rdev, vm->ib_bo_va);
> radeon_bo_unreserve(rdev->ring_tmp_bo.bo);
> }
> + radeon_vm_fini(rdev, vm);
> }
>
> - radeon_vm_fini(rdev, vm);
> kfree(fpriv);
> file_priv->driver_priv = NULL;
> }
More information about the dri-devel
mailing list