aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/rs400.c
diff options
context:
space:
mode:
authorJerome Glisse <jglisse@redhat.com>2012-02-20 17:57:20 -0500
committerDave Airlie <airlied@redhat.com>2012-02-22 05:30:02 -0500
commit6b7746e8768e1c550b320d5af761f73e5aa37f76 (patch)
treead04aeca4bbc904418d21717f17689f1c0aa5bf7 /drivers/gpu/drm/radeon/rs400.c
parentf0d14daa6906070ca044b86f483fdde7d81f5294 (diff)
drm/radeon/kms: properly set accel working flag and bailout when false
If accel is not working many subsystem such as the ib pool might not be initialized properly that can lead to segfault inside kernel when cs ioctl is call with non working acceleration. To avoid this make sure the accel working flag is false when an error in GPU startup happen and return EBUSY from cs ioctl if accel is not working. Signed-off-by: Jerome Glisse <jglisse@redhat.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/rs400.c')
-rw-r--r--drivers/gpu/drm/radeon/rs400.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index b0ce84a20a68..866a05be75f2 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -442,6 +442,8 @@ static int rs400_startup(struct radeon_device *rdev)
442 442
443int rs400_resume(struct radeon_device *rdev) 443int rs400_resume(struct radeon_device *rdev)
444{ 444{
445 int r;
446
445 /* Make sur GART are not working */ 447 /* Make sur GART are not working */
446 rs400_gart_disable(rdev); 448 rs400_gart_disable(rdev);
447 /* Resume clock before doing reset */ 449 /* Resume clock before doing reset */
@@ -462,7 +464,11 @@ int rs400_resume(struct radeon_device *rdev)
462 radeon_surface_init(rdev); 464 radeon_surface_init(rdev);
463 465
464 rdev->accel_working = true; 466 rdev->accel_working = true;
465 return rs400_startup(rdev); 467 r = rs400_startup(rdev);
468 if (r) {
469 rdev->accel_working = false;
470 }
471 return r;
466} 472}
467 473
468int rs400_suspend(struct radeon_device *rdev) 474int rs400_suspend(struct radeon_device *rdev)