1 /*
2 * Copyright 1993 by David Dawes <dawes@physics.su.oz.au>
3 *
4 * Permission to use, copy, modify, distribute, and sell this software and its
5 * documentation for any purpose is hereby granted without fee, provided that
6 * the above copyright notice appear in all copies and that both that
7 * copyright notice and this permission notice appear in supporting
8 * documentation, and that the name of David Dawes
9 * not be used in advertising or publicity pertaining to distribution of
10 * the software without specific, written prior permission.
11 * David Dawes makes no representations about the suitability of this
12 * software for any purpose. It is provided "as is" without express or
13 * implied warranty.
14 *
15 * DAVID DAWES DISCLAIMS ALL WARRANTIES WITH REGARD TO
16 * THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 * FITNESS, IN NO EVENT SHALL DAVID DAWES BE LIABLE FOR
18 * ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER
19 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
20 * CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
21 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
22 *
23 */
24
25 /* $XFree86: mit/server/ddx/x386/accel/s3/drivers/s3_generic/s3_generic.c,v 2.2 1993/09/22 15:43:45 dawes Exp $ */
26
27 #include "s3.h"
28
29 static Bool S3_GENERICProbe();
30 static char *S3_GENERICIdent();
31 extern void s3EnterLeaveVT();
32 extern Bool s3Initialize();
33 extern void s3AdjustFrame();
34 extern Bool s3SwitchMode();
35
36 s3VideoChipRec S3_GENERIC = {
37 S3_GENERICProbe,
38 S3_GENERICIdent,
39 s3EnterLeaveVT,
40 s3Initialize,
41 s3AdjustFrame,
42 s3SwitchMode,
43 };
44
45 static char *
S3_GENERICIdent(n)46 S3_GENERICIdent(n)
47 int n;
48 {
49 static char *chipsets[] = {"s3_generic"};
50
51 if (n + 1 > sizeof(chipsets) / sizeof(char *))
52 return(NULL);
53 else
54 return(chipsets[n]);
55 }
56
57
58 static Bool
S3_GENERICProbe()59 S3_GENERICProbe()
60 {
61 /*
62 * We don't even get called unless the card is identified as S3, so just
63 * return TRUE, unless the chipset is specified as something other than
64 * "s3_generic" in Xconfig.
65 */
66
67 if (s3InfoRec.chipset) {
68 if (StrCaseCmp(s3InfoRec.chipset, S3_GENERICIdent(0)))
69 return(FALSE);
70 else
71 return(TRUE);
72 }
73
74 s3InfoRec.chipset = S3_GENERICIdent(0);
75 return(TRUE);
76 }
77