diff options
author | Michel Dänzer <michel@tungstengraphics.com> | 2007-10-04 11:32:48 +0200 |
---|---|---|
committer | Michel Dänzer <michel@tungstengraphics.com> | 2007-10-04 11:32:48 +0200 |
commit | 1110957ba703475847b8e72023c6edcbd1068aef (patch) | |
tree | d07cfa64a7d9899a1057dd15c8a2293c51245a94 /src | |
parent | 7addf41885ec5658f531624a9c24ea5bd7d22d19 (diff) |
radeon: Fix for pci-rework.
Surprisingly easy, thanks to George's pci-rework changes.
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 20 | ||||
-rw-r--r-- | src/atipcirename.h | 12 | ||||
-rw-r--r-- | src/radeon.h | 6 | ||||
-rw-r--r-- | src/radeon_accel.c | 2 | ||||
-rw-r--r-- | src/radeon_bios.c | 15 | ||||
-rw-r--r-- | src/radeon_dri.c | 22 | ||||
-rw-r--r-- | src/radeon_driver.c | 124 | ||||
-rw-r--r-- | src/radeon_video.c | 6 |
8 files changed, 148 insertions, 59 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 16cbb66..1eea432 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -66,16 +66,6 @@ atimisc_drv_la_SOURCES = \ atiload.c atimisc.c atimach64probe.c $(ATIMISC_CPIO_SOURCES) \ $(ATIMISC_DGA_SOURCES) $(ATIMISC_DRI_SRCS) $(ATIMISC_EXA_SOURCES) -if XSERVER_LIBPCIACCESS -# r128, radeon and theatre have not been ported yet -else -r128_drv_la_LTLIBRARIES = r128_drv.la -r128_drv_la_LDFLAGS = -module -avoid-version -r128_drv_ladir = @moduledir@/drivers -r128_drv_la_SOURCES = \ - r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \ - r128_video.c r128_misc.c r128_probe.c $(R128_DRI_SRCS) - radeon_drv_la_LTLIBRARIES = radeon_drv.la radeon_drv_la_LDFLAGS = -module -avoid-version radeon_drv_ladir = @moduledir@/drivers @@ -86,6 +76,16 @@ radeon_drv_la_SOURCES = \ radeon_crtc.c radeon_output.c radeon_modes.c radeon_tv.c \ $(RADEON_DRI_SRCS) $(RADEON_EXA_SOURCES) +if XSERVER_LIBPCIACCESS +# r128 and theatre have not been ported yet +else +r128_drv_la_LTLIBRARIES = r128_drv.la +r128_drv_la_LDFLAGS = -module -avoid-version +r128_drv_ladir = @moduledir@/drivers +r128_drv_la_SOURCES = \ + r128_accel.c r128_cursor.c r128_dga.c r128_driver.c \ + r128_video.c r128_misc.c r128_probe.c $(R128_DRI_SRCS) + theatre_detect_drv_la_LTLIBRARIES = theatre_detect_drv.la theatre_detect_drv_la_LDFLAGS = -module -avoid-version theatre_detect_drv_ladir = @moduledir@/multimedia diff --git a/src/atipcirename.h b/src/atipcirename.h index e30d10c..5aa6b80 100644 --- a/src/atipcirename.h +++ b/src/atipcirename.h @@ -41,6 +41,9 @@ enum region_type { #define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->chipType) #define PCI_DEV_REVISION(_pcidev) ((_pcidev)->chipRev) +#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subsysVendor) +#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subsysCard) + #define PCI_DEV_TAG(_pcidev) pciTag((_pcidev)->bus, \ (_pcidev)->device, \ (_pcidev)->func) @@ -65,6 +68,9 @@ enum region_type { (((_pcidev)->size[(_b)] > 0) ? (1 << (_pcidev)->size[(_b)]) : 0) /* read/write PCI configuration space */ +#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \ + *(_value_ptr) = pciReadByte(PCI_CFG_TAG(_pcidev), (_offset)) + #define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \ *(_value_ptr) = pciReadLong(PCI_CFG_TAG(_pcidev), (_offset)) @@ -79,6 +85,9 @@ typedef struct pci_device *pciVideoPtr; #define PCI_DEV_DEVICE_ID(_pcidev) ((_pcidev)->device_id) #define PCI_DEV_REVISION(_pcidev) ((_pcidev)->revision) +#define PCI_SUB_VENDOR_ID(_pcidev) ((_pcidev)->subvendor_id) +#define PCI_SUB_DEVICE_ID(_pcidev) ((_pcidev)->subdevice_id) + /* pci-rework functions take a 'pci_device' parameter instead of a tag */ #define PCI_DEV_TAG(_pcidev) (_pcidev) @@ -99,6 +108,9 @@ typedef struct pci_device *pciVideoPtr; #define PCI_REGION_BASE(_pcidev, _b, _type) ((_pcidev)->regions[(_b)].base_addr) #define PCI_REGION_SIZE(_pcidev, _b) ((_pcidev)->regions[(_b)].size) +#define PCI_READ_BYTE(_pcidev, _value_ptr, _offset) \ + pci_device_cfg_read_u8((_pcidev), (_value_ptr), (_offset)) + #define PCI_READ_LONG(_pcidev, _value_ptr, _offset) \ pci_device_cfg_read_u32((_pcidev), (_value_ptr), (_offset)) diff --git a/src/radeon.h b/src/radeon.h index 610e2b3..ad94cc5 100644 --- a/src/radeon.h +++ b/src/radeon.h @@ -88,6 +88,8 @@ #include "picturestr.h" #endif +#include "atipcirename.h" + #ifndef MAX #define MAX(a,b) ((a)>(b)?(a):(b)) #endif @@ -456,8 +458,8 @@ typedef struct { CARD32 mc_fb_location; CARD32 mc_agp_location; - unsigned char *MMIO; /* Map of MMIO region */ - unsigned char *FB; /* Map of frame buffer */ + void *MMIO; /* Map of MMIO region */ + void *FB; /* Map of frame buffer */ CARD8 *VBIOS; /* Video BIOS pointer */ Bool IsAtomBios; /* New BIOS used in R420 etc. */ diff --git a/src/radeon_accel.c b/src/radeon_accel.c index b739988..6028aff 100644 --- a/src/radeon_accel.c +++ b/src/radeon_accel.c @@ -621,7 +621,7 @@ RADEONHostDataParams(ScrnInfoPtr pScrn, CARD8 *dst, CARD32 pitch, int cpp, CARD32 *dstPitchOff, int *x, int *y) { RADEONInfoPtr info = RADEONPTR( pScrn ); - CARD32 dstOffs = dst - info->FB + info->fbLocation; + CARD32 dstOffs = dst - (CARD8*)info->FB + info->fbLocation; *dstPitchOff = pitch << 16 | (dstOffs & ~RADEON_BUFFER_ALIGN) >> 10; *y = ( dstOffs & RADEON_BUFFER_ALIGN ) / pitch; diff --git a/src/radeon_bios.c b/src/radeon_bios.c index cfa5d2b..d5b7f5e 100644 --- a/src/radeon_bios.c +++ b/src/radeon_bios.c @@ -48,7 +48,13 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) int tmp; unsigned short dptr; - if (!(info->VBIOS = xalloc(RADEON_VBIOS_SIZE))) { + if (!(info->VBIOS = xalloc( +#ifdef XSERVER_LIBPCIACCESS + info->PciInfo->rom_size +#else + RADEON_VBIOS_SIZE +#endif + ))) { xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Cannot allocate space for hold Video BIOS!\n"); return FALSE; @@ -58,6 +64,12 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) (void)memcpy(info->VBIOS, xf86int10Addr(pInt10, info->BIOSAddr), RADEON_VBIOS_SIZE); } else { +#ifdef XSERVER_LIBPCIACCESS + if (pci_device_read_rom(info->PciInfo, info->VBIOS)) { + xf86DrvMsg(pScrn->scrnIndex, X_WARNING, + "Failed to read PCI ROM!\n"); + } +#else xf86ReadPciBIOS(0, info->PciTag, 0, info->VBIOS, RADEON_VBIOS_SIZE); if (info->VBIOS[0] != 0x55 || info->VBIOS[1] != 0xaa) { xf86DrvMsg(pScrn->scrnIndex, X_WARNING, @@ -69,6 +81,7 @@ Bool RADEONGetBIOSInfo(ScrnInfoPtr pScrn, xf86Int10InfoPtr pInt10) xf86ReadDomainMemory(info->PciTag, info->BIOSAddr, RADEON_VBIOS_SIZE, info->VBIOS); } +#endif } } diff --git a/src/radeon_dri.c b/src/radeon_dri.c index 24018e8..2c533b1 100644 --- a/src/radeon_dri.c +++ b/src/radeon_dri.c @@ -795,8 +795,8 @@ static Bool RADEONSetAgpMode(RADEONInfoPtr info, ScreenPtr pScreen) xf86DrvMsg(pScreen->myNum, X_INFO, "[agp] Mode 0x%08lx [AGP 0x%04x/0x%04x; Card 0x%04x/0x%04x]\n", mode, vendor, device, - info->PciInfo->vendor, - info->PciInfo->chipType); + PCI_DEV_VENDOR_ID(info->PciInfo), + PCI_DEV_DEVICE_ID(info->PciInfo)); if (drmAgpEnable(info->drmFD, mode) < 0) { xf86DrvMsg(pScreen->myNum, X_ERROR, "[agp] AGP not enabled\n"); @@ -1183,9 +1183,9 @@ static void RADEONDRIIrqInit(RADEONInfoPtr info, ScreenPtr pScreen) if (!info->irq) { info->irq = drmGetInterruptFromBusID( info->drmFD, - ((pciConfigPtr)info->PciInfo->thisCard)->busnum, - ((pciConfigPtr)info->PciInfo->thisCard)->devnum, - ((pciConfigPtr)info->PciInfo->thisCard)->funcnum); + PCI_CFG_BUS(info->PciInfo), + PCI_CFG_DEV(info->PciInfo), + PCI_CFG_FUNC(info->PciInfo)); if ((drmCtlInstHandler(info->drmFD, info->irq)) != 0) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1291,9 +1291,9 @@ Bool RADEONDRIGetVersion(ScrnInfoPtr pScrn) busId = xalloc(64); sprintf(busId, "PCI:%d:%d:%d", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), + PCI_DEV_FUNC(info->PciInfo)); } /* Low level DRM open */ @@ -1431,9 +1431,9 @@ Bool RADEONDRIScreenInit(ScreenPtr pScreen) pDRIInfo->busIdString = xalloc(64); sprintf(pDRIInfo->busIdString, "PCI:%d:%d:%d", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), + PCI_DEV_FUNC(info->PciInfo)); } pDRIInfo->ddxDriverMajorVersion = info->allowColorTiling ? RADEON_VERSION_MAJOR_TILED : RADEON_VERSION_MAJOR; diff --git a/src/radeon_driver.c b/src/radeon_driver.c index d434116..6f8a753 100644 --- a/src/radeon_driver.c +++ b/src/radeon_driver.c @@ -525,6 +525,8 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); +#ifndef XSERVER_LIBPCIACCESS + info->MMIO = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT, info->PciTag, @@ -532,6 +534,25 @@ static Bool RADEONMapMMIO(ScrnInfoPtr pScrn) info->MMIOSize); if (!info->MMIO) return FALSE; + +#else + + void** result = (void**)&info->MMIO; + int err = pci_device_map_range(info->PciInfo, + info->MMIOAddr, + info->MMIOSize, + PCI_DEV_MAP_FLAG_WRITABLE, + result); + + if (err) { + xf86DrvMsg (pScrn->scrnIndex, X_ERROR, + "Unable to map MMIO aperture. %s (%d)\n", + strerror (err), err); + return FALSE; + } + +#endif + return TRUE; } @@ -542,7 +563,11 @@ static Bool RADEONUnmapMMIO(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, info->MMIO, info->MMIOSize); +#else + pci_device_unmap_range(info->PciInfo, info->MMIO, info->MMIOSize); +#endif info->MMIO = NULL; return TRUE; @@ -555,6 +580,9 @@ static Bool RADEONMapFB(ScrnInfoPtr pScrn) xf86DrvMsgVerb(pScrn->scrnIndex, X_INFO, RADEON_LOGLEVEL_DEBUG, "Map: 0x%08lx, 0x%08lx\n", info->LinearAddr, info->FbMapSize); + +#ifndef XSERVER_LIBPCIACCESS + info->FB = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER, info->PciTag, @@ -562,6 +590,25 @@ static Bool RADEONMapFB(ScrnInfoPtr pScrn) info->FbMapSize); if (!info->FB) return FALSE; + +#else + + int err = pci_device_map_range(info->PciInfo, + info->LinearAddr, + info->FbMapSize, + PCI_DEV_MAP_FLAG_WRITABLE | + PCI_DEV_MAP_FLAG_WRITE_COMBINE, + &info->FB); + + if (err) { + xf86DrvMsg (pScrn->scrnIndex, X_ERROR, + "Unable to map FB aperture. %s (%d)\n", + strerror (err), err); + return FALSE; + } + +#endif + return TRUE; } @@ -570,7 +617,12 @@ static Bool RADEONUnmapFB(ScrnInfoPtr pScrn) { RADEONInfoPtr info = RADEONPTR(pScrn); +#ifndef XSERVER_LIBPCIACCESS xf86UnMapVidMem(pScrn->scrnIndex, info->FB, info->FbMapSize); +#else + pci_device_unmap_range(info->PciInfo, info->FB, info->FbMapSize); +#endif + info->FB = NULL; return TRUE; } @@ -1271,6 +1323,7 @@ static CARD32 RADEONGetAccessibleVRAM(ScrnInfoPtr pScrn) RADEONInfoPtr info = RADEONPTR(pScrn); unsigned char *RADEONMMIO = info->MMIO; CARD32 aper_size = INREG(RADEON_CONFIG_APER_SIZE) / 1024; + unsigned char byte; #ifdef XF86DRI /* If we use the DRI, we need to check if it's a version that has the @@ -1311,7 +1364,8 @@ static CARD32 RADEONGetAccessibleVRAM(ScrnInfoPtr pScrn) * check if it's a multifunction card by reading the PCI config * header type... Limit those to one aperture size */ - if (pciReadByte(info->PciTag, 0xe) & 0x80) { + PCI_READ_BYTE(info->PciInfo, &byte, 0xe); + if (byte & 0x80) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Generation 1 PCI interface in multifunction mode" ", accessible memory limited to one aperture\n"); @@ -1359,7 +1413,7 @@ static Bool RADEONPreInitVRAM(ScrnInfoPtr pScrn) accessible = RADEONGetAccessibleVRAM(pScrn); /* Crop it to the size of the PCI BAR */ - bar_size = (1ul << info->PciInfo->size[0]) / 1024; + bar_size = PCI_REGION_SIZE(info->PciInfo, 0) / 1024; if (bar_size == 0) bar_size = 0x20000; if (accessible > bar_size) @@ -1419,6 +1473,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) MessageType from = X_PROBED; #ifdef XF86DRI const char *s; + uint32_t cmd_stat; #endif /* Chipset */ @@ -1430,7 +1485,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) info->Chipset = dev->chipID; from = X_CONFIG; } else { - info->Chipset = info->PciInfo->chipType; + info->Chipset = PCI_DEV_DEVICE_ID(info->PciInfo); } pScrn->chipset = (char *)xf86TokenToString(RADEONChipsets, info->Chipset); @@ -1470,17 +1525,17 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) info->ChipFamily = CHIP_FAMILY_RV100; /* DELL triple-head configuration. */ - if ((info->PciInfo->subsysVendor == PCI_VENDOR_DELL) && - ((info->PciInfo->subsysCard == 0x016c) || - (info->PciInfo->subsysCard == 0x016d) || - (info->PciInfo->subsysCard == 0x016e) || - (info->PciInfo->subsysCard == 0x016f) || - (info->PciInfo->subsysCard == 0x0170) || - (info->PciInfo->subsysCard == 0x017d) || - (info->PciInfo->subsysCard == 0x017e) || - (info->PciInfo->subsysCard == 0x0183) || - (info->PciInfo->subsysCard == 0x018a) || - (info->PciInfo->subsysCard == 0x019a))) { + if ((PCI_SUB_VENDOR_ID(info->PciInfo) == PCI_VENDOR_DELL) && + ((PCI_SUB_DEVICE_ID(info->PciInfo) == 0x016c) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x016d) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x016e) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x016f) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x0170) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x017d) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x017e) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x0183) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x018a) || + (PCI_SUB_DEVICE_ID(info->PciInfo) == 0x019a))) { info->IsDellServer = TRUE; xf86DrvMsg(pScrn->scrnIndex, X_INFO, "DELL server detected, force to special setup\n"); } @@ -1702,7 +1757,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) from = X_PROBED; - info->LinearAddr = info->PciInfo->memBase[0] & 0xfe000000; + info->LinearAddr = PCI_REGION_BASE(info->PciInfo, 0, REGION_MEM) & 0xfe000000; pScrn->memPhysBase = info->LinearAddr; if (dev->MemBase) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, @@ -1719,6 +1774,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, from, "Linear framebuffer at 0x%08lx\n", info->LinearAddr); +#ifndef XSERVER_LIBPCIACCESS /* BIOS */ from = X_PROBED; info->BIOSAddr = info->PciInfo->biosBase & 0xfffe0000; @@ -1734,6 +1790,7 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) xf86DrvMsg(pScrn->scrnIndex, from, "BIOS at 0x%08lx\n", info->BIOSAddr); } +#endif /* Read registers used to determine options */ /* Check chip errata */ @@ -1796,15 +1853,15 @@ static Bool RADEONPreInitChipType(ScrnInfoPtr pScrn) info->cardType = CARD_PCI; - if (pciReadLong(info->PciTag, PCI_CMD_STAT_REG) & RADEON_CAP_LIST) { - CARD32 cap_ptr, cap_id; - - cap_ptr = pciReadLong(info->PciTag, - RADEON_CAPABILITIES_PTR_PCI_CONFIG) - & RADEON_CAP_PTR_MASK; + PCI_READ_LONG(info->PciInfo, &cmd_stat, PCI_CMD_STAT_REG); + if (cmd_stat & RADEON_CAP_LIST) { + uint32_t cap_ptr, cap_id; + + PCI_READ_LONG(info->PciInfo, &cap_ptr, RADEON_CAPABILITIES_PTR_PCI_CONFIG); + cap_ptr &= RADEON_CAP_PTR_MASK; while(cap_ptr != RADEON_CAP_ID_NULL) { - cap_id = pciReadLong(info->PciTag, cap_ptr); + PCI_READ_LONG(info->PciInfo, &cap_id, cap_ptr); if ((cap_id & 0xff)== RADEON_CAP_ID_AGP) { info->cardType = CARD_AGP; break; @@ -1991,7 +2048,7 @@ static Bool RADEONPreInitInt10(ScrnInfoPtr pScrn, xf86Int10InfoPtr *ppInt10) /* The VGA BIOS on the RV100/QY cannot be read when the digital output * is enabled. Clear and restore FP2_ON around int10 to avoid this. */ - if (info->PciInfo->chipType == PCI_CHIP_RV100_QY) { + if (PCI_DEV_DEVICE_ID(info->PciInfo) == PCI_CHIP_RV100_QY) { fp2_gen_ctl_save = INREG(RADEON_FP2_GEN_CNTL); if (fp2_gen_ctl_save & RADEON_FP2_ON) { xf86DrvMsg(pScrn->scrnIndex, X_INFO, "disabling digital out\n"); @@ -2527,11 +2584,11 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) if (info->pEnt->location.type != BUS_PCI) goto fail; info->PciInfo = xf86GetPciInfoForEntity(info->pEnt->index); - info->PciTag = pciTag(info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); - info->MMIOAddr = info->PciInfo->memBase[2] & 0xffffff00; - info->MMIOSize = (1 << info->PciInfo->size[2]); + info->PciTag = pciTag(PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), + PCI_DEV_FUNC(info->PciInfo)); + info->MMIOAddr = PCI_REGION_BASE(info->PciInfo, 2, REGION_MEM) & 0xffffff00; + info->MMIOSize = PCI_REGION_SIZE(info->PciInfo, 2); if (info->pEnt->device->IOBase) { xf86DrvMsg(pScrn->scrnIndex, X_CONFIG, "MMIO address override, using 0x%08lx instead of 0x%08lx\n", @@ -2552,7 +2609,10 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) } #if !defined(__alpha__) - if (xf86GetPciDomain(info->PciTag) || + if ( +#ifndef XSERVER_LIBPCIACCESS + xf86GetPciDomain(info->PciTag) || +#endif !xf86IsPrimaryPci(info->PciInfo)) RADEONPreInt10Save(pScrn, &int10_save); #else @@ -2574,9 +2634,9 @@ _X_EXPORT Bool RADEONPreInit(ScrnInfoPtr pScrn, int flags) xf86DrvMsg(pScrn->scrnIndex, X_INFO, "PCI bus %d card %d func %d\n", - info->PciInfo->bus, - info->PciInfo->device, - info->PciInfo->func); + PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), + PCI_DEV_FUNC(info->PciInfo)); if (xf86RegisterResources(info->pEnt->index, 0, ResExclusive)) goto fail; diff --git a/src/radeon_video.c b/src/radeon_video.c index dca9695..26857a5 100644 --- a/src/radeon_video.c +++ b/src/radeon_video.c @@ -1213,9 +1213,11 @@ RADEONResetVideo(ScrnInfoPtr pScrn) xvAdjustment = MAKE_ATOM("XV_DEBUG_ADJUSTMENT"); - sprintf(tmp, "RXXX:%d.%d.%d", info->PciInfo->vendor, info->PciInfo->chipType, info->PciInfo->chipRev); + sprintf(tmp, "RXXX:%d.%d.%d", PCI_DEV_VENDOR_ID(info->PciInfo), + PCI_DEV_DEVICE_ID(info->PciInfo), PCI_DEV_REVISION(info->PciInfo)); pPriv->device_id = MAKE_ATOM(tmp); - sprintf(tmp, "PCI:%02d:%02d.%d", info->PciInfo->bus, info->PciInfo->device, info->PciInfo->func); + sprintf(tmp, "PCI:%02d:%02d.%d", PCI_DEV_BUS(info->PciInfo), + PCI_DEV_DEV(info->PciInfo), PCI_DEV_FUNC(info->PciInfo)); pPriv->location_id = MAKE_ATOM(tmp); sprintf(tmp, "INSTANCE:%d", pScrn->scrnIndex); pPriv->instance_id = MAKE_ATOM(tmp); |