1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
/*
* Copyright 2009 Red Hat, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef MINITRU_H
#define MINITRU_H
#include <stdint.h>
struct mt_monitor;
extern struct mt_monitor *mt_create_monitor(void *block);
extern void mt_destroy_monitor(struct mt_monitor *monitor);
/*
* These happen to be the same as the xfree86 values, except for REDUCED
* which doesn't exist there. Not all of these are sensible anymore.
* Prune me before 1.0
*/
#define MT_FLAG_PHSYNC 0x00000001
#define MT_FLAG_NHSYNC 0x00000002
#define MT_FLAG_PVSYNC 0x00000004
#define MT_FLAG_NVSYNC 0x00000008
#define MT_FLAG_INTERLACED 0x00000010
#define MT_FLAG_DBLSCAN 0x00000020
#define MT_FLAG_CSYNC 0x00000040
#define MT_FLAG_PCSYNC 0x00000080
#define MT_FLAG_NCSYNC 0x00000100
#define MT_FLAG_HSKEW 0x00000200
#define MT_FLAG_BCAST 0x00000400
#define MT_FLAG_PIXMUX 0x00001000
#define MT_FLAG_DBLCLK 0x00002000
#define MT_FLAG_CLKDIV2 0x00004000
#define MT_FLAG_REDUCED 0x00008000
enum mt_status {
MT_MODE_OK,
};
struct mt_mode {
uint32_t type;
uint32_t status;
uint32_t clock;
uint32_t hdisplay;
uint32_t hsyncstart;
uint32_t hsyncend;
uint32_t htotal;
uint32_t hskew;
uint32_t vdisplay;
uint32_t vsyncstart;
uint32_t vsyncend;
uint32_t vtotal;
uint32_t vscan;
uint32_t flags;
void *next;
};
extern struct mt_mode *mt_monitor_mode_list(struct mt_monitor *monitor);
extern struct mt_mode *mt_dmt_mode_list(void);
extern struct mt_mode *mt_cvt_mode(uint32_t width, uint32_t height,
float refresh, uint32_t flags);
extern struct mt_mode *mt_gtf_mode(uint32_t width, uint32_t height,
float refresh, uint32_t flags);
extern float mt_mode_hsync(struct mt_mode *mode);
extern float mt_mode_vsync(struct mt_mode *mode);
extern uint32_t mt_mode_is_reduced_blanking(struct mt_mode *mode);
#endif
|