From 04ab07ca19236d6c9a947e065fb69b0dd0d16639 Mon Sep 17 00:00:00 2001 From: Connor Behan Date: Thu, 17 Oct 2013 18:26:28 -0700 Subject: [PATCH] xfree86: Find primary entity when bus types are nominally different As of server 1.13, systems with DRM and Udev will have BUS_PLATFORM as their primary bus type. However, drivers not implementing a platformProbe function will still create entities of type BUS_PCI. We need to account for this when checking for the primary entity. Signed-off-by: Connor Behan Acked-by: Tormod Volden Reviewed-by: Adam Jackson Signed-off-by: Keith Packard --- hw/xfree86/common/xf86Bus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c index e1015379b..329d0b3d5 100644 --- a/hw/xfree86/common/xf86Bus.c +++ b/hw/xfree86/common/xf86Bus.c @@ -266,7 +266,9 @@ xf86IsEntityPrimary(int entityIndex) { EntityPtr pEnt = xf86Entities[entityIndex]; - if (primaryBus.type != pEnt->bus.type) + if (primaryBus.type == BUS_PLATFORM && pEnt->bus.type == BUS_PCI) + return MATCH_PCI_DEVICES(pEnt->bus.id.pci, primaryBus.id.plat->pdev); + else if (primaryBus.type != pEnt->bus.type) return FALSE; switch (pEnt->bus.type) {