summaryrefslogtreecommitdiff
path: root/driver/xf86-video-ati/src/radeon_probe.c
diff options
context:
space:
mode:
authorMatthieu Herrb <matthieu@cvs.openbsd.org>2012-02-06 22:53:17 +0000
committerMatthieu Herrb <matthieu@cvs.openbsd.org>2012-02-06 22:53:17 +0000
commiteb2ee4ddbc560aaa5b74172c2c72851785efb40a (patch)
treea01988fa211bdbff64da3bea425a7f69f725987b /driver/xf86-video-ati/src/radeon_probe.c
parent36f7476dfa8dae71728fafaf1b27e51683bb0e69 (diff)
Revert the update to xf86-video-ati 6.14.3. Requested by espie@
who experiemnts regressions with this driver.
Diffstat (limited to 'driver/xf86-video-ati/src/radeon_probe.c')
-rw-r--r--driver/xf86-video-ati/src/radeon_probe.c124
1 files changed, 21 insertions, 103 deletions
diff --git a/driver/xf86-video-ati/src/radeon_probe.c b/driver/xf86-video-ati/src/radeon_probe.c
index 26dec285e..25d3bcfd4 100644
--- a/driver/xf86-video-ati/src/radeon_probe.c
+++ b/driver/xf86-video-ati/src/radeon_probe.c
@@ -31,13 +31,11 @@
#endif
#include <string.h>
-#include <stdlib.h>
/*
* Authors:
* Kevin E. Martin <martin@xfree86.org>
* Rickard E. Faith <faith@valinux.com>
- * KMS support - Dave Airlie <airlied@redhat.com>
*/
#include "radeon_probe.h"
@@ -46,44 +44,16 @@
#include "atipcirename.h"
#include "xf86.h"
-#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 6
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 7
#include "xf86Resources.h"
#endif
-#ifdef XF86DRM_MODE
-#include "xf86drmMode.h"
-#include "dri.h"
-#endif
-
#include "radeon_chipset_gen.h"
#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
@@ -108,42 +78,11 @@ RADEONIdentify(int flags)
RADEONChipsets);
}
-
-#ifdef XF86DRM_MODE
-static Bool radeon_kernel_mode_enabled(ScrnInfoPtr pScrn, struct pci_device *pci_dev)
-{
- char *busIdString;
- int ret;
-
- if (!xf86LoaderCheckSymbol("DRICreatePCIBusID")) {
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
- "[KMS] No DRICreatePCIBusID symbol, no kernel modesetting.\n");
- return FALSE;
- }
-
- busIdString = DRICreatePCIBusID(pci_dev);
- ret = drmCheckModesettingSupported(busIdString);
- free(busIdString);
- if (ret) {
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
- "[KMS] drm report modesetting isn't supported.\n");
- return FALSE;
- }
-
- xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, 0,
- "[KMS] Kernel modesetting enabled.\n");
- return TRUE;
-}
-#else
-#define radeon_kernel_mode_enabled(x, y) FALSE
-#endif
-
static Bool
-radeon_get_scrninfo(int entity_num, void *pci_dev)
+radeon_get_scrninfo(int entity_num)
{
ScrnInfoPtr pScrn = NULL;
EntityInfoPtr pEnt;
- int kms = 0;
pScrn = xf86ConfigPciEntity(pScrn, 0, entity_num, RADEONPciChipsets,
NULL,
@@ -152,16 +91,6 @@ radeon_get_scrninfo(int entity_num, void *pci_dev)
if (!pScrn)
return FALSE;
- if (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;
pScrn->driverName = RADEON_DRIVER_NAME;
pScrn->name = RADEON_NAME;
@@ -170,29 +99,14 @@ radeon_get_scrninfo(int entity_num, void *pci_dev)
#else
pScrn->Probe = RADEONProbe;
#endif
-
-#ifdef XF86DRM_MODE
- if (kms == 1) {
- pScrn->PreInit = RADEONPreInit_KMS;
- pScrn->ScreenInit = RADEONScreenInit_KMS;
- pScrn->SwitchMode = RADEONSwitchMode_KMS;
- pScrn->AdjustFrame = RADEONAdjustFrame_KMS;
- pScrn->EnterVT = RADEONEnterVT_KMS;
- pScrn->LeaveVT = RADEONLeaveVT_KMS;
- pScrn->FreeScreen = RADEONFreeScreen_KMS;
- pScrn->ValidMode = RADEONValidMode;
- } else
-#endif
- {
- pScrn->PreInit = RADEONPreInit;
- pScrn->ScreenInit = RADEONScreenInit;
- pScrn->SwitchMode = RADEONSwitchMode;
- pScrn->AdjustFrame = RADEONAdjustFrame;
- pScrn->EnterVT = RADEONEnterVT;
- pScrn->LeaveVT = RADEONLeaveVT;
- pScrn->FreeScreen = RADEONFreeScreen;
- pScrn->ValidMode = RADEONValidMode;
- }
+ pScrn->PreInit = RADEONPreInit;
+ pScrn->ScreenInit = RADEONScreenInit;
+ pScrn->SwitchMode = RADEONSwitchMode;
+ pScrn->AdjustFrame = RADEONAdjustFrame;
+ pScrn->EnterVT = RADEONEnterVT;
+ pScrn->LeaveVT = RADEONLeaveVT;
+ pScrn->FreeScreen = RADEONFreeScreen;
+ pScrn->ValidMode = RADEONValidMode;
pEnt = xf86GetEntityInfo(entity_num);
@@ -211,9 +125,13 @@ radeon_get_scrninfo(int entity_num, void *pci_dev)
pPriv = xf86GetEntityPrivate(pEnt->index,
gRADEONEntityIndex);
- xf86SetEntityInstanceForScreen(pScrn, pEnt->index, xf86GetNumEntityInstances(pEnt->index) - 1);
-
if (!pPriv->ptr) {
+ int j;
+ int instance = xf86GetNumEntityInstances(pEnt->index);
+
+ for (j = 0; j < instance; j++)
+ xf86SetEntityInstanceForScreen(pScrn, pEnt->index, j);
+
pPriv->ptr = xnfcalloc(sizeof(RADEONEntRec), 1);
pRADEONEnt = pPriv->ptr;
pRADEONEnt->HasSecondary = FALSE;
@@ -223,7 +141,7 @@ radeon_get_scrninfo(int entity_num, void *pci_dev)
}
}
- free(pEnt);
+ xfree(pEnt);
return TRUE;
}
@@ -262,13 +180,13 @@ RADEONProbe(DriverPtr drv, int flags)
foundScreen = TRUE;
} else {
for (i = 0; i < numUsed; i++) {
- if (radeon_get_scrninfo(usedChips[i], NULL))
+ if (radeon_get_scrninfo(usedChips[i]))
foundScreen = TRUE;
}
}
- free(usedChips);
- free(devSections);
+ xfree(usedChips);
+ xfree(devSections);
return foundScreen;
}
@@ -283,7 +201,7 @@ radeon_pci_probe(
intptr_t match_data
)
{
- return radeon_get_scrninfo(entity_num, (void *)device);
+ return radeon_get_scrninfo(entity_num);
}
#endif /* XSERVER_LIBPCIACCESS */