drm/radeon/kms: ignore unposted GPUs with no BIOS.
authorDave Airlie <airlied@redhat.com>
Tue, 1 Dec 2009 04:06:31 +0000 (14:06 +1000)
committerDave Airlie <airlied@redhat.com>
Wed, 2 Dec 2009 01:37:17 +0000 (11:37 +1000)
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>
12 files changed:
drivers/gpu/drm/radeon/r100.c
drivers/gpu/drm/radeon/r300.c
drivers/gpu/drm/radeon/r420.c
drivers/gpu/drm/radeon/r520.c
drivers/gpu/drm/radeon/r600.c
drivers/gpu/drm/radeon/radeon.h
drivers/gpu/drm/radeon/radeon_device.c
drivers/gpu/drm/radeon/rs400.c
drivers/gpu/drm/radeon/rs600.c
drivers/gpu/drm/radeon/rs690.c
drivers/gpu/drm/radeon/rv515.c
drivers/gpu/drm/radeon/rv770.c

index 772bcd8637418acf1c8cfe530ed971fa58f11ebf..0862fa4b746d04fd07212b3914d02030ff1f1fbc 100644 (file)
@@ -3257,10 +3257,8 @@ int r100_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
-       if (!radeon_card_posted(rdev) && rdev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               radeon_combios_asic_init(rdev->ddev);
-       }
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
        /* Set asic errata */
        r100_errata(rdev);
        /* Initialize clocks */
index 9a5798544b42b43e7c0f562c54067ce759bf6f68..430fc2a984b2c4c8383b1a6470f96326324a482f 100644 (file)
@@ -1309,10 +1309,8 @@ int r300_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
-       if (!radeon_card_posted(rdev) && rdev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               radeon_combios_asic_init(rdev->ddev);
-       }
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
        /* Set asic errata */
        r300_errata(rdev);
        /* Initialize clocks */
