From fbc4da6fef2a0d2111284a19c26d83686ebcbd1f Mon Sep 17 00:00:00 2001 From: Adam Jackson Date: Fri, 16 Jun 2017 15:44:44 -0400 Subject: xfree86: Move DRICreatePCIBusID to the PCI code This symbol is used by some DRI2+ drivers and there's nothing DRI1-specific about it. Signed-off-by: Adam Jackson Acked-by: Keith Packard --- hw/xfree86/common/xf86pciBus.c | 12 ++++++++++++ hw/xfree86/common/xf86str.h | 2 ++ hw/xfree86/dri/dri.c | 12 ------------ hw/xfree86/dri/dri.h | 2 -- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/xfree86/common/xf86pciBus.c b/hw/xfree86/common/xf86pciBus.c index 9d3447cdf..cf4c27aea 100644 --- a/hw/xfree86/common/xf86pciBus.c +++ b/hw/xfree86/common/xf86pciBus.c @@ -1465,3 +1465,15 @@ xf86PciConfigureNewDev(void *busData, struct pci_device *pVideo, if (*chipset < 0) *chipset = (pVideo->vendor_id << 16) | pVideo->device_id; } + +char * +DRICreatePCIBusID(const struct pci_device *dev) +{ + char *busID; + + if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", + dev->domain, dev->bus, dev->dev, dev->func) == -1) + return NULL; + + return busID; +} diff --git a/hw/xfree86/common/xf86str.h b/hw/xfree86/common/xf86str.h index edd91c745..79c4c9daf 100644 --- a/hw/xfree86/common/xf86str.h +++ b/hw/xfree86/common/xf86str.h @@ -771,4 +771,6 @@ typedef enum { ACTION_SWITCHSCREEN_PREV, } ActionEvent; +extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *dev); + #endif /* _XF86STR_H */ diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c index 0142b6ea7..9f7075996 100644 --- a/hw/xfree86/dri/dri.c +++ b/hw/xfree86/dri/dri.c @@ -2404,15 +2404,3 @@ DRIMoveBuffersHelper(ScreenPtr pScreen, *xdir = 1; } - -char * -DRICreatePCIBusID(const struct pci_device *dev) -{ - char *busID; - - if (asprintf(&busID, "pci:%04x:%02x:%02x.%d", - dev->domain, dev->bus, dev->dev, dev->func) == -1) - return NULL; - - return busID; -} diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h index dfd2f827e..2ec1c76ea 100644 --- a/hw/xfree86/dri/dri.h +++ b/hw/xfree86/dri/dri.h @@ -325,8 +325,6 @@ extern _X_EXPORT void DRIMoveBuffersHelper(ScreenPtr pScreen, int dy, int *xdir, int *ydir, RegionPtr reg); -extern _X_EXPORT char *DRICreatePCIBusID(const struct pci_device *PciInfo); - extern _X_EXPORT int DRIMasterFD(ScrnInfoPtr pScrn); extern _X_EXPORT void *DRIMasterSareaPointer(ScrnInfoPtr pScrn); -- cgit v1.2.3