aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/gpu/drm/radeon/radeon_device.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c
index e61c7636864d..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) &&