Lines Matching +full:sense +full:- +full:mode
2 * linux/drivers/video/macmodes.c -- Standard MacOS video modes
6 * 2000 - Removal of OpenFirmware dependencies by:
7 * - Ani Joshi
8 * - Brad Douglas <brad@neruo.com>
10 * 2001 - Documented with DocBook
11 * - Brad Douglas <brad@neruo.com>
26 * MacOS video mode definitions
36 /* 512x384, 60Hz, Non-Interlaced (15.67 MHz dot clock) */
40 /* 640x480, 60 Hz, Non-Interlaced (25.175 MHz dotclock) */
44 /* 640x480, 67Hz, Non-Interlaced (30.0 MHz dotclock) */
48 /* 640x870, 75Hz (portrait), Non-Interlaced (57.28 MHz dot clock) */
52 /* 800x600, 56 Hz, Non-Interlaced (36.00 MHz dotclock) */
56 /* 800x600, 60 Hz, Non-Interlaced (40.00 MHz dotclock) */
60 /* 800x600, 72 Hz, Non-Interlaced (50.00 MHz dotclock) */
64 /* 800x600, 75 Hz, Non-Interlaced (49.50 MHz dotclock) */
68 /* 832x624, 75Hz, Non-Interlaced (57.6 MHz dotclock) */
72 /* 1024x768, 60 Hz, Non-Interlaced (65.00 MHz dotclock) */
76 /* 1024x768, 72 Hz, Non-Interlaced (75.00 MHz dotclock) */
80 /* 1024x768, 75 Hz, Non-Interlaced (78.75 MHz dotclock) */
84 /* 1024x768, 75 Hz, Non-Interlaced (78.75 MHz dotclock) */
88 /* 1152x870, 75 Hz, Non-Interlaced (100.0 MHz dotclock) */
92 /* 1280x960, 75 Hz, Non-Interlaced (126.00 MHz dotclock) */
96 /* 1280x1024, 75 Hz, Non-Interlaced (135.00 MHz dotclock) */
104 /* 1600x1024, 60 Hz, Non-Interlaced (112.27 MHz dotclock) */
133 * Mapping between MacOS video mode numbers and video mode definitions
136 * - increasing resolution
137 * - decreasing pixel clock period
142 const struct fb_videomode *mode; member
173 { -1, NULL }
178 * Mapping between monitor sense values and MacOS video mode numbers
182 int sense; member
193 { 0x603, VMODE_832_624_75 }, /* 12"-16" multiscan */
194 { 0x60b, VMODE_1024_768_70 }, /* 13"-19" multiscan */
195 { 0x623, VMODE_1152_870_75 }, /* 13"-21" multiscan */
203 { 0x73f, VMODE_640_480_67 }, /* no sense lines connected at all */
205 { -1, VMODE_640_480_60 }, /* catch-all, must be last */
209 * mac_vmode_to_var - converts vmode/cmode pair to var structure
210 * @vmode: MacOS video mode
211 * @cmode: MacOS color mode
212 * @var: frame buffer video mode structure
215 * mode structure.
223 const struct fb_videomode *mode = NULL; in mac_vmode_to_var() local
226 for (map = mac_modes; map->vmode != -1; map++) in mac_vmode_to_var()
227 if (map->vmode == vmode) { in mac_vmode_to_var()
228 mode = map->mode; in mac_vmode_to_var()
231 if (!mode) in mac_vmode_to_var()
232 return -EINVAL; in mac_vmode_to_var()
237 var->bits_per_pixel = 8; in mac_vmode_to_var()
238 var->red.offset = 0; in mac_vmode_to_var()
239 var->red.length = 8; in mac_vmode_to_var()
240 var->green.offset = 0; in mac_vmode_to_var()
241 var->green.length = 8; in mac_vmode_to_var()
242 var->blue.offset = 0; in mac_vmode_to_var()
243 var->blue.length = 8; in mac_vmode_to_var()
247 var->bits_per_pixel = 16; in mac_vmode_to_var()
248 var->red.offset = 10; in mac_vmode_to_var()
249 var->red.length = 5; in mac_vmode_to_var()
250 var->green.offset = 5; in mac_vmode_to_var()
251 var->green.length = 5; in mac_vmode_to_var()
252 var->blue.offset = 0; in mac_vmode_to_var()
253 var->blue.length = 5; in mac_vmode_to_var()
257 var->bits_per_pixel = 32; in mac_vmode_to_var()
258 var->red.offset = 16; in mac_vmode_to_var()
259 var->red.length = 8; in mac_vmode_to_var()
260 var->green.offset = 8; in mac_vmode_to_var()
261 var->green.length = 8; in mac_vmode_to_var()
262 var->blue.offset = 0; in mac_vmode_to_var()
263 var->blue.length = 8; in mac_vmode_to_var()
264 var->transp.offset = 24; in mac_vmode_to_var()
265 var->transp.length = 8; in mac_vmode_to_var()
269 return -EINVAL; in mac_vmode_to_var()
271 var->xres = mode->xres; in mac_vmode_to_var()
272 var->yres = mode->yres; in mac_vmode_to_var()
273 var->xres_virtual = mode->xres; in mac_vmode_to_var()
274 var->yres_virtual = mode->yres; in mac_vmode_to_var()
275 var->height = -1; in mac_vmode_to_var()
276 var->width = -1; in mac_vmode_to_var()
277 var->pixclock = mode->pixclock; in mac_vmode_to_var()
278 var->left_margin = mode->left_margin; in mac_vmode_to_var()
279 var->right_margin = mode->right_margin; in mac_vmode_to_var()
280 var->upper_margin = mode->upper_margin; in mac_vmode_to_var()
281 var->lower_margin = mode->lower_margin; in mac_vmode_to_var()
282 var->hsync_len = mode->hsync_len; in mac_vmode_to_var()
283 var->vsync_len = mode->vsync_len; in mac_vmode_to_var()
284 var->sync = mode->sync; in mac_vmode_to_var()
285 var->vmode = mode->vmode; in mac_vmode_to_var()
291 * mac_var_to_vmode - convert var structure to MacOS vmode/cmode pair
292 * @var: frame buffer video mode structure
293 * @vmode: MacOS video mode
294 * @cmode: MacOS color mode
296 * Converts a frame buffer video mode structure to a MacOS
308 if (var->bits_per_pixel <= 8) in mac_var_to_vmode()
310 else if (var->bits_per_pixel <= 16) in mac_var_to_vmode()
312 else if (var->bits_per_pixel <= 32) in mac_var_to_vmode()
315 return -EINVAL; in mac_var_to_vmode()
321 for (map = mac_modes; map->vmode != -1; map++) { in mac_var_to_vmode()
322 const struct fb_videomode *mode = map->mode; in mac_var_to_vmode() local
324 if (var->xres > mode->xres || var->yres > mode->yres) in mac_var_to_vmode()
326 if (var->xres_virtual > mode->xres || var->yres_virtual > mode->yres) in mac_var_to_vmode()
328 if (var->pixclock > mode->pixclock) in mac_var_to_vmode()
330 if ((var->vmode & FB_VMODE_MASK) != mode->vmode) in mac_var_to_vmode()
332 *vmode = map->vmode; in mac_var_to_vmode()
339 while (map->vmode != -1) { in mac_var_to_vmode()
340 const struct fb_videomode *clk_mode = map->mode; in mac_var_to_vmode()
342 if (mode->xres != clk_mode->xres || mode->yres != clk_mode->yres) in mac_var_to_vmode()
344 if (var->pixclock > mode->pixclock) in mac_var_to_vmode()
346 if (mode->vmode != clk_mode->vmode) in mac_var_to_vmode()
348 *vmode = map->vmode; in mac_var_to_vmode()
353 return -EINVAL; in mac_var_to_vmode()
357 * mac_map_monitor_sense - Convert monitor sense to vmode
358 * @sense: Macintosh monitor sense number
360 * Converts a Macintosh monitor sense number to a MacOS
363 * Returns MacOS vmode video mode number.
367 int mac_map_monitor_sense(int sense) in mac_map_monitor_sense() argument
371 for (map = mac_monitors; map->sense != -1; map++) in mac_map_monitor_sense()
372 if (map->sense == sense) in mac_map_monitor_sense()
374 return map->vmode; in mac_map_monitor_sense()
379 * mac_find_mode - find a video mode
382 * @mode_option: video mode name (see mac_modedb[])
385 * Finds a suitable video mode. Tries to set mode specified
386 * by @mode_option. If the name of the wanted mode begins with
387 * 'mac', the Mac video mode database will be used, otherwise it
388 * will fall back to the standard video mode database.