aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2009-11-30 23:06:31 -0500
committerDave Airlie <airlied@redhat.com>2009-12-01 20:37:17 -0500
commit72542d77058bd45ccafd1e15ed3c70349fe3277b (patch)
tree11390360e6c0f250915a2bc202f94a2fb86a3958 /drivers
parent4b30b87042aa71ed8682e4df622a10456796fccd (diff)
drm/radeon/kms: ignore unposted GPUs with no BIOS.
If we find a GPU but we can't find its BIOS and it isn't posted, then ignore it. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/radeon/r100.c6
-rw-r--r--drivers/gpu/drm/radeon/r300.c6
-rw-r--r--drivers/gpu/drm/radeon/r420.c11
-rw-r--r--drivers/gpu/drm/radeon/r520.c3
-rw-r--r--drivers/gpu/drm/radeon/r600.c6
-rw-r--r--drivers/gpu/drm/radeon/radeon.h1
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c18
-rw-r--r--drivers/gpu/drm/radeon/rs400.c7
-rw-r--r--drivers/gpu/drm/radeon/rs600.c7
-rw-r--r--drivers/gpu/drm/radeon/rs690.c7
-rw-r--r--drivers/gpu/drm/radeon/rv515.c6
-rw-r--r--drivers/gpu/drm/radeon/rv770.c6
12 files changed, 50 insertions, 34 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c
index 772bcd863741..0862fa4b746d 100644
--- a/drivers/gpu/drm/radeon/r100.c
+++ b/drivers/gpu/drm/radeon/r100.c
@@ -3257,10 +3257,8 @@ int r100_init(struct radeon_device *rdev)
3257 RREG32(R_0007C0_CP_STAT)); 3257 RREG32(R_0007C0_CP_STAT));
3258 } 3258 }
3259 /* check if cards are posted or not */ 3259 /* check if cards are posted or not */
3260 if (!radeon_card_posted(rdev) && rdev->bios) { 3260 if (radeon_boot_test_post_card(rdev) == false)
3261 DRM_INFO("GPU not posted. posting now...\n"); 3261 return -EINVAL;
3262 radeon_combios_asic_init(rdev->ddev);
3263 }
3264 /* Set asic errata */ 3262 /* Set asic errata */
3265 r100_errata(rdev); 3263 r100_errata(rdev);
3266 /* Initialize clocks */ 3264 /* Initialize clocks */
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 9a5798544b42..430fc2a984b2 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -1309,10 +1309,8 @@ int r300_init(struct radeon_device *rdev)
1309 RREG32(R_0007C0_CP_STAT)); 1309 RREG32(R_0007C0_CP_STAT));
1310 } 1310 }
1311 /* check if cards are posted or not */ 1311 /* check if cards are posted or not */
1312 if (!radeon_card_posted(rdev) && rdev->bios) { 1312 if (radeon_boot_test_post_card(rdev) == false)
1313 DRM_INFO("GPU not posted. posting now...\n"); 1313 return -EINVAL;
1314 radeon_combios_asic_init(rdev->ddev);
1315 }
1316 /* Set asic errata */ 1314 /* Set asic errata */
1317 r300_errata(rdev); 1315 r300_errata(rdev);
1318 /* Initialize clocks */ 1316 /* Initialize clocks */
diff --git a/drivers/gpu/drm/radeon/r420.c b/drivers/gpu/drm/radeon/r420.c
index e7e4f5a90ebe..e7c34776a013 100644
--- a/drivers/gpu/drm/radeon/r420.c
+++ b/drivers/gpu/drm/radeon/r420.c
@@ -301,14 +301,9 @@ int r420_init(struct radeon_device *rdev)
301 RREG32(R_0007C0_CP_STAT)); 301 RREG32(R_0007C0_CP_STAT));
302 } 302 }
303 /* check if cards are posted or not */ 303 /* check if cards are posted or not */
304 if (!radeon_card_posted(rdev) && rdev->bios) { 304 if (radeon_boot_test_post_card(rdev) == false)
305 DRM_INFO("GPU not posted. posting now...\n"); 305 return -EINVAL;
306 if (rdev->is_atom_bios) { 306
307 atom_asic_init(rdev->mode_info.atom_context);
308 } else {
309 radeon_combios_asic_init(rdev->ddev);
310 }
311 }
312 /* Initialize clocks */ 307 /* Initialize clocks */
313 radeon_get_clock_info(rdev->ddev); 308 radeon_get_clock_info(rdev->ddev);
314 /* Initialize power management */ 309 /* Initialize power management */
diff --git a/drivers/gpu/drm/radeon/r520.c b/drivers/gpu/drm/radeon/r520.c
index f7435185c0a6..26c37792c8fe 100644
--- a/drivers/gpu/drm/radeon/r520.c
+++ b/drivers/gpu/drm/radeon/r520.c
@@ -254,6 +254,9 @@ int r520_init(struct radeon_device *rdev)
254 RREG32(R_0007C0_CP_STAT)); 254 RREG32(R_0007C0_CP_STAT));
255 } 255 }
256 /* check if cards are posted or not */ 256 /* check if cards are posted or not */
257 if (radeon_boot_test_post_card(rdev) == false)
258 return -EINVAL;
259
257 if (!radeon_card_posted(rdev) && rdev->bios) { 260 if (!radeon_card_posted(rdev) && rdev->bios) {
258 DRM_INFO("GPU not posted. posting now...\n"); 261 DRM_INFO("GPU not posted. posting now...\n");
259 atom_asic_init(rdev->mode_info.atom_context); 262 atom_asic_init(rdev->mode_info.atom_context);
diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
index 797a36f9a0f4..3dbd93e44345 100644
--- a/drivers/gpu/drm/radeon/r600.c
+++ b/drivers/gpu/drm/radeon/r600.c
@@ -1631,7 +1631,11 @@ int r600_init(struct radeon_device *rdev)
1631 if (r) 1631 if (r)
1632 return r; 1632 return r;
1633 /* Post card if necessary */ 1633 /* Post card if necessary */
1634 if (!r600_card_posted(rdev) && rdev->bios) { 1634 if (!r600_card_posted(rdev)) {
1635 if (!rdev->bios) {
1636 dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n");
1637 return -EINVAL;
1638 }
1635 DRM_INFO("GPU not posted. posting now...\n"); 1639 DRM_INFO("GPU not posted. posting now...\n");
1636 atom_asic_init(rdev->mode_info.atom_context); 1640 atom_asic_init(rdev->mode_info.atom_context);
1637 } 1641 }
diff --git a/drivers/gpu/drm/radeon/radeon.h b/drivers/gpu/drm/radeon/radeon.h
index c32fe1cec818..15b9e03bb589 100644
--- a/drivers/gpu/drm/radeon/radeon.h
+++ b/drivers/gpu/drm/radeon/radeon.h
@@ -979,6 +979,7 @@ extern int radeon_gart_table_vram_pin(struct radeon_device *rdev);
979extern int radeon_modeset_init(struct radeon_device *rdev); 979extern int radeon_modeset_init(struct radeon_device *rdev);
980extern void radeon_modeset_fini(struct radeon_device *rdev); 980extern void radeon_modeset_fini(struct radeon_device *rdev);
981extern bool radeon_card_posted(struct radeon_device *rdev); 981extern bool radeon_card_posted(struct radeon_device *rdev);
982extern bool radeon_boot_test_post_card(struct radeon_device *rdev);
982extern int radeon_clocks_init(struct radeon_device *rdev); 983extern int radeon_clocks_init(struct radeon_device *rdev);
983extern void radeon_clocks_fini(struct radeon_device *rdev); 984extern void radeon_clocks_fini(struct radeon_device *rdev);
984extern void radeon_scratch_init(struct radeon_device *rdev); 985extern void radeon_scratch_init(struct radeon_device *rdev);
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index db0835d9a537..c43a690aedc6 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -208,6 +208,24 @@ bool radeon_card_posted(struct radeon_device *rdev)
208 208
209} 209}
210 210
211bool radeon_boot_test_post_card(struct radeon_device *rdev)
212{
213 if (radeon_card_posted(rdev))
214 return true;
215
216 if (rdev->bios) {
217 DRM_INFO("GPU not posted. posting now...\n");
218 if (rdev->is_atom_bios)
219 atom_asic_init(rdev->mode_info.atom_context);
220 else
221 radeon_combios_asic_init(rdev->ddev);
222 return true;
223 } else {
224 dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n");
225 return false;
226 }
227}
228
211int radeon_dummy_page_init(struct radeon_device *rdev) 229int radeon_dummy_page_init(struct radeon_device *rdev)
212{ 230{
213 rdev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO); 231 rdev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO);
diff --git a/drivers/gpu/drm/radeon/rs400.c b/drivers/gpu/drm/radeon/rs400.c
index f1de558aeb39..2e5b9450a804 100644
--- a/drivers/gpu/drm/radeon/rs400.c
+++ b/drivers/gpu/drm/radeon/rs400.c
@@ -491,10 +491,9 @@ int rs400_init(struct radeon_device *rdev)
491 RREG32(R_0007C0_CP_STAT)); 491 RREG32(R_0007C0_CP_STAT));
492 } 492 }
493 /* check if cards are posted or not */ 493 /* check if cards are posted or not */
494 if (!radeon_card_posted(rdev) && rdev->bios) { 494 if (radeon_boot_test_post_card(rdev) == false)
495 DRM_INFO("GPU not posted. posting now...\n"); 495 return -EINVAL;
496 radeon_combios_asic_init(rdev->ddev); 496
497 }
498 /* Initialize clocks */ 497 /* Initialize clocks */
499 radeon_get_clock_info(rdev->ddev); 498 radeon_get_clock_info(rdev->ddev);
500 /* Get vram informations */ 499 /* Get vram informations */
diff --git a/drivers/gpu/drm/radeon/rs600.c b/drivers/gpu/drm/radeon/rs600.c
index 5f117cd8736a..d2dac45173c2 100644
--- a/drivers/gpu/drm/radeon/rs600.c
+++ b/drivers/gpu/drm/radeon/rs600.c
@@ -482,10 +482,9 @@ int rs600_init(struct radeon_device *rdev)
482 RREG32(R_0007C0_CP_STAT)); 482 RREG32(R_0007C0_CP_STAT));
483 } 483 }
484 /* check if cards are posted or not */ 484 /* check if cards are posted or not */
485 if (!radeon_card_posted(rdev) && rdev->bios) { 485 if (radeon_boot_test_post_card(rdev) == false)
486 DRM_INFO("GPU not posted. posting now...\n"); 486 return -EINVAL;
487 atom_asic_init(rdev->mode_info.atom_context); 487
488 }
489 /* Initialize clocks */ 488 /* Initialize clocks */
490 radeon_get_clock_info(rdev->ddev); 489 radeon_get_clock_info(rdev->ddev);
491 /* Initialize power management */ 490 /* Initialize power management */
diff --git a/drivers/gpu/drm/radeon/rs690.c b/drivers/gpu/drm/radeon/rs690.c
index 27547175cf93..7ffd6db1223f 100644
--- a/drivers/gpu/drm/radeon/rs690.c
+++ b/drivers/gpu/drm/radeon/rs690.c
@@ -700,10 +700,9 @@ int rs690_init(struct radeon_device *rdev)
700 RREG32(R_0007C0_CP_STAT)); 700 RREG32(R_0007C0_CP_STAT));
701 } 701 }
702 /* check if cards are posted or not */ 702 /* check if cards are posted or not */
703 if (!radeon_card_posted(rdev) && rdev->bios) { 703 if (radeon_boot_test_post_card(rdev) == false)
704 DRM_INFO("GPU not posted. posting now...\n"); 704 return -EINVAL;
705 atom_asic_init(rdev->mode_info.atom_context); 705
706 }
707 /* Initialize clocks */ 706 /* Initialize clocks */
708 radeon_get_clock_info(rdev->ddev); 707 radeon_get_clock_info(rdev->ddev);
709 /* Initialize power management */ 708 /* Initialize power management */
diff --git a/drivers/gpu/drm/radeon/rv515.c b/drivers/gpu/drm/radeon/rv515.c
index ba68c9fe90a1..93de4a9807ab 100644
--- a/drivers/gpu/drm/radeon/rv515.c
+++ b/drivers/gpu/drm/radeon/rv515.c
@@ -580,10 +580,8 @@ int rv515_init(struct radeon_device *rdev)
580 RREG32(R_0007C0_CP_STAT)); 580 RREG32(R_0007C0_CP_STAT));
581 } 581 }
582 /* check if cards are posted or not */ 582 /* check if cards are posted or not */
583 if (!radeon_card_posted(rdev) && rdev->bios) { 583 if (radeon_boot_test_post_card(rdev) == false)
584 DRM_INFO("GPU not posted. posting now...\n"); 584 return -EINVAL;
585 atom_asic_init(rdev->mode_info.atom_context);
586 }
587 /* Initialize clocks */ 585 /* Initialize clocks */
588 radeon_get_clock_info(rdev->ddev); 586 radeon_get_clock_info(rdev->ddev);
589 /* Initialize power management */ 587 /* Initialize power management */
diff --git a/drivers/gpu/drm/radeon/rv770.c b/drivers/gpu/drm/radeon/rv770.c
index b0efd0ddae7a..f54628475456 100644
--- a/drivers/gpu/drm/radeon/rv770.c
+++ b/drivers/gpu/drm/radeon/rv770.c
@@ -975,7 +975,11 @@ int rv770_init(struct radeon_device *rdev)
975 if (r) 975 if (r)
976 return r; 976 return r;
977 /* Post card if necessary */ 977 /* Post card if necessary */
978 if (!r600_card_posted(rdev) && rdev->bios) { 978 if (!r600_card_posted(rdev)) {
979 if (!rdev->bios) {
980 dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n");
981 return -EINVAL;
982 }
979 DRM_INFO("GPU not posted. posting now...\n"); 983 DRM_INFO("GPU not posted. posting now...\n");
980 atom_asic_init(rdev->mode_info.atom_context); 984 atom_asic_init(rdev->mode_info.atom_context);
981 } 985 }