1 /*
2 * Mach Operating System
3 * Copyright (c) 1991,1990,1989 Carnegie Mellon University
4 * All Rights Reserved.
5 *
6 * Permission to use, copy, modify and distribute this software and its
7 * documentation is hereby granted, provided that both the copyright
8 * notice and this permission notice appear in all copies of the
9 * software, derivative works or modified versions, and any portions
10 * thereof, and that both notices appear in supporting documentation.
11 *
12 * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
13 * CONDITION. CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
14 * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
15 *
16 * Carnegie Mellon requests users of this software to return to
17 *
18 * Software Distribution Coordinator or Software.Distribution@CS.CMU.EDU
19 * School of Computer Science
20 * Carnegie Mellon University
21 * Pittsburgh PA 15213-3890
22 *
23 * any improvements or extensions that they make and grant Carnegie Mellon
24 * the rights to redistribute these changes.
25 */
26 /*
27 * HISTORY
28 * $Log: screen_switch.c,v $
29 * Revision 2.9 93/02/05 08:05:36 danner
30 * Add conditionals for pmax screen. Not available on a Flamingo
31 * [92/12/03 jeffreyh]
32 * Added sfb driver.
33 * [92/12/10 af]
34 *
35 * Revision 2.8 92/03/02 18:33:09 rpd
36 * Added MAXine framebuffer.
37 * [92/03/02 02:03:13 af]
38 *
39 * Revision 2.7 91/08/24 11:53:14 af
40 * Added new hires, monochrome screen driver "fb", dressed as a color one.
41 * [91/08/02 01:56:50 af]
42 *
43 * Revision 2.6 91/06/19 11:54:24 rvb
44 * mips->DECSTATION; vax->VAXSTATION
45 * [91/06/12 14:02:13 rvb]
46 *
47 * File moved here from mips/PMAX since it tries to be generic;
48 * it is used on the PMAX and the Vax3100.
49 * [91/06/04 rvb]
50 *
51 * Revision 2.5 91/05/14 17:27:41 mrt
52 * Correcting copyright
53 *
54 * Revision 2.4 91/02/05 17:44:22 mrt
55 * Added author notices
56 * [91/02/04 11:17:47 mrt]
57 *
58 * Changed to use new Mach copyright
59 * [91/02/02 12:16:23 mrt]
60 *
61 * Revision 2.3 90/12/05 23:34:24 af
62 * Do not use a single patchable switch, but a pointer
63 * to a per-device one.
64 * [90/12/03 23:37:08 af]
65 *
66 * Revision 2.1.1.1 90/11/01 03:41:38 af
67 * Re-Created from pm_switch.c for consistent file naming.
68 * [90/09/03 af]
69 *
70 */
71 /*
72 * File: screen_switch.c
73 * Author: Alessandro Forin, Carnegie Mellon University
74 * Date: 9/90
75 *
76 * Autoconfiguration code for the Generic Screen Driver.
77 */
78
79 #include <platforms.h>
80
81 #if defined(DECSTATION) || defined(FLAMINGO)
82 #include <fb.h>
83 #include <gx.h>
84 #include <cfb.h>
85 #include <mfb.h>
86 #include <xcfb.h>
87 #include <sfb.h>
88 #endif
89
90 #ifdef VAXSTATION
91 #define NGX 0
92 #define NCFB 0
93 #define NXCFB 0
94 #endif
95
96 #include <chips/screen_switch.h>
97
98 /* When nothing needed */
99 int screen_noop()
100 {}
101
102 /*
103 * Vector of graphic interface drivers to probe.
104 * Zero terminate this list.
105 */
106
107
108 #if NGX > 0
109 extern int gq_probe(), gq_cold_init();
110 extern unsigned int gq_mem_need();
111
112 extern int ga_probe(), ga_cold_init();
113 extern unsigned int ga_mem_need();
114 #endif /* NGX > 0 */
115
116 #if NCFB > 0
117 extern int cfb_probe(), cfb_cold_init();
118 extern unsigned int pm_mem_need();
119 #endif /* NCFB > 0 */
120
121 #if NMFB > 0
122 extern int fb_probe(), fb_cold_init();
123 extern unsigned int pm_mem_need();
124 #endif /* NMFB > 0 */
125
126 #if NXCFB > 0
127 extern int xcfb_probe(), xcfb_cold_init();
128 extern unsigned int pm_mem_need();
129 #endif /* NXCFB > 0 */
130
131 #if NSFB > 0
132 extern int sfb_probe(), sfb_cold_init();
133 extern unsigned int pm_mem_need();
134 #endif /* NSFB > 0 */
135
136 #if NFB > 0
137 extern int pm_probe(), pm_cold_init();
138 extern unsigned int pm_mem_need();
139 #endif /* NFB > 0 */
140
141 struct screen_probe_vector screen_probe_vector[] = {
142
143 #if NGX > 0
144 gq_probe, gq_mem_need, gq_cold_init, /* 3max 3D color option */
145 ga_probe, ga_mem_need, ga_cold_init, /* 3max 2D color option */
146 #endif /* NGX > 0 */
147
148 #if NSFB > 0
149 sfb_probe, pm_mem_need, sfb_cold_init, /* Smart frame buffer */
150 #endif /* NSFB > 0 */
151
152 #if NMFB > 0
153 fb_probe, pm_mem_need, fb_cold_init, /* 3max/3min 1D(?) mono option */
154 #endif /* NMFB > 0 */
155
156 #if NCFB > 0
157 cfb_probe, pm_mem_need, cfb_cold_init, /* 3max 1D(?) color option */
158 #endif /* NCFB > 0 */
159
160 #if NXCFB > 0
161 xcfb_probe, pm_mem_need, xcfb_cold_init,/* MAXine frame buffer */
162 #endif /* NXCFB > 0 */
163
164 #if NFB > 0
165 pm_probe, pm_mem_need, pm_cold_init, /* "pm" mono/color (pmax) */
166 #endif
167 0,
168 };
169
170 char *screen_data; /* opaque */
171
172 int screen_find()
173 {
174 struct screen_probe_vector *p = screen_probe_vector;
175 for (;p->probe; p++)
176 if ((*p->probe)()) {
177 (*p->setup)(0/*XXX*/, screen_data);
178 return 1;
179 }
180 return 0;
181 }
182
183 unsigned int
184 screen_memory_alloc(avail)
185 char *avail;
186 {
187 struct screen_probe_vector *p = screen_probe_vector;
188 int size;
189 for (; p->probe; p++)
190 if ((*p->probe) ()) {
191 screen_data = avail;
192 size = (*p->alloc) ();
193 bzero(screen_data, size);
194 return size;
195 }
196 return 0;
197
198 }
199
Cache object: edc0121aa596b0c1f3e8e2ea523a8f75
|