[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

xserver-xorg-video-tseng: Changes to 'upstream-experimental'



 .cvsignore            |   20 --------
 .gitignore            |   21 ++++++++
 configure.ac          |   16 ++++++
 man/Makefile.am       |    1 
 src/Makefile.am       |    3 -
 src/tseng.h           |   12 +++-
 src/tseng_accel.c     |    1 
 src/tseng_cursor.c    |    1 
 src/tseng_dga.c       |    1 
 src/tseng_driver.c    |   43 +++++++++++++----
 src/tseng_pcirename.h |  122 ++++++++++++++++++++++++++++++++++++++++++++++++++
 11 files changed, 203 insertions(+), 38 deletions(-)

New commits:
commit 08b489a266d79cb650ec71249708412d5908c017
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 19 16:10:24 2008 -0400

    tseng 1.2.0

diff --git a/configure.ac b/configure.ac
index e47d253..549b16f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
 
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-tseng],
-        1.1.1,
+        1.2.0,
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
         xf86-video-tseng)
 

commit 2d495250bc09ab037985ecd5be4229f40b9dca4a
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 19 16:02:54 2008 -0400

    Finish making xf1bpp/xf4bpp optional.

diff --git a/src/tseng.h b/src/tseng.h
index 8dc571a..6af1185 100644
--- a/src/tseng.h
+++ b/src/tseng.h
@@ -1,8 +1,8 @@
-
-
 #ifndef _TSENG_H
 #define _TSENG_H
 
+#include "config.h"
+
 #include "tseng_pcirename.h"
 #include <string.h>
 
@@ -35,8 +35,12 @@
 #include "micmap.h"
 
 /* Needed for the 1 and 4 bpp framebuffers */
+#ifdef HAVE_XF1BPP
 #include "xf1bpp.h"
+#endif
+#ifdef HAVE_XF4BPP
 #include "xf4bpp.h"
+#endif
 #include "fb.h"
 
 /* Drivers using the XAA interface ... */

commit b3ea57ce98505fdafaacf80faff4ef1216682901
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 19 15:49:04 2008 -0400

    Fix distcheck

diff --git a/src/Makefile.am b/src/Makefile.am
index 7f2b2ac..114f8e9 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,4 +35,5 @@ tseng_drv_la_SOURCES = \
          tseng_dga.c \
          tseng_driver.c \
          tseng.h \
-         tseng_mode.c
+         tseng_mode.c \
+	 tseng_pcirename.h

commit 2d44541a6a5bb6b62db087b268d723e5a77320e5
Author: Adam Jackson <ajax@redhat.com>
Date:   Wed Mar 19 15:45:12 2008 -0400

    Death to RCS tags.

diff --git a/src/tseng.h b/src/tseng.h
index 1ddee42..8dc571a 100644
--- a/src/tseng.h
+++ b/src/tseng.h
@@ -1,5 +1,4 @@
 
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.h,v 1.37tsi Exp $ */
 
 #ifndef _TSENG_H
 #define _TSENG_H
diff --git a/src/tseng_accel.c b/src/tseng_accel.c
index 84eee5e..800b5dd 100644
--- a/src/tseng_accel.c
+++ b/src/tseng_accel.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_accel.c,v 1.29 1999/06/12 07:18:57 dawes Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
diff --git a/src/tseng_cursor.c b/src/tseng_cursor.c
index a3496ec..d4fb847 100644
--- a/src/tseng_cursor.c
+++ b/src/tseng_cursor.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_cursor.c,v 1.16 2000/09/19 12:46:19 eich Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
diff --git a/src/tseng_dga.c b/src/tseng_dga.c
index be50434..70ebe23 100644
--- a/src/tseng_dga.c
+++ b/src/tseng_dga.c
@@ -1,4 +1,3 @@
-/* $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_dga.c,v 1.1 2000/12/06 15:35:24 eich Exp $ */
 /*
  * Copyright 2000 by Rainer Keller, <Rainer.Keller@studmail.uni-stuttgart.de>.
  *
diff --git a/src/tseng_driver.c b/src/tseng_driver.c
index b2f0383..67cc231 100644
--- a/src/tseng_driver.c
+++ b/src/tseng_driver.c
@@ -1,5 +1,4 @@
 /*
- * $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng_driver.c,v 1.97tsi Exp $ 
  *
  * Copyright 1990,91 by Thomas Roell, Dinkelscherben, Germany.
  *
@@ -26,7 +25,6 @@
  *
  * Large parts rewritten for XFree86 4.0 by Koen Gadeyne.
  */
