06bf710
From cb1ac4a749a208eb8f9995042a110134977146d2 Mon Sep 17 00:00:00 2001
a678cac
From: Dave Airlie <airlied@panoply-rh.(none)>
a678cac
Date: Thu, 13 Mar 2008 16:16:46 +1000
a678cac
Subject: [PATCH] fbdev: make entity fail if PCI claimed already.
a678cac
a678cac
bad kitty fbdev.
a678cac
---
a678cac
 hw/xfree86/common/xf86Bus.c   |    3 +++
06bf710
 hw/xfree86/common/xf86fbBus.c |    7 +++++++
06bf710
 2 files changed, 10 insertions(+), 0 deletions(-)
a678cac
a678cac
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
a678cac
index f7ffac8..9f4e0ca 100644
a678cac
--- a/hw/xfree86/common/xf86Bus.c
a678cac
+++ b/hw/xfree86/common/xf86Bus.c
a678cac
@@ -458,6 +458,9 @@ xf86GetEntityInfo(int entityIndex)
a678cac
     EntityInfoPtr pEnt;
a678cac
     int i;
a678cac
     
a678cac
+    if (entityIndex == -1)
a678cac
+	return NULL;
a678cac
+
a678cac
     if (entityIndex >= xf86NumEntities)
a678cac
 	return NULL;
a678cac
     
a678cac
diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
06bf710
index 102f6b1..cfd8811 100644
a678cac
--- a/hw/xfree86/common/xf86fbBus.c
a678cac
+++ b/hw/xfree86/common/xf86fbBus.c
06bf710
@@ -58,6 +58,13 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
a678cac
 {
a678cac
     EntityPtr p;
a678cac
     int num;
a678cac
+
a678cac
+    if (pciSlotClaimed)
a678cac
+	return -1;
06bf710
+#if defined(__sparc__) || defined (__sparc64__)
06bf710
+    if (sbusSlotClaimed)
06bf710
+	return -1;
06bf710
+#endif
a678cac
     
a678cac
     num = xf86AllocateEntity();
a678cac
     p = xf86Entities[num];
a678cac
-- 
06bf710
1.6.0.6
a678cac