summaryrefslogtreecommitdiff
authorDave Airlie <airlied@panoply-rh.(none)>2008-03-13 06:16:46 (GMT)
committer Dave Airlie <airlied@redhat.com>2009-06-19 03:28:21 (GMT)
commitaef6b904ebf0d7de6259058606c7c04ea177bda3 (patch) (side-by-side diff)
treeeef0e812a5620abe3855599503a4f901799b148a
parent3efb23a6c40dc3583d083d25ada3853ecc56000d (diff)
downloadxserver-aef6b904ebf0d7de6259058606c7c04ea177bda3.zip
xserver-aef6b904ebf0d7de6259058606c7c04ea177bda3.tar.gz
fbdev: make entity fail if PCI claimed already.
bad kitty fbdev, been shipping this in Fedora for a while now
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--hw/xfree86/common/xf86Bus.c3
-rw-r--r--hw/xfree86/common/xf86fbBus.c7
2 files changed, 10 insertions, 0 deletions
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 8382d91..0d732d0 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -428,6 +428,9 @@ xf86GetEntityInfo(int entityIndex)
EntityInfoPtr pEnt;
int i;
+ if (entityIndex == -1)
+ return NULL;
+
if (entityIndex >= xf86NumEntities)
return NULL;
diff --git a/hw/xfree86/common/xf86fbBus.c b/hw/xfree86/common/xf86fbBus.c
index a189639..90e6eb0 100644
--- a/hw/xfree86/common/xf86fbBus.c
+++ b/hw/xfree86/common/xf86fbBus.c
@@ -57,6 +57,13 @@ xf86ClaimFbSlot(DriverPtr drvp, int chipset, GDevPtr dev, Bool active)
{
EntityPtr p;
int num;
+
+ if (pciSlotClaimed)
+ return -1;
+#if defined(__sparc__) || defined (__sparc64__)
+ if (sbusSlotClaimed)
+ return -1;
+#endif
num = xf86AllocateEntity();
p = xf86Entities[num];