rpms/xorg-x11-drv-amd/devel amd-pciaccess-fix.patch, NONE, 1.1 xorg-x11-drv-amd.spec, 1.18, 1.19

Dave Airlie (airlied) fedora-extras-commits at redhat.com
Mon Mar 10 09:06:58 UTC 2008


Author: airlied

Update of /cvs/pkgs/rpms/xorg-x11-drv-amd/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv26004

Modified Files:
	xorg-x11-drv-amd.spec 
Added Files:
	amd-pciaccess-fix.patch 
Log Message:
* Mon Mar 10 2008 Dave Airlie <airlied at redhat.com> 0.0-25.20080310
- resnapshot for pciaccess goodness


amd-pciaccess-fix.patch:

--- NEW FILE amd-pciaccess-fix.patch ---
diff --git a/src/amd_gx_driver.c b/src/amd_gx_driver.c
index 09ad47a..3c66d05 100644
--- a/src/amd_gx_driver.c
+++ b/src/amd_gx_driver.c
@@ -327,7 +327,7 @@ static inline void * map_pci_mem(ScrnInfoPtr pScrni, int vram,
   int map_size = size ? size : dev->regions[bar].size;
     
   int err = pci_device_map_range(dev,
-				 dev->regions[bar].base_addr
+				 dev->regions[bar].base_addr,
 				 map_size,
 				 PCI_DEV_MAP_FLAG_WRITABLE |
 				 (vram ? PCI_DEV_MAP_FLAG_WRITE_COMBINE : 0),
@@ -348,7 +348,7 @@ GXMapMem(ScrnInfoPtr pScrni)
   GeodeRec *pGeode = GEODEPTR(pScrni);
   int index = pScrni->scrnIndex;
 
-  pciVideoRec *pci = xf86GetPciInfoForEntity(pGeode->pEnt->index);
+  pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index);
 
 #ifndef XSERVER_LIBPCIACCESS
   gfx_virt_regptr = (unsigned char *)xf86MapVidMem(index, VIDMEM_MMIO,
diff --git a/src/amd_gx_randr.c b/src/amd_gx_randr.c
index a4fa743..96f3f5d 100644
--- a/src/amd_gx_randr.c
+++ b/src/amd_gx_randr.c
@@ -33,6 +33,7 @@
 #include "xf86.h"
 #include "xf86Priv.h"
 #include "xf86DDC.h"
+#include "xf86Module.h"
 #include "mipointer.h"
 #include "windowstr.h"
 #include <X11/extensions/randr.h>
@@ -40,7 +41,6 @@
 
 #include "amd.h"
 
-static int GXRandRIndex;
 static int GXRandRGeneration;
 
 typedef struct _GXRandRInfo
@@ -55,7 +55,20 @@ typedef struct _GXRandRInfo
     Rotation supported_rotations;      /* driver supported */
 } XF86RandRInfoRec, *XF86RandRInfoPtr;
 
-#define XF86RANDRINFO(p)    ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
+#define AMD_OLDPRIV (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
+
+#if AMD_OLDPRIV
+
+static int GXRandRIndex;
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[GXRandRIndex].ptr)
+#else
+
+static DevPrivateKey GXRandRKey;
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
+			  dixLookupPrivate(&(p)->devPrivates, GXRandRKey));
+
+
+#endif
 
 static int
 GXRandRModeRefresh(DisplayModePtr mode)
@@ -299,10 +312,15 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
     rrScrPrivPtr rp;
 
     if (GXRandRGeneration != serverGeneration) {
-	GXRandRIndex = AllocateScreenPrivateIndex();
 	GXRandRGeneration = serverGeneration;
     }
 
+#if AMD_OLDPRIV
+    GXRandRIndex = AllocateScreenPrivateIndex();
+#else
+    GXRandRKey = &GXRandRKey;
+#endif
+
     pRandr = xcalloc(sizeof(XF86RandRInfoRec), 1);
     if (pRandr == NULL)
 	return FALSE;
@@ -326,6 +344,10 @@ GXRandRInit(ScreenPtr pScreen, int rotation)
     pRandr->supported_rotations = rotation;
     pRandr->maxX = pRandr->maxY = 0;
 
+#if AMD_OLDPRIV
     pScreen->devPrivates[GXRandRIndex].ptr = pRandr;
+#else
+    dixSetPrivate(&pScreen->devPrivates, GXRandRKey, pRandr);
+#endif
     return TRUE;
 }
