[PATCH 2/2] modesetting: setup entity for pci probed devices.
Dave Airlie
airlied at gmail.com
Sun Nov 15 15:05:27 PST 2015
Pretty much just ported what radeon does here.
Reported-by: Mark Kettenis <mark.kettenis at xs4all.nl>
Signed-off-by: Dave Airlie <airlied at redhat.com>
---
hw/xfree86/drivers/modesetting/driver.c | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 00f966c..2ca65fb 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -346,6 +346,9 @@ ms_pci_probe(DriverPtr driver,
devpath = xf86FindOptionValue(devSection->options, "kmsdev");
if (probe_hw_pci(devpath, dev)) {
+ DevUnion *pPriv;
+ EntityInfoPtr pEnt;
+
ms_setup_scrn_hooks(scrn);
xf86DrvMsg(scrn->scrnIndex, X_CONFIG,
@@ -353,6 +356,25 @@ ms_pci_probe(DriverPtr driver,
dev->bus, dev->domain, dev->dev, dev->func);
xf86DrvMsg(scrn->scrnIndex, X_INFO,
"using %s\n", devpath ? devpath : "default device");
+ pEnt = xf86GetEntityInfo(entity_num);
+
+ {
+ xf86SetEntitySharable(entity_num);
+
+ if (ms_entity_index == -1)
+ ms_entity_index = xf86AllocateEntityPrivateIndex();
+
+ pPriv = xf86GetEntityPrivate(pEnt->index,
+ ms_entity_index);
+
+ xf86SetEntityInstanceForScreen(scrn, pEnt->index, xf86GetNumEntityInstances(pEnt->index) - 1);
+
+ if (!pPriv->ptr)
+ pPriv->ptr = xnfcalloc(sizeof(modesettingEntRec), 1);
+ }
+
+ free(pEnt);
+
}
else
scrn = NULL;
--
2.4.3
More information about the xorg-devel
mailing list