Skip to contentSkip to conversation

drm/radeon: don't init gpuvm if accel is disabled

PATCH In review Alex Deucher 4 participants 5 messages Jan 28, 2015 – Jan 29, 2015

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

PATCH 1/1 drm/radeon: don't init gpuvm if accel is disabled

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.

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=88786

---
 drivers/gpu/drm/radeon/radeon_kms.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/radeon/radeon_kms.c +7 -7
index 3cf9c1f..60751c1 100644
@@ -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);
Signature · 6 lines
1.8.3.1

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw
Quoted 10 lines · 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.

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=88786

Alex,
What is accel ?
Is there a situation where accel is disabled and HSA should work ? e.g. headless mode ?

If so, we need gpuvm for local memory.

Oded
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#2 lore raw

Am 29.01.2015 um 08:46 schrieb Oded Gabbay:

Quoted 8 lines · Alex Deucher
Quoted 5 lines

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.

Quoted 5 lines
Quoted 5 lines

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=88786

Patch is Reviewed-by: Christian König <[email protected]>

Quoted 3 lines

Alex,
What is accel ?
Is there a situation where accel is disabled and HSA should work ? e.g. headless mode ?

Not really.

Acceleration is disabled mostly because the user forgotten to install the firmware or we have a rather big bug in the driver and can't get the CP running.

In that case we still try to provide mode setting to get an error message on the screen, but everything else won't work.

Regards,
Christian.

Quoted 8 lines

If so, we need gpuvm for local memory.

Oded
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#3 lore raw
In reply to Oded Gabbay
Quoted 15 lines

-----Original Message-----
From: Gabbay, Oded
Sent: Thursday, January 29, 2015 2:46 AM
To: Alex Deucher; [email protected]
Cc: Deucher, Alexander; [email protected]
Subject: Re: [PATCH] drm/radeon: don't init gpuvm if accel is disabled

Quoted 5 lines · 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.

Quoted 7 lines
Quoted 5 lines

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=88786

Alex,
What is accel ?

If the ring tests fail and for some reason the IPs (e.g., gfx or sdma) are not available, the driver disables acceleration and basically falls back to modesetting only.

Quoted 3 lines

Is there a situation where accel is disabled and HSA should work ? e.g. headless
mode ?

No. We only disable acceleration if we can't get the IPs (gfx, sdma) initialized. Headless has nothing to do with acceleration in this context.

Alex

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#4 lore raw
Quoted 25 lines · Alexander
Quoted 15 lines

-----Original Message-----
From: Gabbay, Oded
Sent: Thursday, January 29, 2015 2:46 AM
To: Alex Deucher; [email protected]
Cc: Deucher, Alexander; [email protected]
Subject: Re: [PATCH] drm/radeon: don't init gpuvm if accel is disabled

Quoted 5 lines · 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.

Quoted 7 lines
Quoted 5 lines

Bug:
https://bugs.freedesktop.org/show_bug.cgi?id=88786

Alex,
What is accel ?

If the ring tests fail and for some reason the IPs (e.g., gfx or sdma) are not available, the driver disables acceleration and basically falls back to modesetting only.

Quoted 8 lines
Quoted 3 lines

Is there a situation where accel is disabled and HSA should work ? e.g. headless
mode ?

No. We only disable acceleration if we can't get the IPs (gfx, sdma) initialized. Headless has nothing to do with acceleration in this context.

Alex

OK, thanks for the explanation.

Oded