index e7e4f5a90ebed9d2b4cdd0ac3a17b4dbb809771f..e7c34776a013eac161af6a2ee889e1b1cebce1ca 100644 (file)
@@ -301,14 +301,9 @@ int r420_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
-       if (!radeon_card_posted(rdev) && rdev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               if (rdev->is_atom_bios) {
-                       atom_asic_init(rdev->mode_info.atom_context);
-               } else {
-                       radeon_combios_asic_init(rdev->ddev);
-               }
-       }
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
+
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Initialize power management */
index f7435185c0a6fcd165c076608bbae74d913d7920..26c37792c8fef94bf072570cafaf6573413dcb0b 100644 (file)
@@ -254,6 +254,9 @@ int r520_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
+
        if (!radeon_card_posted(rdev) && rdev->bios) {
                DRM_INFO("GPU not posted. posting now...\n");
                atom_asic_init(rdev->mode_info.atom_context);
index 797a36f9a0f4f7713083e9ca767c0f9bdaaf9704..3dbd93e44345a7bf8f7d88d5fec0140cac681ced 100644 (file)
@@ -1631,7 +1631,11 @@ int r600_init(struct radeon_device *rdev)
        if (r)
                return r;
        /* Post card if necessary */
-       if (!r600_card_posted(rdev) && rdev->bios) {
+       if (!r600_card_posted(rdev)) {
+               if (!rdev->bios) {
+                       dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n");
+                       return -EINVAL;
+               }
                DRM_INFO("GPU not posted. posting now...\n");
                atom_asic_init(rdev->mode_info.atom_context);
        }
index c32fe1cec8186599f44322d8e484fb30575e28e7..15b9e03bb58949884f35f5255c50047eef444859 100644 (file)
@@ -979,6 +979,7 @@ extern int radeon_gart_table_vram_pin(struct radeon_device *rdev);
 extern int radeon_modeset_init(struct radeon_device *rdev);
 extern void radeon_modeset_fini(struct radeon_device *rdev);
 extern bool radeon_card_posted(struct radeon_device *rdev);
+extern bool radeon_boot_test_post_card(struct radeon_device *rdev);
 extern int radeon_clocks_init(struct radeon_device *rdev);
 extern void radeon_clocks_fini(struct radeon_device *rdev);
 extern void radeon_scratch_init(struct radeon_device *rdev);
index db0835d9a537fd3dcdca7b4aa28a428150bac489..c43a690aedc664cf174726766d6bbc3383bf37a0 100644 (file)
@@ -208,6 +208,24 @@ bool radeon_card_posted(struct radeon_device *rdev)
 
 }
 
+bool radeon_boot_test_post_card(struct radeon_device *rdev)
+{
+       if (radeon_card_posted(rdev))
+               return true;
+
+       if (rdev->bios) {
+               DRM_INFO("GPU not posted. posting now...\n");
+               if (rdev->is_atom_bios)
+                       atom_asic_init(rdev->mode_info.atom_context);
+               else
+                       radeon_combios_asic_init(rdev->ddev);
+               return true;
+       } else {
+               dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n");
+               return false;
+       }
+}
+
 int radeon_dummy_page_init(struct radeon_device *rdev)
 {
        rdev->dummy_page.page = alloc_page(GFP_DMA32 | GFP_KERNEL | __GFP_ZERO);
index f1de558aeb391e57d708712731bce10d21a17344..2e5b9450a804d79a2bbfe2a5618aec872fe54481 100644 (file)
@@ -491,10 +491,9 @@ int rs400_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
-       if (!radeon_card_posted(rdev) && rdev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               radeon_combios_asic_init(rdev->ddev);
-       }
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
+
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Get vram informations */
index 5f117cd8736a6e6b4a0f9606fcc1e02612c43286..d2dac45173c2fabc30bd36133ad00967f7879b7b 100644 (file)
@@ -482,10 +482,9 @@ int rs600_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
-       if (!radeon_card_posted(rdev) && rdev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               atom_asic_init(rdev->mode_info.atom_context);
-       }
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
+
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Initialize power management */
index 27547175cf93cbcf79df7f5ab499c87f0b6da208..7ffd6db1223f51d760d7fddb1481c10c87da3797 100644 (file)
@@ -700,10 +700,9 @@ int rs690_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
-       if (!radeon_card_posted(rdev) && rdev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               atom_asic_init(rdev->mode_info.atom_context);
-       }
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
+
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Initialize power management */
index ba68c9fe90a1b7db910e8f6d551a192e42ef264e..93de4a9807ab34a65a2b0abefb7d953fd2f5ed88 100644 (file)
@@ -580,10 +580,8 @@ int rv515_init(struct radeon_device *rdev)
                        RREG32(R_0007C0_CP_STAT));
        }
        /* check if cards are posted or not */
-       if (!radeon_card_posted(rdev) && rdev->bios) {
-               DRM_INFO("GPU not posted. posting now...\n");
-               atom_asic_init(rdev->mode_info.atom_context);
-       }
+       if (radeon_boot_test_post_card(rdev) == false)
+               return -EINVAL;
        /* Initialize clocks */
        radeon_get_clock_info(rdev->ddev);
        /* Initialize power management */
index b0efd0ddae7a223d9ac2c7b323e9080a8f098b57..f5462847545615f45a4b68b47c6a531d9a29ffe9 100644 (file)
@@ -975,7 +975,11 @@ int rv770_init(struct radeon_device *rdev)
        if (r)
                return r;
        /* Post card if necessary */
-       if (!r600_card_posted(rdev) && rdev->bios) {
+       if (!r600_card_posted(rdev)) {
+               if (!rdev->bios) {
+                       dev_err(rdev->dev, "Card not posted and no BIOS - ignoring\n");
+                       return -EINVAL;
+               }
                DRM_INFO("GPU not posted. posting now...\n");
                atom_asic_init(rdev->mode_info.atom_context);
        }