diff mbox

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

Message ID 1422474095-20982-1-git-send-email-alexander.deucher@amd.com (mailing list archive)
State New, archived
Headers show

Commit Message

Alex Deucher Jan. 28, 2015, 7:41 p.m. UTC
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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
---
 drivers/gpu/drm/radeon/radeon_kms.c | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

Comments

Oded Gabbay Jan. 29, 2015, 7:46 a.m. UTC | #1
On 01/28/2015 09:41 PM, Alex Deucher wrote:
> 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
>
> Signed-off-by: Alex Deucher<alexander.deucher@amd.com>
> Cc:stable@vger.kernel.org
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
Christian König Jan. 29, 2015, 10:36 a.m. UTC | #2
Am 29.01.2015 um 08:46 schrieb Oded Gabbay:
>
>
> On 01/28/2015 09:41 PM, Alex Deucher wrote:
>> 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
>>
>> Signed-off-by: Alex Deucher<alexander.deucher@amd.com>
>> Cc:stable@vger.kernel.org

Patch is Reviewed-by: Christian König <christian.koenig@amd.com>

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


>
> If so, we need gpuvm for local memory.
>
>     Oded
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher Jan. 29, 2015, 1:54 p.m. UTC | #3
> -----Original Message-----

> From: Gabbay, Oded

> Sent: Thursday, January 29, 2015 2:46 AM

> To: Alex Deucher; dri-devel@lists.freedesktop.org

> Cc: Deucher, Alexander; stable@vger.kernel.org

> Subject: Re: [PATCH] drm/radeon: don't init gpuvm if accel is disabled

> 

> 

> 

> On 01/28/2015 09:41 PM, Alex Deucher wrote:

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

> >

> > Signed-off-by: Alex Deucher<alexander.deucher@amd.com>

> > Cc:stable@vger.kernel.org

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

> 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
Oded Gabbay Jan. 29, 2015, 1:58 p.m. UTC | #4
On 01/29/2015 03:54 PM, Deucher, Alexander wrote:
>> -----Original Message-----
>> From: Gabbay, Oded
>> Sent: Thursday, January 29, 2015 2:46 AM
>> To: Alex Deucher; dri-devel@lists.freedesktop.org
>> Cc: Deucher, Alexander; stable@vger.kernel.org
>> Subject: Re: [PATCH] drm/radeon: don't init gpuvm if accel is disabled
>>
>>
>>
>> On 01/28/2015 09:41 PM, Alex Deucher wrote:
>>> 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
>>>
>>> Signed-off-by: Alex Deucher<alexander.deucher@amd.com>
>>> Cc:stable@vger.kernel.org
>> 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.
>
>> 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
diff mbox

Patch

diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c
index 3cf9c1f..60751c1 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);