-/* $XConsortium: et4_driver.c /main/27 1996/10/28 04:48:15 kaleb $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"

commit 7ad7c5136ba51e3e9057afb85aaba04b8e465125
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date:   Sun Mar 9 00:02:49 2008 +0100

    Makefile.am: nuke RCS Id

diff --git a/man/Makefile.am b/man/Makefile.am
index bf7ec17..f0eb29b 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,4 +1,3 @@
-# $Id$
 #
 # Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
 # 

commit 76fb068300fe3b6ff02215802d7c00c0c1db1faa
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed Feb 27 14:09:24 2008 +1000

    oops forgot pcirename file

diff --git a/src/tseng_pcirename.h b/src/tseng_pcirename.h
new file mode 100644
index 0000000..f0f5cf8
--- /dev/null
+++ b/src/tseng_pcirename.h
@@ -0,0 +1,122 @@
+/*
+ * Copyright 2007 George Sapountzis
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+/**
+ * Macros for porting drivers from legacy xfree86 PCI code to the pciaccess
+ * library. The main purpose being to facilitate source code compatibility.
+ */
+
+#ifndef CIRPCIRENAME_H
+#define CIRPCIRENAME_H
+
+enum region_type {
+    REGION_MEM,
+    REGION_IO 
+};
+
+#ifndef XSERVER_LIBPCIACCESS
+
+/* pciVideoPtr */
+#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor)
+#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)
+#define PCI_DEV_BUS(_pcidev)       ((_pcidev)->bus)
+#define PCI_DEV_DEV(_pcidev)       ((_pcidev)->device)
+#define PCI_DEV_FUNC(_pcidev)      ((_pcidev)->func)
+
+/* pciConfigPtr */
+#define PCI_CFG_TAG(_pcidev)  (((pciConfigPtr)(_pcidev)->thisCard)->tag)
+#define PCI_CFG_BUS(_pcidev)  (((pciConfigPtr)(_pcidev)->thisCard)->busnum)
+#define PCI_CFG_DEV(_pcidev)  (((pciConfigPtr)(_pcidev)->thisCard)->devnum)
+#define PCI_CFG_FUNC(_pcidev) (((pciConfigPtr)(_pcidev)->thisCard)->funcnum)
+
+/* region addr: xfree86 uses different fields for memory regions and I/O ports */
+#define PCI_REGION_BASE(_pcidev, _b, _type)             \
+    (((_type) == REGION_MEM) ? (_pcidev)->memBase[(_b)] \
+                             : (_pcidev)->ioBase[(_b)])
+
+/* region size: xfree86 uses the log2 of the region size,
+ * but with zero meaning no region, not size of one XXX */
+#define PCI_REGION_SIZE(_pcidev, _b) \
+    (((_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))
+
+#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
+    pciWriteLong(PCI_CFG_TAG(_pcidev), (_offset), (_value))
+
+#else /* XSERVER_LIBPCIACCESS */
+
+typedef struct pci_device *pciVideoPtr;
+
+#define PCI_DEV_VENDOR_ID(_pcidev) ((_pcidev)->vendor_id)
+#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)
+
+/* PCI_DEV macros, typically used in printf's, add domain ? XXX */
+#define PCI_DEV_BUS(_pcidev)       ((_pcidev)->bus)
+#define PCI_DEV_DEV(_pcidev)       ((_pcidev)->dev)
+#define PCI_DEV_FUNC(_pcidev)      ((_pcidev)->func)
+
+/* pci-rework functions take a 'pci_device' parameter instead of a tag */
+#define PCI_CFG_TAG(_pcidev)        (_pcidev)
+
+/* PCI_CFG macros, typically used in DRI init, contain the domain */
+#define PCI_CFG_BUS(_pcidev)      (((_pcidev)->domain << 8) | \
+                                    (_pcidev)->bus)
+#define PCI_CFG_DEV(_pcidev)       ((_pcidev)->dev)
+#define PCI_CFG_FUNC(_pcidev)      ((_pcidev)->func)
+
+#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))
+
+#define PCI_WRITE_LONG(_pcidev, _value, _offset) \
+    pci_device_cfg_write_u32((_pcidev), (_value), (_offset))
+
+#endif /* XSERVER_LIBPCIACCESS */
+
+#endif /* CIRPCIRENAME_H */

commit ef47398dde445038e5c7303ef54f2002a633da55
Author: Dave Airlie <airlied@redhat.com>
Date:   Wed Feb 27 14:05:38 2008 +1000

    blind pciaccess conversion