diff --git a/src/amd_lx_driver.c b/src/amd_lx_driver.c
index 09882de..6acd09f 100644
--- a/src/amd_lx_driver.c
+++ b/src/amd_lx_driver.c
@@ -401,7 +401,7 @@ static inline void * map_pci_mem(ScrnInfoPtr pScrni, int vram,
   int map_size = size ? size : dev->regions[bar].size;
     
   int err = pci_device_map_range(dev,
-				 dev->regions[bar].base_addr
+				 dev->regions[bar].base_addr,
 				 map_size,
 				 PCI_DEV_MAP_FLAG_WRITABLE |
 				 (vram ? PCI_DEV_MAP_FLAG_WRITE_COMBINE : 0),
@@ -419,12 +419,14 @@ LXMapMem(ScrnInfoPtr pScrni)
     GeodeRec *pGeode = GEODEPTR(pScrni);
     int index = pScrni->scrnIndex;
     unsigned long cmd_bfr_phys;
+
+    pciVideoPtr pci = xf86GetPciInfoForEntity(pGeode->pEnt->index);
+
+#ifndef XSERVER_LIBPCIACCESS
     PCITAG tag;
 
-    pciVideoRec *pci = xf86GetPciInfoForEntity(pGeode->pEnt->index);
     tag = pciTag(pci->bus, pci->device, pci->func);
 
-#ifndef XSERVER_LIBPCIACCESS
     cim_gp_ptr = (unsigned char *)xf86MapPciMem(index, VIDMEM_MMIO,
 						tag, pci->memBase[1], LX_GP_REG_SIZE);
 
diff --git a/src/amd_lx_randr.c b/src/amd_lx_randr.c
index e46ae20..155eefa 100644
--- a/src/amd_lx_randr.c
+++ b/src/amd_lx_randr.c
@@ -40,7 +40,6 @@
 
 #include "amd.h"
 
-static int LXRandRIndex;
 static int LXRandRGeneration;
 
 typedef struct _LXRandRInfo
@@ -55,8 +54,20 @@ typedef struct _LXRandRInfo
     Rotation supported_rotations;      /* driver supported */
 } XF86RandRInfoRec, *XF86RandRInfoPtr;
 
+#define AMD_OLDPRIV (GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 4)
+#if AMD_OLDPRIV
+
+static int LXRandRIndex;
 #define XF86RANDRINFO(p) ((XF86RandRInfoPtr) (p)->devPrivates[LXRandRIndex].ptr)
 
+#else
+
+static DevPrivateKey LXRandRKey;
+#define XF86RANDRINFO(p) ((XF86RandRInfoPtr) \
+			  dixLookupPrivate(&(p)->devPrivates, LXRandRKey));
+
+#endif
+
 static int
 LXRandRModeRefresh(DisplayModePtr mode)
 {
@@ -299,10 +310,15 @@ LXRandRInit(ScreenPtr pScreen, int rotation)
     rrScrPrivPtr rp;
 
     if (LXRandRGeneration != serverGeneration) {
-	LXRandRIndex = AllocateScreenPrivateIndex();
 	LXRandRGeneration = serverGeneration;
     }
 
+#if AMD_OLDPRIV
+    LXRandRIndex = AllocateScreenPrivateIndex();
+#else
+    LXRandRKey = &LXRandRKey;
+#endif
+
     pRandr = xcalloc(sizeof(XF86RandRInfoRec), 1);
     if (pRandr == NULL)
 	return FALSE;
@@ -326,6 +342,10 @@ LXRandRInit(ScreenPtr pScreen, int rotation)
     pRandr->supported_rotations = rotation;
     pRandr->maxX = pRandr->maxY = 0;
 
+#if AMD_OLDPRIV
     pScreen->devPrivates[LXRandRIndex].ptr = pRandr;
+#else
+    dixSetPrivate(&pScreen->devPrivates, LXRandRKey, pRandr);
+#endif
     return TRUE;
 }


Index: xorg-x11-drv-amd.spec
===================================================================
RCS file: /cvs/pkgs/rpms/xorg-x11-drv-amd/devel/xorg-x11-drv-amd.spec,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- xorg-x11-drv-amd.spec	10 Mar 2008 06:40:49 -0000	1.18
+++ xorg-x11-drv-amd.spec	10 Mar 2008 09:05:55 -0000	1.19
@@ -7,7 +7,7 @@
 Summary:   Xorg X11 AMD Geode video driver
 Name:      xorg-x11-drv-amd
 Version:   0.0
-Release:   25.%{gitdate}%{?dist}
+Release:   26.%{gitdate}%{?dist}
 URL:       http://git.infradead.org/?p=users/jcrouse/xf86-video-amd.git
 Source0:    xf86-video-amd-0.0-git%{gitdate}.tar.bz2
 #Source1:   amd.xinf
@@ -36,6 +36,7 @@
 %endif
 
 Patch0: lx-disable-compression.patch
+Patch1: amd-pciaccess-fix.patch
 
 %description 
 X.Org X11 AMD Geode video driver.
@@ -43,6 +44,7 @@
 %prep
 %setup -q -n %{tarball}-2.7.7.6
 %patch0 -p1 -b .jx
+%patch1 -p1 -b .pciaccess
 
 # remind myself to do snapshots properly
 if [ -e %{tarball}/.git ] ; then
@@ -77,6 +79,9 @@
 %{driverdir}/ztv_drv.so
 
 %changelog
+* Mon Mar 10 2008 Dave Airlie <airlied at redhat.com> 0.0-26.20080310
+- finally pciaccess build for AMD
+
 * Mon Mar 10 2008 Dave Airlie <airlied at redhat.com> 0.0-25.20080310
 - resnapshot for pciaccess goodness
 




More information about the fedora-extras-commits mailing list