Imported Upstream version 1.15.1
[deb_xorg-server.git] / hw / xfree86 / ddc / xf86DDC.h
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 <Egbert.Eich@Physik.TU-Darmstadt.DE>
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(ScrnInfoPtr pScrn,
28 DDC1SetSpeedProc DDC1SetSpeed,
29 unsigned
30 int (*DDC1Read) (ScrnInfoPtr)
31 );
32
33 extern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus);
34
35 extern _X_EXPORT xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool);
36
37 extern _X_EXPORT xf86MonPtr xf86PrintEDID(xf86MonPtr monPtr);
38
39 extern _X_EXPORT xf86MonPtr xf86InterpretEDID(int screenIndex, Uchar * block);
40
41 extern _X_EXPORT xf86MonPtr xf86InterpretEEDID(int screenIndex, Uchar * block);
42
43 extern _X_EXPORT void
44 xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC);
45
46 extern _X_EXPORT Bool xf86SetDDCproperties(ScrnInfoPtr pScreen, xf86MonPtr DDC);
47
48 extern _X_EXPORT Bool
49 xf86MonitorIsHDMI(xf86MonPtr mon);
50
51 extern _X_EXPORT xf86MonPtr xf86DoDisplayID(ScrnInfoPtr pScrn, I2CBusPtr pBus);
52
53 extern _X_EXPORT void
54 xf86DisplayIDMonitorSet(int scrnIndex, MonPtr mon, xf86MonPtr DDC);
55
56 extern _X_EXPORT DisplayModePtr
57 FindDMTMode(int hsize, int vsize, int refresh, Bool rb);
58
59 extern _X_EXPORT const DisplayModeRec DMTModes[];
60
61 /*
62 * Quirks to work around broken EDID data from various monitors.
63 */
64 typedef enum {
65 DDC_QUIRK_NONE = 0,
66 /* First detailed mode is bogus, prefer largest mode at 60hz */
67 DDC_QUIRK_PREFER_LARGE_60 = 1 << 0,
68 /* 135MHz clock is too high, drop a bit */
69 DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1,
70 /* Prefer the largest mode at 75 Hz */
71 DDC_QUIRK_PREFER_LARGE_75 = 1 << 2,
72 /* Convert detailed timing's horizontal from units of cm to mm */
73 DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3,
74 /* Convert detailed timing's vertical from units of cm to mm */
75 DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4,
76 /* Detailed timing descriptors have bogus size values, so just take the
77 * maximum size and use that.
78 */
79 DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5,
80 /* Monitor forgot to set the first detailed is preferred bit. */
81 DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6,
82 /* use +hsync +vsync for detailed mode */
83 DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7,
84 /* Force single-link DVI bandwidth limit */
85 DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8,
86 } ddc_quirk_t;
87
88 typedef void (*handle_detailed_fn) (struct detailed_monitor_section *, void *);
89
90 void xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn, void *data);
91
92 ddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
93
94 void xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
95 ddc_quirk_t quirks, int hsize, int vsize);
96
97 typedef void (*handle_video_fn) (struct cea_video_block *, void *);
98
99 void xf86ForEachVideoBlock(xf86MonPtr, handle_video_fn, void *);
100
101 #endif