diff options
author | Jerome Glisse <jglisse@redhat.com> | 2011-10-20 14:17:14 -0400 |
---|---|---|
committer | Jerome Glisse <jglisse@redhat.com> | 2011-10-20 15:09:10 -0400 |
commit | 856583dbca9319c77fed40daa9956e81a0068f9e (patch) | |
tree | 72a5c2cb886cd7e4b56e73a467ef9c2e33ce2e8b /src/radeon_probe.c | |
parent | f6f1b4f7789cfef763c063e671b76b60be8bdd8e (diff) |
radeon/kms: fallback to vesa if GPU is not supported by UMS
For GPU not supported by UMS, test in probe so that we properly
fallback to vesa.
Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_probe.c')
-rw-r--r-- | src/radeon_probe.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/radeon_probe.c b/src/radeon_probe.c index 78190272..26dec285 100644 --- a/src/radeon_probe.c +++ b/src/radeon_probe.c @@ -59,9 +59,31 @@ #include "radeon_pci_chipset_gen.h" +#include "radeon_chipinfo_gen.h" #ifdef XSERVER_LIBPCIACCESS #include "radeon_pci_device_match_gen.h" + +static Bool radeon_ums_supported(ScrnInfoPtr pScrn, struct pci_device *pci_dev) +{ + unsigned family = 0, i; + + for (i = 0; i < sizeof(RADEONCards) / sizeof(RADEONCardInfo); i++) { + if (pci_dev->device_id == RADEONCards[i].pci_device_id) { + family = RADEONCards[i].chip_family; + break; + } + } + + if (family >= CHIP_FAMILY_SUMO) { + xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0, + "GPU only supported with KMS, using vesa instead.\n"); + return FALSE; + } + return TRUE; +} +#else +#define radeon_ums_supported(x, y) TRUE #endif #ifndef XSERVER_LIBPCIACCESS @@ -131,8 +153,13 @@ radeon_get_scrninfo(int entity_num, void *pci_dev) return FALSE; if (pci_dev) { - if (radeon_kernel_mode_enabled(pScrn, pci_dev)) + if (radeon_kernel_mode_enabled(pScrn, pci_dev)) { kms = 1; + } else { + if (!radeon_ums_supported(pScrn, pci_dev)) { + return FALSE; + } + } } pScrn->driverVersion = RADEON_VERSION_CURRENT; |