diff --git a/configure.ac b/configure.ac
index dd17541..e47d253 100644
--- a/configure.ac
+++ b/configure.ac
@@ -62,6 +62,20 @@ PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_M
 sdkdir=$(pkg-config --variable=sdkdir xorg-server)
 
 # Checks for libraries.
+SAVE_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
+AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
+              [XSERVER_LIBPCIACCESS=yes],[XSERVER_LIBPCIACCESS=no],
+              [#include "xorg-server.h"])
+AC_CHECK_HEADER(xf1bpp.h,[AC_DEFINE(HAVE_XF1BPP, 1, [Have 1bpp support])],[])
+AC_CHECK_HEADER(xf4bpp.h,[AC_DEFINE(HAVE_XF4BPP, 1, [Have 4bpp support])],[])
+CPPFLAGS="$SAVE_CPPFLAGS"
+
+if test "x$XSERVER_LIBPCIACCESS" = xyes; then
+    PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
+    XORG_CFLAGS="$XORG_CFLAGS $PCIACCESS_CFLAGS"
+fi
+AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
 
 # Checks for header files.
 AC_HEADER_STDC
diff --git a/src/tseng.h b/src/tseng.h
index ec3c461..1ddee42 100644
--- a/src/tseng.h
+++ b/src/tseng.h
@@ -4,6 +4,7 @@
 #ifndef _TSENG_H
 #define _TSENG_H
 
+#include "tseng_pcirename.h"
 #include <string.h>
 
 /* All drivers should typically include these */
@@ -106,7 +107,9 @@ typedef struct {
     unsigned char *BresenhamTable;
     /* normal stuff starts here */
     pciVideoPtr PciInfo;
+#ifndef XSERVER_LIBPCIACCESS
     PCITAG PciTag;
+#endif
 
     Bool UsePCIRetry;		       /* Do we use PCI-retry or busy-waiting */
     Bool UseAccel;		       /* Do we use the XAA acceleration architecture */
diff --git a/src/tseng_driver.c b/src/tseng_driver.c
index cdfe3d7..b2f0383 100644
--- a/src/tseng_driver.c
+++ b/src/tseng_driver.c
@@ -417,9 +417,11 @@ TsengProbe(DriverPtr drv, int flags)
 	return FALSE;
     }
 
+#ifndef XSERVER_LIBPCIACCESS
     /* PCI only driver now. */
     if (!xf86GetPciVideoInfo())
         return FALSE;
+#endif
 
     /* XXX maybe this can go some time soon */
     /*
@@ -476,7 +478,7 @@ TsengPreInitPCI(ScrnInfoPtr pScrn)
     /* Set up ChipType, ChipRev and pScrn->chipset.
      * This last one is usually not done manually, but
      * it's for informative use only anyway. */
-    switch (pTseng->PciInfo->chipType) {
+    switch (PCI_DEV_DEVICE_ID(pTseng->PciInfo)) {
     case PCI_CHIP_ET4000_W32P_A:
 	pTseng->ChipType = ET4000;
 	pTseng->ChipRev = REV_A;
@@ -500,7 +502,7 @@ TsengPreInitPCI(ScrnInfoPtr pScrn)
     case PCI_CHIP_ET6000:
 	pTseng->ChipType = ET6000;
 
-        if (pTseng->PciInfo->chipRev < 0x70) {
+        if (PCI_DEV_REVISION(pTseng->PciInfo) < 0x70) {
             pScrn->chipset = "ET6000";
             pTseng->ChipRev = REV_ET6000;
         } else {
@@ -510,24 +512,26 @@ TsengPreInitPCI(ScrnInfoPtr pScrn)
 	break;
     default:
 	xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Unknown Tseng PCI ID: %X\n",
-                   pTseng->PciInfo->chipType);
+                   PCI_DEV_DEVICE_ID(pTseng->PciInfo));
 	return FALSE;
     }
 
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Chipset: \"%s\"\n", pScrn->chipset);
 
+#ifndef XSERVER_LIBPCIACCESS
     pTseng->PciTag = pciTag(pTseng->PciInfo->bus, pTseng->PciInfo->device,
 	pTseng->PciInfo->func);
+#endif
 
     /* only the ET6000 implements a PCI IO address */
     if (pTseng->ChipType == ET6000) {
-        if (!pTseng->PciInfo->ioBase[1]) {
+        if (!PCI_REGION_BASE(pTseng->PciInfo, 1, REGION_IO)) {
             xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                        "No valid PCI I/O address in PCI config space\n");
             return FALSE;
         }
 
-        pTseng->ET6000IOAddress = pTseng->PciInfo->ioBase[1];
+        pTseng->ET6000IOAddress = PCI_REGION_BASE(pTseng->PciInfo, 1, REGION_IO);
         
         xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "ET6000 PCI I/O registers at 0x%lX\n",
                    (unsigned long)pTseng->ET6000IOAddress);
@@ -942,12 +946,12 @@ TsengGetFbAddress(ScrnInfoPtr pScrn)
     PDEBUG("	TsengGetFbAddress\n");
 
     /* base0 is the framebuffer and base1 is the PCI IO space. */
-    if (!pTseng->PciInfo->memBase[0]) {
+    if (PCI_REGION_BASE(pTseng->PciInfo, 0, REGION_MEM)) {
         xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                    "No valid Framebuffer address in PCI config space;\n");
         return FALSE;
     } else
-        pTseng->FbAddress = pTseng->PciInfo->memBase[0];
+        pTseng->FbAddress = PCI_REGION_BASE(pTseng->PciInfo, 0, REGION_MEM);
 
 
     if (xf86RegisterResources(pTseng->pEnt->index,NULL,ResNone)) {
@@ -1680,10 +1684,25 @@ TsengMapMem(ScrnInfoPtr pScrn)
 	return FALSE;
     }
 
+#ifndef XSERVER_LIBPCIACCESS
     pTseng->FbBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_FRAMEBUFFER,
                                    pTseng->PciTag,
                                    (unsigned long)pTseng->FbAddress,
                                    pTseng->FbMapSize);
