xf86-video-nv: 2 commits - src/nv_hw.c src/nv_setup.c
Alan Coopersmith
alanc at kemper.freedesktop.org
Tue Aug 19 09:59:37 PDT 2008
src/nv_hw.c | 12 ++++++++++--
src/nv_setup.c | 13 ++++++++++---
2 files changed, 20 insertions(+), 5 deletions(-)
New commits:
commit f485c553c23c67fd060fdea82f57128fd4a1749e
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date: Fri May 9 15:23:49 2008 -0700
Print error message when pci_device_map_range fails
diff --git a/src/nv_setup.c b/src/nv_setup.c
index b057da1..bea0050 100644
--- a/src/nv_setup.c
+++ b/src/nv_setup.c
@@ -341,7 +341,10 @@ NVCommonSetup(ScrnInfoPtr pScrn)
int FlatPanel = -1; /* really means the CRTC is slaved */
Bool Television = FALSE;
void *tmp;
-
+#if XSERVER_LIBPCIACCESS
+ int err;
+#endif
+
/*
* Override VGA I/O routines.
*/
@@ -371,8 +374,12 @@ NVCommonSetup(ScrnInfoPtr pScrn)
pVga->MMIOOffset = 0;
#if XSERVER_LIBPCIACCESS
- pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000,
- PCI_DEV_MAP_FLAG_WRITABLE, &tmp);
+ err = pci_device_map_range(pNv->PciInfo, pNv->IOAddress, 0x01000000,
+ PCI_DEV_MAP_FLAG_WRITABLE, &tmp);
+ if (err != 0) {
+ xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
+ "pci_device_map_range failed: %s\n", strerror(err));
+ }
#else
tmp = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO | VIDMEM_READSIDEEFFECT,
pNv->PciTag, pNv->IOAddress, 0x01000000);
commit 319ee20c9bd4f764297cf252723a23bb6a95051a
Author: Alan Coopersmith <alan.coopersmith at sun.com>
Date: Fri May 9 15:23:14 2008 -0700
Fix pciaccess READ_LONG to work with Sun compilers
Sun compilers don't allow nesting {} inside () apparently
diff --git a/src/nv_hw.c b/src/nv_hw.c
index ecac28f..83eeab2 100644
--- a/src/nv_hw.c
+++ b/src/nv_hw.c
@@ -653,6 +653,15 @@ static void nv30UpdateArbitrationSettings (
*lwm = graphics_lwm >> 3;
}
+#if XSERVER_LIBPCIACCESS
+static inline uint32_t
+pciaccessReadLong(struct pci_device *const dev, pciaddr_t offset) {
+ uint32_t tmp;
+ pci_device_cfg_read_u32(dev, &tmp, offset);
+ return tmp;
+}
+#endif
+
static void nForceUpdateArbitrationSettings (
unsigned VClk,
unsigned pixelDepth,
@@ -666,8 +675,7 @@ static void nForceUpdateArbitrationSettings (
struct pci_device *const dev2 = pci_device_find_by_slot(0, 0, 0, 2);
struct pci_device *const dev3 = pci_device_find_by_slot(0, 0, 0, 3);
struct pci_device *const dev5 = pci_device_find_by_slot(0, 0, 0, 5);
- uint32_t tmp;
- #define READ_LONG(num, offset) ({ pci_device_cfg_read_u32(dev##num, &tmp, (offset)); tmp; })
+# define READ_LONG(num, offset) pciaccessReadLong(dev##num, (offset))
#else
#define READ_LONG(num, offset) pciReadLong(pciTag(0, 0, num), (offset))
#endif
More information about the xorg-commit
mailing list