1 |
|
---|
2 | /* xf86DDC.h
|
---|
3 | *
|
---|
4 | * This file contains all information to interpret a standard EDIC block
|
---|
5 | * transmitted by a display device via DDC (Display Data Channel). So far
|
---|
6 | * there is no information to deal with optional EDID blocks.
|
---|
7 | * DDC is a Trademark of VESA (Video Electronics Standard Association).
|
---|
8 | *
|
---|
9 | * Copyright 1998 by Egbert Eich <[email protected]>
|
---|
10 | */
|
---|
11 |
|
---|
12 | #ifndef XF86_DDC_H
|
---|
13 | # define XF86_DDC_H
|
---|
14 |
|
---|
15 | #include "edid.h"
|
---|
16 | #include "xf86i2c.h"
|
---|
17 | #include "xf86str.h"
|
---|
18 |
|
---|
19 | /* speed up / slow down */
|
---|
20 | typedef enum {
|
---|
21 | DDC_SLOW,
|
---|
22 | DDC_FAST
|
---|
23 | } xf86ddcSpeed;
|
---|
24 |
|
---|
25 | typedef void (* DDC1SetSpeedProc)(ScrnInfoPtr, xf86ddcSpeed);
|
---|
26 |
|
---|
27 | extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(
|
---|
28 | int scrnIndex,
|
---|
29 | DDC1SetSpeedProc DDC1SetSpeed,
|
---|
30 | unsigned int (*DDC1Read)(ScrnInfoPtr)
|
---|
31 | );
|
---|
32 |
|
---|
33 | extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(
|
---|
34 | int scrnIndex,
|
---|
35 | I2CBusPtr pBus
|
---|
36 | );
|
---|
37 |
|
---|
38 | extern _X_EXPORT xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool);
|
---|
39 |
|
---|
40 | extern _X_EXPORT xf86MonPtr xf86PrintEDID(
|
---|
41 | xf86MonPtr monPtr
|
---|
42 | );
|
---|
43 |
|
---|
44 | extern _X_EXPORT xf86MonPtr xf86InterpretEDID(
|
---|
45 | int screenIndex, Uchar *block
|
---|
46 | );
|
---|
47 |
|
---|
48 | extern _X_EXPORT xf86MonPtr xf86InterpretEEDID(
|
---|
49 | int screenIndex, Uchar *block
|
---|
50 | );
|
---|
51 |
|
---|
52 | extern _X_EXPORT void
|
---|
53 | xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC);
|
---|
54 |
|
---|
55 | extern _X_EXPORT Bool xf86SetDDCproperties(
|
---|
56 | ScrnInfoPtr pScreen,
|
---|
57 | xf86MonPtr DDC
|
---|
58 | );
|
---|
59 |
|
---|
60 | extern _X_EXPORT DisplayModePtr xf86DDCGetModes(int scrnIndex, xf86MonPtr DDC);
|
---|
61 |
|
---|
62 | extern _X_EXPORT Bool
|
---|
63 | xf86MonitorIsHDMI(xf86MonPtr mon);
|
---|
64 |
|
---|
65 | extern _X_EXPORT xf86MonPtr
|
---|
66 | xf86DoDisplayID(int scrnIndex, I2CBusPtr pBus);
|
---|
67 |
|
---|
68 | extern _X_EXPORT void
|
---|
69 | xf86DisplayIDMonitorSet(int scrnIndex, MonPtr mon, xf86MonPtr DDC);
|
---|
70 |
|
---|
71 | extern _X_EXPORT DisplayModePtr
|
---|
72 | FindDMTMode(int hsize, int vsize, int refresh, Bool rb);
|
---|
73 |
|
---|
74 | extern _X_EXPORT const DisplayModeRec DMTModes[];
|
---|
75 |
|
---|
76 | /*
|
---|
77 | * Quirks to work around broken EDID data from various monitors.
|
---|
78 | */
|
---|
79 | typedef enum {
|
---|
80 | DDC_QUIRK_NONE = 0,
|
---|
81 | /* First detailed mode is bogus, prefer largest mode at 60hz */
|
---|
82 | DDC_QUIRK_PREFER_LARGE_60 = 1 << 0,
|
---|
83 | /* 135MHz clock is too high, drop a bit */
|
---|
84 | DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1,
|
---|
85 | /* Prefer the largest mode at 75 Hz */
|
---|
86 | DDC_QUIRK_PREFER_LARGE_75 = 1 << 2,
|
---|
87 | /* Convert detailed timing's horizontal from units of cm to mm */
|
---|
88 | DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3,
|
---|
89 | /* Convert detailed timing's vertical from units of cm to mm */
|
---|
90 | DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4,
|
---|
91 | /* Detailed timing descriptors have bogus size values, so just take the
|
---|
92 | * maximum size and use that.
|
---|
93 | */
|
---|
94 | DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5,
|
---|
95 | /* Monitor forgot to set the first detailed is preferred bit. */
|
---|
96 | DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6,
|
---|
97 | /* use +hsync +vsync for detailed mode */
|
---|
98 | DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7,
|
---|
99 | /* Force single-link DVI bandwidth limit */
|
---|
100 | DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8,
|
---|
101 | } ddc_quirk_t;
|
---|
102 |
|
---|
103 | typedef void (* handle_detailed_fn)(struct detailed_monitor_section *,void *);
|
---|
104 |
|
---|
105 | void xf86ForEachDetailedBlock(xf86MonPtr mon,
|
---|
106 | handle_detailed_fn,
|
---|
107 | void *data);
|
---|
108 |
|
---|
109 | ddc_quirk_t
|
---|
110 | xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
|
---|
111 |
|
---|
112 | void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
|
---|
113 | ddc_quirk_t quirks, int hsize, int vsize);
|
---|
114 |
|
---|
115 | typedef void (* handle_video_fn)(struct cea_video_block *, void *);
|
---|
116 |
|
---|
117 | void xf86ForEachVideoBlock(xf86MonPtr,
|
---|
118 | handle_video_fn,
|
---|
119 | void *);
|
---|
120 |
|
---|
121 | #endif
|
---|