xref: /minix3/sys/dev/videomode/videomode.h (revision bdf33c702aa8bcb68ec6500058b7c9ee0fcddfe9)
1*bdf33c70SThomas Cort /*	$NetBSD: videomode.h,v 1.3 2011/04/09 18:22:31 jdc Exp $	*/
2*bdf33c70SThomas Cort 
3*bdf33c70SThomas Cort /*
4*bdf33c70SThomas Cort  * Copyright (c) 2001, 2002 Bang Jun-Young
5*bdf33c70SThomas Cort  * All rights reserved.
6*bdf33c70SThomas Cort  *
7*bdf33c70SThomas Cort  * Redistribution and use in source and binary forms, with or without
8*bdf33c70SThomas Cort  * modification, are permitted provided that the following conditions
9*bdf33c70SThomas Cort  * are met:
10*bdf33c70SThomas Cort  * 1. Redistributions of source code must retain the above copyright
11*bdf33c70SThomas Cort  *    notice, this list of conditions and the following disclaimer.
12*bdf33c70SThomas Cort  * 2. Redistributions in binary form must reproduce the above copyright
13*bdf33c70SThomas Cort  *    notice, this list of conditions and the following disclaimer in the
14*bdf33c70SThomas Cort  *    documentation and/or other materials provided with the distribution.
15*bdf33c70SThomas Cort  * 3. The name of the author may not be used to endorse or promote products
16*bdf33c70SThomas Cort  *    derived from this software without specific prior written permission.
17*bdf33c70SThomas Cort  *
18*bdf33c70SThomas Cort  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
19*bdf33c70SThomas Cort  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
20*bdf33c70SThomas Cort  * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
21*bdf33c70SThomas Cort  * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
22*bdf33c70SThomas Cort  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
23*bdf33c70SThomas Cort  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
24*bdf33c70SThomas Cort  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
25*bdf33c70SThomas Cort  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
26*bdf33c70SThomas Cort  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27*bdf33c70SThomas Cort  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
28*bdf33c70SThomas Cort  */
29*bdf33c70SThomas Cort 
30*bdf33c70SThomas Cort #ifndef _DEV_VIDEOMODE_H
31*bdf33c70SThomas Cort #define _DEV_VIDEOMODE_H
32*bdf33c70SThomas Cort 
33*bdf33c70SThomas Cort struct videomode {
34*bdf33c70SThomas Cort 	int dot_clock;		/* Dot clock frequency in kHz. */
35*bdf33c70SThomas Cort 	int hdisplay;
36*bdf33c70SThomas Cort 	int hsync_start;
37*bdf33c70SThomas Cort 	int hsync_end;
38*bdf33c70SThomas Cort 	int htotal;
39*bdf33c70SThomas Cort 	int vdisplay;
40*bdf33c70SThomas Cort 	int vsync_start;
41*bdf33c70SThomas Cort 	int vsync_end;
42*bdf33c70SThomas Cort 	int vtotal;
43*bdf33c70SThomas Cort 	int flags;		/* Video mode flags; see below. */
44*bdf33c70SThomas Cort 	const char *name;
45*bdf33c70SThomas Cort };
46*bdf33c70SThomas Cort 
47*bdf33c70SThomas Cort /*
48*bdf33c70SThomas Cort  * Video mode flags.
49*bdf33c70SThomas Cort  */
50*bdf33c70SThomas Cort 
51*bdf33c70SThomas Cort #define VID_PHSYNC	0x0001
52*bdf33c70SThomas Cort #define VID_NHSYNC	0x0002
53*bdf33c70SThomas Cort #define VID_PVSYNC	0x0004
54*bdf33c70SThomas Cort #define VID_NVSYNC	0x0008
55*bdf33c70SThomas Cort #define VID_INTERLACE	0x0010
56*bdf33c70SThomas Cort #define VID_DBLSCAN	0x0020
57*bdf33c70SThomas Cort #define VID_CSYNC	0x0040
58*bdf33c70SThomas Cort #define VID_PCSYNC	0x0080
59*bdf33c70SThomas Cort #define VID_NCSYNC	0x0100
60*bdf33c70SThomas Cort #define VID_HSKEW	0x0200
61*bdf33c70SThomas Cort #define VID_BCAST	0x0400
62*bdf33c70SThomas Cort #define VID_PIXMUX	0x1000
63*bdf33c70SThomas Cort #define VID_DBLCLK	0x2000
64*bdf33c70SThomas Cort #define VID_CLKDIV2	0x4000
65*bdf33c70SThomas Cort 
66*bdf33c70SThomas Cort extern const struct videomode videomode_list[];
67*bdf33c70SThomas Cort extern const int videomode_count;
68*bdf33c70SThomas Cort 
69*bdf33c70SThomas Cort const struct videomode *pick_mode_by_dotclock(int, int, int);
70*bdf33c70SThomas Cort const struct videomode *pick_mode_by_ref(int, int, int);
71*bdf33c70SThomas Cort void sort_modes(struct videomode *, struct videomode **, int);
72*bdf33c70SThomas Cort 
73*bdf33c70SThomas Cort #endif /* _DEV_VIDEOMODE_H */
74