+#else
+    {
+      void** result = (void**)&pTseng->FbBase;
+      int err = pci_device_map_range(pTseng->PciInfo,
+				     pTseng->FbAddress,
+				     pTseng->FbMapSize,
+				     PCI_DEV_MAP_FLAG_WRITABLE |
+				     PCI_DEV_MAP_FLAG_WRITE_COMBINE,
+				     result);
+      
+      if (err) 
+	return FALSE;
+    }
+#endif
     if (pTseng->FbBase == NULL) {
         xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                    "Could not mmap linear video memory.\n");
@@ -1692,10 +1711,14 @@ TsengMapMem(ScrnInfoPtr pScrn)
 
     /* need some sanity here */
     if (pTseng->UseAccel) {
+#ifndef XSERVER_LIBPCIACCESS
         pTseng->MMioBase = xf86MapPciMem(pScrn->scrnIndex, VIDMEM_MMIO,
                                          pTseng->PciTag,
                                          (unsigned long)pTseng->FbAddress,
                                          pTseng->FbMapSize);
+#else
+	pTseng->MMioBase = pTseng->FbBase;
+#endif
         if (!pTseng->MMioBase) {
 	    xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
 		       "Could not mmap mmio memory.\n");
@@ -1717,7 +1740,11 @@ TsengUnmapMem(ScrnInfoPtr pScrn)
 
     PDEBUG("	TsengUnmapMem\n");
 
+#ifndef XSERVER_LIBPCIACCESS
     xf86UnMapVidMem(pScrn->scrnIndex, (pointer) pTseng->FbBase, pTseng->FbMapSize);
+#else
+    pci_device_unmap_range(pTseng->PciInfo, pTseng->FbBase, pTseng->FbMapSize);
+#endif
 
     vgaHWUnmapMem(pScrn);
 

commit 116da81133b3242c7a4a809fcc320a93fea8671b
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date:   Tue Feb 27 13:09:52 2007 -0800

    renamed: .cvsignore -> .gitignore

diff --git a/.cvsignore b/.cvsignore
deleted file mode 100644
index 7660f50..0000000
--- a/.cvsignore
+++ /dev/null
@@ -1,20 +0,0 @@
-Makefile
-Makefile.in
-*.la
-*.lo
-aclocal.m4
-autom4te.cache
-config.guess
-config.h
-config.h.in
-config.log
-config.status
-config.sub
-configure
-depcomp
-install-sh
-libtool
-ltmain.sh
-missing
-mkinstalldirs
-stamp-h1
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..54018b8
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,21 @@
+Makefile
+Makefile.in
+*.la
+*.lo
+aclocal.m4
+autom4te.cache
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+depcomp
+install-sh
+libtool
+ltmain.sh
+missing
+mkinstalldirs
+stamp-h1
+*~


Reply to: