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>
This commit is contained in:
committed by
Dave Airlie
parent
f0d14daa69
commit
6b7746e876
@ -291,6 +291,8 @@ static int r420_startup(struct radeon_device *rdev)
|
||||
|
||||
int r420_resume(struct radeon_device *rdev)
|
||||
{
|
||||
int r;
|
||||
|
||||
/* Make sur GART are not working */
|
||||
if (rdev->flags & RADEON_IS_PCIE)
|
||||
rv370_pcie_gart_disable(rdev);
|
||||
@ -316,7 +318,11 @@ int r420_resume(struct radeon_device *rdev)
|
||||
radeon_surface_init(rdev);
|
||||
|
||||
rdev->accel_working = true;
|
||||
return r420_startup(rdev);
|
||||
r = r420_startup(rdev);
|
||||
if (r) {
|
||||
rdev->accel_working = false;
|
||||
}
|
||||
return r;
|
||||
}
|
||||
|
||||
int r420_suspend(struct radeon_device *rdev)
|
||||
|
Reference in New Issue
Block a user