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