summaryrefslogtreecommitdiff
path: root/extra/xf86-video-tseng/tseng-1.2.4-git.patch
blob: 082b2cb0b2fbe8df9431c39e2523f9241b03c190 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
diff --git a/configure.ac b/configure.ac
index 62cc318..8458c06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,46 +20,46 @@
 #
 # Process this file with autoconf to produce a configure script
 
-AC_PREREQ(2.57)
+# Initialize Autoconf
+AC_PREREQ([2.60])
 AC_INIT([xf86-video-tseng],
-        1.2.4,
+        [1.2.4],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
-        xf86-video-tseng)
-
+        [xf86-video-tseng])
 AC_CONFIG_SRCDIR([Makefile.am])
-AM_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
 AC_CONFIG_AUX_DIR(.)
 
+# Initialize Automake
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
-
 AM_MAINTAINER_MODE
 
-# Require xorg-macros: XORG_DEFAULT_OPTIONS
+# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
 m4_ifndef([XORG_MACROS_VERSION],
-          [m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
-XORG_MACROS_VERSION(1.3)
+          [m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
 XORG_DEFAULT_OPTIONS
 
-# Checks for programs.
+# Initialize libtool
 AC_DISABLE_STATIC
 AC_PROG_LIBTOOL
-AC_PROG_CC
 
 AH_TOP([#include "xorg-server.h"])
 
+# Define a configure option for an alternate module directory
 AC_ARG_WITH(xorg-module-dir,
-            AC_HELP_STRING([--with-xorg-module-dir=DIR],
+            AS_HELP_STRING([--with-xorg-module-dir=DIR],
                            [Default xorg module directory [[default=$libdir/xorg/modules]]]),
             [moduledir="$withval"],
             [moduledir="$libdir/xorg/modules"])
 
-# Checks for extensions
+# Store the list of server defined optional extensions in REQUIRED_MODULES
 XORG_DRIVER_CHECK_EXT(RANDR, randrproto)
 XORG_DRIVER_CHECK_EXT(RENDER, renderproto)
 XORG_DRIVER_CHECK_EXT(XV, videoproto)
 XORG_DRIVER_CHECK_EXT(DPMSExtension, xextproto)
 
-# Checks for pkg-config packages
+# Obtain compiler/linker options for the driver dependencies
 PKG_CHECK_MODULES(XORG, [xorg-server >= 1.0.99.901 xproto fontsproto $REQUIRED_MODULES])
 
 # Checks for libraries.
@@ -78,17 +78,14 @@ if test "x$XSERVER_LIBPCIACCESS" = xyes; then
 fi
 AM_CONDITIONAL(XSERVER_LIBPCIACCESS, test "x$XSERVER_LIBPCIACCESS" = xyes)
 
-# Checks for header files.
-AC_HEADER_STDC
-
-AC_SUBST([XORG_CFLAGS])
 AC_SUBST([moduledir])
 
 DRIVER_NAME=tseng
 AC_SUBST([DRIVER_NAME])
 
-AC_OUTPUT([
-	Makefile
-	src/Makefile
-	man/Makefile
+AC_CONFIG_FILES([
+                Makefile
+                src/Makefile
+                man/Makefile
 ])
+AC_OUTPUT
diff --git a/man/Makefile.am b/man/Makefile.am
index 8f2454b..b3688ce 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -31,25 +31,11 @@ EXTRA_DIST = @DRIVER_NAME@.man
 
 CLEANFILES = $(driverman_DATA)
 
-SED = sed
-
-# Strings to replace in man pages
-XORGRELSTRING = @PACKAGE_STRING@
-  XORGMANNAME = X Version 11
-
-MAN_SUBSTS = \
-	-e 's|__vendorversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-	-e 's|__xorgversion__|"$(XORGRELSTRING)" "$(XORGMANNAME)"|' \
-	-e 's|__xservername__|Xorg|g' \
-	-e 's|__xconfigfile__|xorg.conf|g' \
-	-e 's|__projectroot__|$(prefix)|g' \
-	-e 's|__appmansuffix__|$(APP_MAN_SUFFIX)|g' \
-	-e 's|__drivermansuffix__|$(DRIVER_MAN_SUFFIX)|g' \
-	-e 's|__adminmansuffix__|$(ADMIN_MAN_SUFFIX)|g' \
-	-e 's|__miscmansuffix__|$(MISC_MAN_SUFFIX)|g' \
-	-e 's|__filemansuffix__|$(FILE_MAN_SUFFIX)|g'
+
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
+
 
 SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
 
 .man.$(DRIVER_MAN_SUFFIX):
-	sed $(MAN_SUBSTS) < $< > $@
+	$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/man/tseng.man b/man/tseng.man
index 403782f..984c8e7 100644
--- a/man/tseng.man
+++ b/man/tseng.man
@@ -1,4 +1,3 @@
-.\" $XFree86: xc/programs/Xserver/hw/xfree86/drivers/tseng/tseng.man,v 1.2 2001/01/27 18:20:55 dawes Exp $ 
 .\" shorthand for double quote that works everywhere.
 .ds q \N'34'
 .TH TSENG __drivermansuffix__ __vendorversion__
diff --git a/src/tseng_cursor.c b/src/tseng_cursor.c
index d4fb847..2412b31 100644
--- a/src/tseng_cursor.c
+++ b/src/tseng_cursor.c
@@ -159,7 +159,7 @@ TsengSetCursorColors(ScrnInfoPtr pScrn, int bg, int fg)
     }
 }
 
-void 
+static void 
 TsengLoadCursorImage(ScrnInfoPtr pScrn, unsigned char *bits)
 {
     vgaHWPtr hwp = VGAHWPTR(pScrn);
diff --git a/src/tseng_dga.c b/src/tseng_dga.c
index 70ebe23..528ba4c 100644
--- a/src/tseng_dga.c
+++ b/src/tseng_dga.c
@@ -74,9 +74,9 @@ TsengDGAInit(ScreenPtr pScreen)
   if (!pTseng->DGAnumModes) {
     pMode = firstMode = pScrn->modes;
     while (pMode) {
-      newmodes = xrealloc(modes, (num + 1) * sizeof (DGAModeRec));
+      newmodes = realloc(modes, (num + 1) * sizeof (DGAModeRec));
       if (!newmodes) {
-	xfree(modes);
+	free(modes);
 	return FALSE;
       }
       modes = newmodes;
@@ -135,7 +135,7 @@ Tseng_OpenFramebuffer(
     TsengPtr pTseng = TsengPTR(pScrn);
 
     *name = NULL; 		/* no special device */
-    *mem = (unsigned char*)pTseng->FbAddress;
+    *mem = (unsigned char*)(uintptr_t)pTseng->FbAddress;
     *size = pTseng->FbMapSize;
     *offset = 0;                /* Always */
     *flags = 0;                 /* Root permissions OS-dependent */
diff --git a/src/tseng_driver.c b/src/tseng_driver.c
index 445c17e..d36b62c 100644
--- a/src/tseng_driver.c
+++ b/src/tseng_driver.c
@@ -269,9 +269,9 @@ TsengFreeRec(ScrnInfoPtr pScrn)
     pTseng = TsengPTR(pScrn);
     
     if (pTseng->SavedReg.RAMDAC)
-        xfree(pTseng->SavedReg.RAMDAC);
+        free(pTseng->SavedReg.RAMDAC);
 
-    xfree(pScrn->driverPrivate);
+    free(pScrn->driverPrivate);
     pScrn->driverPrivate = NULL;
 }
 
@@ -395,10 +395,10 @@ TsengProbe(DriverPtr drv, int flags)
                 foundScreen = TRUE;
             }
         }
-        xfree(usedChips);
+        free(usedChips);
     }
     
-    xfree(devSections);
+    free(devSections);
     return foundScreen;
 }
 
@@ -806,7 +806,7 @@ TsengProcessOptions(ScrnInfoPtr pScrn)
     xf86CollectOptions(pScrn, NULL);
 
     /* Process the options */
-    if (!(pTseng->Options = xalloc(sizeof(TsengOptions))))
+    if (!(pTseng->Options = malloc(sizeof(TsengOptions))))
 	return FALSE;
     memcpy(pTseng->Options, TsengOptions, sizeof(TsengOptions));
     xf86ProcessOptions(pScrn->scrnIndex, pScrn->options, pTseng->Options);
@@ -883,7 +883,7 @@ TsengGetFbAddress(ScrnInfoPtr pScrn)
     PDEBUG("	TsengGetFbAddress\n");
 
     /* base0 is the framebuffer and base1 is the PCI IO space. */
-    if (PCI_REGION_BASE(pTseng->PciInfo, 0, REGION_MEM)) {
+    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;
diff --git a/src/tseng_mode.c b/src/tseng_mode.c
index f075226..a3ff87d 100644
--- a/src/tseng_mode.c
+++ b/src/tseng_mode.c
@@ -41,7 +41,11 @@ vgaHWWriteBank(vgaHWPtr hwp, CARD8 value)
     if (hwp->MMIOBase)
 	MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + VGA_BANK, value);
     else
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
 	outb(hwp->PIOOffset + VGA_BANK, value);
+#else
+	pci_io_write8(hwp->io, VGA_BANK, value);
+#endif
 }
 
 CARD8
@@ -50,7 +54,11 @@ vgaHWReadBank(vgaHWPtr hwp)
     if (hwp->MMIOBase)
 	return MMIO_IN8(hwp->MMIOBase, hwp->MMIOOffset + VGA_BANK);
     else
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
 	return inb(hwp->PIOOffset + VGA_BANK);
+#else
+	return pci_io_read8(hwp->io, VGA_BANK);
+#endif
 }
 
 #define VGA_SEGMENT 0x3CD
@@ -61,7 +69,11 @@ vgaHWWriteSegment(vgaHWPtr hwp, CARD8 value)
     if (hwp->MMIOBase)
 	MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + VGA_SEGMENT, value);
     else
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
 	outb(hwp->PIOOffset + VGA_SEGMENT, value);
+#else
+	pci_io_write8(hwp->io, VGA_SEGMENT, value);
+#endif
 }
 
 CARD8
@@ -70,7 +82,11 @@ vgaHWReadSegment(vgaHWPtr hwp)
     if (hwp->MMIOBase)
 	return MMIO_IN8(hwp->MMIOBase, hwp->MMIOOffset + VGA_SEGMENT);
     else
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
 	return inb(hwp->PIOOffset + VGA_SEGMENT);
+#else
+	return pci_io_read8(hwp->io, VGA_SEGMENT);
+#endif
 }
 
 /*
@@ -84,8 +100,12 @@ vgaHWWriteModeControl(vgaHWPtr hwp, CARD8 value)
     if (hwp->MMIOBase)
         MMIO_OUT8(hwp->MMIOBase,
                   hwp->MMIOOffset + hwp->IOBase + VGA_MODE_CONTROL, value);
-    else  
-        outb(hwp->IOBase + hwp->PIOOffset + VGA_MODE_CONTROL, value);
+    else
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
+	outb(hwp->PIOOffset + VGA_MODE_CONTROL, value);
+#else
+	pci_io_write8(hwp->io, VGA_MODE_CONTROL, value);
+#endif
 }
 
 /*
@@ -110,14 +130,22 @@ vgaHWHerculesSecondPage(vgaHWPtr hwp, Bool Enable)
 
         MMIO_OUT8(hwp->MMIOBase, hwp->MMIOOffset + VGA_HERCULES, tmp);
     } else {
-        tmp = inb(hwp->PIOOffset + VGA_HERCULES);
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
+	tmp = inb(hwp->PIOOffset + VGA_HERCULES);
+#else
+	tmp = pci_io_read8(hwp->io, VGA_HERCULES);
+#endif
 
         if (Enable)
             tmp |= 0x02;
         else
             tmp &= ~0x02;
 
-        outb(hwp->PIOOffset + VGA_HERCULES, tmp);
+#if GET_ABI_MAJOR(ABI_VIDEODRV_VERSION) < 12
+	outb(hwp->PIOOffset + VGA_HERCULES, tmp);
+#else
+	pci_io_write8(hwp->io, VGA_HERCULES, tmp);
+#endif
     }
 }
 
@@ -1502,7 +1530,7 @@ TsengModeInit(ScrnInfoPtr pScrn, DisplayModePtr OrigMode)
 
     /* clean up */
     if (new->RAMDAC)
-        xfree(new->RAMDAC);
+        free(new->RAMDAC);
 
     return TRUE;
 }