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
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
|
diff --git a/COPYING b/COPYING
index 7f33cbf..458ab5f 100644
--- a/COPYING
+++ b/COPYING
@@ -1,12 +1,70 @@
-This is a stub file. This package has not yet had its complete licensing
-information compiled. Please see the individual source files for details on
-your rights to use and modify this software.
+ Copyright 2001 Ani Joshi <ajoshi@unixbox.com>
-Please submit updated COPYING files to the Xorg bugzilla:
+ XFree86 4.x driver for S3 chipsets
-https://bugs.freedesktop.org/enter_bug.cgi?product=xorg
-All licensing questions regarding this software should be directed at the
-Xorg mailing list:
+Permission to use, copy, modify, distribute, and sell this software and its
+documentation for any purpose is hereby granted without fee, provided that
+the above copyright notice appear in all copies and that both that copyright
+notice and this permission notice appear in supporting documentation and
+that the name of Ani Joshi not be used in advertising or
+publicity pertaining to distribution of the software without specific,
+written prior permission. Ani Joshi makes no representations
+about the suitability of this software for any purpose. It is provided
+"as-is" without express or implied warranty.
+
+ANI JOSHI DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+EVENT SHALL ANI JOSHI BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+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.
+
+Copyright (C) 1994-2000 The XFree86 Project, Inc. All Rights Reserved.
+
+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 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, FIT-
+NESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+XFREE86 PROJECT 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.
+
+Except as contained in this notice, the name of the XFree86 Project shall not
+be used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the XFree86 Project.
+
+
+Copyright 1995-1997 The XFree86 Project, Inc.
+Copyright (c) 1999,2000 The XFree86 Project Inc.
-http://lists.freedesktop.org/mailman/listinfo/xorg
diff --git a/ChangeLog b/ChangeLog
deleted file mode 100644
index ad0b227..0000000
--- a/ChangeLog
+++ /dev/null
@@ -1,133 +0,0 @@
-2009-06-25 Evgeny M. zubok <evgeny.zubok@tochka.ru>
-
- * src/s3_driver.c:
- Revert the old behaviour when the BIOS settings are used for
- intialization of DRAM/VRAM timings, i. e. we don't touch the
- timings during initialization phase until any memory option (like
- slow_edodram) is specified.
-
- Add manual page.
-
-2009-05-25 Evgeny M. Zubok <evgeny.zubok@tochka.ru>
-
- * src/s3_driver.c:
- * src/s3_video.c:
-
- Enable Xv extension for Trio64V+ (thanks to Egor Ivanov for
- testing on real hardware) and Trio64UV+ (Tested only on Trio64V2 by
- overriding Chipset with "Trio64UV+" but not on real hardware).
-
- S3 Trio64V+ now using NewMMIO. Trio64V+ chips have the same ChipId
- as Trio32/64 but only with chip revision greater or eq 0x40. So if
- you have problems with NewMMIO, you may override ChipRev in "Device"
- section of your xorg.conf: "ChipRev" 0x00. Note: disabling the NewMMIO
- also disables overlay video (Xv) because it isn't implemented for
- Old MMIO yet.
-
-2009-05-04 Evgeny M. Zubok <evgeny.zubok@tochka.ru>
-
- * src/s3_driver.c:
- * src/s3_shadow.c:
-
- Add shadowFB option. It can be used to speedup drawing when
- hardware acceleration is undesirable or unavailable (for colour depth
- 24 with 24 bpp framebuffer, for example). shadowFB is disabled by
- default. Enabling shadowFB option disables HW acceleration. Thanks
- to Egor Ivanov for initial porting of shadowFB from s3virge.
-
- Interlace mode support.
-
- Close bug #14999.
-
-2008-07-06 Evgeny M. Zubok <evgeny.zubok@tochka.ru>
-
- * src/s3_video.c:
-
- Streams Processor initialization.
-
- XVideo support for 16, 24 and 32 bpp (only for TRIO64V2).
-
- * src/s3_driver.c:
-
- Add XVideo option (enabled by default).
-
- Replace "swcursor" by "hwcursor" option (HW cursor
- not implemented yet for all chipsets).
-
- Close bug #5527: 24-bit colour depth support (24bpp and
- 32bpp framebuffer) for TRIOs. Acceleration doesn't work
- with packed colour mode (24 bpp FB) but works with 32bpp
- framebuffer mode (hardware limitation? -- need data).
-
- Fix system hang-up when switching between console and X session.
-
- Some minor changes of driver messages.
-
-2008-02-23 Evgeny M. Zubok <evgeny.zubok@tochka.ru>
-
- * src/s3_driver.c: Add DPMS support for S3 Trio64V2 and possibly
- others (need testing): S3 Trio64UV+. S3 Aurora64V+ and S3 Trio32/64
- * src/s3_Trio64DAC: Change clocks for S3 Trio64V2 to make
- the 1024x768@16bpp mode work.
- Thanks to Richard Driscoll for these patches.
-
-2006-04-07 Adam Jackson <ajax@freedesktop.org>
-
- * configure.ac:
- * src/s3.h:
- Bump to 0.4.1 for Xv changes.
-
-2006-04-07 Aaron Plattner <aplattner@nvidia.com>
-
- * src/s3_video.c: (S3PutImage):
- Add a DrawablePtr argument to the XV functions to pave the way for
- redirected video.
-
-2006-04-07 Adam Jackson <ajax@freedesktop.org>
-
- * configure.ac:
- * src/s3.h:
- * src/s3_IBMRGB.c:
- * src/s3_Ti.c:
- * src/s3_Trio64DAC.c:
- * src/s3_bios.c:
- * src/s3_cursor.c:
- * src/s3_dga.c:
- * src/s3_driver.c:
- * src/s3_video.c:
- Unlibcwrap. Bump server version requirement. Bump to 0.4.0.
-
-2005-12-20 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Update package version for X11R7 release.
-
-2005-12-14 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Update package version number for final X11R7 release candidate.
-
-2005-12-03 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Update package version number for X11R7 RC3 release.
-
-2005-12-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Remove extraneous AC_MSG_RESULT.
-
-2005-11-29 Adam Jackson <ajax@freedesktop.org>
-
- * configure.ac:
- Only build dlloader modules by default.
-
-2005-11-09 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Update package version number for X11R7 RC2 release.
-
-2005-11-01 Kevin E. Martin <kem-at-freedesktop-dot-org>
-
- * configure.ac:
- Update pkgcheck dependencies to work with separate build roots.
diff --git a/Makefile.am b/Makefile.am
index 7052905..4c278ba 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -18,5 +18,15 @@
# 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.
-AUTOMAKE_OPTIONS = foreign
SUBDIRS = src man
+MAINTAINERCLEANFILES = ChangeLog INSTALL
+
+.PHONY: ChangeLog INSTALL
+
+INSTALL:
+ $(INSTALL_CMD)
+
+ChangeLog:
+ $(CHANGELOG_CMD)
+
+dist-hook: ChangeLog INSTALL
diff --git a/configure.ac b/configure.ac
index 0eecc87..0ac34f9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,42 +20,50 @@
#
# Process this file with autoconf to produce a configure script
-AC_PREREQ(2.57)
+# Initialize Autoconf
+AC_PREREQ([2.60])
AC_INIT([xf86-video-s3],
- 0.6.3,
+ [0.6.3],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
- xf86-video-s3)
-
+ [xf86-video-s3])
AC_CONFIG_SRCDIR([Makefile.am])
-AM_CONFIG_HEADER([config.h])
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR(.)
-AM_INIT_AUTOMAKE([dist-bzip2])
-
+# Initialize Automake
+AM_INIT_AUTOMAKE([foreign dist-bzip2])
AM_MAINTAINER_MODE
-# Checks for programs.
+# 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.8 or later before running autoconf/autogen])])
+XORG_MACROS_VERSION(1.8)
+XORG_DEFAULT_OPTIONS
+
+# Initialize libtool
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
-AC_PROG_CC
+
+# Checks for programs.
+AM_PROG_CC_C_O
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.4 xproto fontsproto $REQUIRED_MODULES])
-sdkdir=$(pkg-config --variable=sdkdir xorg-server)
# Checks for libraries.
SAVE_CPPFLAGS="$CPPFLAGS"
@@ -65,28 +73,20 @@ AC_CHECK_DECL(XSERVER_LIBPCIACCESS,
[#include "xorg-server.h"])
CPPFLAGS="$SAVE_CPPFLAGS"
-# Checks for header files.
-AC_HEADER_STDC
-
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)
-AC_SUBST([XORG_CFLAGS])
AC_SUBST([moduledir])
DRIVER_NAME=s3
AC_SUBST([DRIVER_NAME])
-XORG_MANPAGE_SECTIONS
-XORG_RELEASE_VERSION
-
-XORG_CHECK_LINUXDOC
-
-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 f0eb29b..b3688ce 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -1,27 +1,24 @@
#
# Copyright 2005 Sun Microsystems, Inc. All rights reserved.
-#
-# Permission to use, copy, modify, distribute, and sell this software and its
-# documentation for any purpose is hereby granted without fee, provided that
-# the above copyright notice appear in all copies and that both that
-# copyright notice and this permission notice appear in supporting
-# documentation.
-#
-# The above copyright notice and this permission notice 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 OPEN GROUP 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.
-#
-# Except as contained in this notice, the name of the copyright holders shall
-# not be used in advertising or otherwise to promote the sale, use or
-# other dealings in this Software without prior written authorization
-# from the copyright holders.
+#
+# 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.
#
drivermandir = $(DRIVER_MAN_DIR)
@@ -34,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
+# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
-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'
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
.man.$(DRIVER_MAN_SUFFIX):
- sed $(MAN_SUBSTS) < $< > $@
+ $(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
diff --git a/src/s3.h b/src/s3.h
index 49b8a54..0875fc9 100644
--- a/src/s3.h
+++ b/src/s3.h
@@ -113,7 +113,6 @@ typedef struct _S3Rec {
XAAInfoRecPtr pXAA;
xf86CursorInfoPtr pCurs;
xf86Int10InfoPtr pInt10;
- vbeInfoPtr pVBE;
XF86VideoAdaptorPtr adaptor;
S3PortPrivPtr portPrivate;
diff --git a/src/s3_driver.c b/src/s3_driver.c
index 29e343d..2011dfc 100644
--- a/src/s3_driver.c
+++ b/src/s3_driver.c
@@ -309,6 +309,7 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
S3Ptr pS3;
vgaHWPtr hwp;
ClockRangePtr clockRanges;
+ vbeInfoPtr pVBE;
rgb zeros = {0, 0, 0};
Gamma gzeros = {0.0, 0.0, 0.0};
int i, vgaCRIndex, vgaCRReg;
@@ -325,6 +326,7 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
return FALSE;
hwp = VGAHWPTR(pScrn);
+ vgaHWSetStdFuncs(hwp);
vgaHWGetIOBase(hwp);
pScrn->monitor = pScrn->confScreen->monitor;
@@ -436,9 +438,19 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
}
if (xf86LoadSubModule(pScrn, "vbe")) {
- pS3->pVBE = VBEInit(pS3->pInt10, pEnt->index);
+ pVBE = VBEInit(pS3->pInt10, pEnt->index);
+ vbeFree(pVBE);
}
+ xf86LoadSubModule(pScrn, "fb");
+
+ if (!xf86LoadSubModule(pScrn, "xaa")) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Falling back to shadowfb\n");
+ pS3->NoAccel = TRUE;
+ pS3->shadowFB = TRUE;
+ }
+
if (pS3->shadowFB) {
if (!xf86LoadSubModule(pScrn, "shadowfb")) {
S3FreeRec(pScrn);
@@ -726,11 +738,6 @@ static Bool S3PreInit(ScrnInfoPtr pScrn, int flags)
xf86PrintModes(pScrn);
xf86SetDpi(pScrn, 0, 0);
- xf86LoadSubModule(pScrn, "fb");
-
- if (!xf86LoadSubModule(pScrn, "xaa"))
- return FALSE;
-
return TRUE;
}
diff --git a/src/s3_video.c b/src/s3_video.c
index 3e88889..9a2d458 100644
--- a/src/s3_video.c
+++ b/src/s3_video.c
@@ -244,6 +244,8 @@ static XF86VideoAdaptorPtr S3SetupImageVideoOverlay(ScreenPtr pScreen)
XF86VideoAdaptorPtr adapt;
adapt = S3AllocAdaptor(pScrn);
+ if (adapt == NULL)
+ return NULL;
adapt->type = XvWindowMask | XvInputMask | XvImageMask;
adapt->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT;
|