aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/radeon_device.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/drm/radeon/radeon_device.c')
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index e721e6b2766e..21c44b2293bc 100644
--- a/drivers/gpu/drm/radeon/radeon_device.c
+++ b/drivers/gpu/drm/radeon/radeon_device.c
@@ -630,6 +630,23 @@ void radeon_gtt_location(struct radeon_device *rdev, struct radeon_mc *mc)
630/* 630/*
631 * GPU helpers function. 631 * GPU helpers function.
632 */ 632 */
633
634/**
635 * radeon_device_is_virtual - check if we are running is a virtual environment
636 *
637 * Check if the asic has been passed through to a VM (all asics).
638 * Used at driver startup.
639 * Returns true if virtual or false if not.
640 */
641static bool radeon_device_is_virtual(void)
642{
643#ifdef CONFIG_X86
644 return boot_cpu_has(X86_FEATURE_HYPERVISOR);
645#else
646 return false;
647#endif
648}
649
633/** 650/**
634 * radeon_card_posted - check if the hw has already been initialized 651 * radeon_card_posted - check if the hw has already been initialized
635 * 652 *
@@ -643,6 +660,10 @@ bool radeon_card_posted(struct radeon_device *rdev)
643{ 660{
644 uint32_t reg; 661 uint32_t reg;
645 662
663 /* for pass through, always force asic_init */
664 if (radeon_device_is_virtual())
665 return false;
666
646 /* required for EFI mode on macbook2,1 which uses an r5xx asic */ 667 /* required for EFI mode on macbook2,1 which uses an r5xx asic */
647 if (efi_enabled(EFI_BOOT) && 668 if (efi_enabled(EFI_BOOT) &&
648 (rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) && 669 (rdev->pdev->subsystem_vendor == PCI_VENDOR_ID_APPLE) &&
@@ -1631,7 +1652,7 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend,
1631 radeon_agp_suspend(rdev); 1652 radeon_agp_suspend(rdev);
1632 1653
1633 pci_save_state(dev->pdev); 1654 pci_save_state(dev->pdev);
1634 if (freeze && rdev->family >= CHIP_R600) { 1655 if (freeze && rdev->family >= CHIP_CEDAR) {
1635 rdev->asic->asic_reset(rdev, true); 1656 rdev->asic->asic_reset(rdev, true);
1636 pci_restore_state(dev->pdev); 1657 pci_restore_state(dev->pdev);
1637 } else if (suspend) { 1658 } else if (suspend) {