File U_03-Pass-the-pci-device-if-any-through-to-fbdevhw-in-probe-and-preinit.patch of Package xf86-video-fbdev

From: Adam Jackson <ajax@redhat.com>
Date: Mon Aug 11 12:07:54 2014 -0400
Subject: [PATCH 3/13]Pass the pci device (if any) through to fbdevhw in probe and preinit
Patch-mainline: Upstream
Git-repo: git://anongit.freedesktop.org/xorg/driver/xf86-video-fbdev
Git-commit: ae0aeffae6657464f610da13e7b3349d0d97e81b
References: 
Signed-off-by: Max Staudt <mstaudt@suse.de>

Signed-off-by: Adam Jackson <ajax@redhat.com>
---
 src/fbdev.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/fbdev.c b/src/fbdev.c
index 5e38da4..dcfed28 100644
--- a/src/fbdev.c
+++ b/src/fbdev.c
@@ -280,7 +280,7 @@ static Bool FBDevPciProbe(DriverPtr drv, int entity_num,
 						  pScrn->entityInstanceList[0]);
 
 	device = xf86FindOptionValue(devSection->options, "fbdev");
-	if (fbdevHWProbe(NULL, device, NULL)) {
+	if (fbdevHWProbe(dev, device, NULL)) {
 	    pScrn->driverVersion = FBDEV_VERSION;
 	    pScrn->driverName    = FBDEV_DRIVER_NAME;
 	    pScrn->name          = FBDEV_NAME;
@@ -427,6 +427,7 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
 	int default_depth, fbbpp;
 	const char *s;
 	int type;
+	void *pci_dev;
 
 	if (flags & PROBE_DETECT) return FALSE;
 
@@ -454,9 +455,14 @@ FBDevPreInit(ScrnInfoPtr pScrn, int flags)
 		   "xf86RegisterResources() found resource conflicts\n");
 		return FALSE;
 	}
+#else
+	if (fPtr->pEnt->location.type == BUS_PCI)
+	    pci_dev = fPtr->pEnt->location.id.pci;
 #endif
 	/* open device */
-	if (!fbdevHWInit(pScrn,NULL,xf86FindOptionValue(fPtr->pEnt->device->options,"fbdev")))
+	if (!fbdevHWInit(pScrn, pci_dev,
+			 xf86FindOptionValue(fPtr->pEnt->device->options,
+					     "fbdev")))
 		return FALSE;
 	default_depth = fbdevHWGetDepth(pScrn,&fbbpp);
openSUSE Build Service is sponsored by