drm/radeon/kms: r600/r700 don't test ib if ib initialization fails

If ib initialization failed don't try to test ib as it will result
in an oops (accessing NULL ib buffer ptr).

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Signed-off-by: Dave Airlie <airlied@linux.ie>
This commit is contained in:
Jerome Glisse 2010-01-17 21:21:56 +01:00 коммит произвёл Dave Airlie
Родитель 7e71c9e2e7
Коммит db96380ea2
2 изменённых файлов: 14 добавлений и 12 удалений

Просмотреть файл

@ -2064,13 +2064,14 @@ int r600_init(struct radeon_device *rdev)
if (rdev->accel_working) { if (rdev->accel_working) {
r = radeon_ib_pool_init(rdev); r = radeon_ib_pool_init(rdev);
if (r) { if (r) {
DRM_ERROR("radeon: failed initializing IB pool (%d).\n", r); dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
rdev->accel_working = false;
}
r = r600_ib_test(rdev);
if (r) {
DRM_ERROR("radeon: failed testing IB (%d).\n", r);
rdev->accel_working = false; rdev->accel_working = false;
} else {
r = r600_ib_test(rdev);
if (r) {
dev_err(rdev->dev, "IB test failed (%d).\n", r);
rdev->accel_working = false;
}
} }
} }

Просмотреть файл

@ -1075,13 +1075,14 @@ int rv770_init(struct radeon_device *rdev)
if (rdev->accel_working) { if (rdev->accel_working) {
r = radeon_ib_pool_init(rdev); r = radeon_ib_pool_init(rdev);
if (r) { if (r) {
DRM_ERROR("radeon: failed initializing IB pool (%d).\n", r); dev_err(rdev->dev, "IB initialization failed (%d).\n", r);
rdev->accel_working = false;
}
r = r600_ib_test(rdev);
if (r) {
DRM_ERROR("radeon: failed testing IB (%d).\n", r);
rdev->accel_working = false; rdev->accel_working = false;
} else {
r = r600_ib_test(rdev);
if (r) {
dev_err(rdev->dev, "IB test failed (%d).\n", r);
rdev->accel_working = false;
}
} }
} }
return 0; return 0;