diff options
author | Adam Jackson <ajax@redhat.com> | 2017-06-16 15:44:44 -0400 |
---|---|---|
committer | Adam Jackson <ajax@redhat.com> | 2017-06-20 16:37:24 -0400 |
commit | fbc4da6fef2a0d2111284a19c26d83686ebcbd1f (patch) | |
tree | 368d8720b7c3cd021741a6fa34e2045e01647f5c /hw | |
parent | b723da8390d2fe1bf048247302416b37972a0cc3 (diff) |
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 <ajax@redhat.com>
Acked-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/xfree86/common/xf86pciBus.c | 12 | ||||
-rw-r--r-- | hw/xfree86/common/xf86str.h | 2 | ||||
-rw-r--r-- | hw/xfree86/dri/dri.c | 12 | ||||
-rw-r--r-- | 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); |