xf86DDC.h revision a5e7ae69e440f6816420fc99599f044e79e716b6
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsync/* xf86DDC.h
cd41ce42a6251fb6086e4688bec5148970eed8d7vboxsync *
cd41ce42a6251fb6086e4688bec5148970eed8d7vboxsync * This file contains all information to interpret a standard EDIC block
cd41ce42a6251fb6086e4688bec5148970eed8d7vboxsync * transmitted by a display device via DDC (Display Data Channel). So far
13b74055eb6f4a737402e297e4488fcada856422vboxsync * there is no information to deal with optional EDID blocks.
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync * DDC is a Trademark of VESA (Video Electronics Standard Association).
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync *
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync */
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync#ifndef XF86_DDC_H
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync#define XF86_DDC_H
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync
c98fb3e16fcd571a790eab772c0c66173d225205vboxsync#include "edid.h"
13b74055eb6f4a737402e297e4488fcada856422vboxsync#include "xf86i2c.h"
cd41ce42a6251fb6086e4688bec5148970eed8d7vboxsync#include "xf86str.h"
cd41ce42a6251fb6086e4688bec5148970eed8d7vboxsync
cd41ce42a6251fb6086e4688bec5148970eed8d7vboxsync/* speed up / slow down */
13b74055eb6f4a737402e297e4488fcada856422vboxsynctypedef enum {
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_SLOW,
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_FAST
13b74055eb6f4a737402e297e4488fcada856422vboxsync} xf86ddcSpeed;
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsynctypedef void (*DDC1SetSpeedProc) (ScrnInfoPtr, xf86ddcSpeed);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT xf86MonPtr xf86DoEDID_DDC1(ScrnInfoPtr pScrn,
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC1SetSpeedProc DDC1SetSpeed,
13b74055eb6f4a737402e297e4488fcada856422vboxsync unsigned
13b74055eb6f4a737402e297e4488fcada856422vboxsync int (*DDC1Read) (ScrnInfoPtr)
13b74055eb6f4a737402e297e4488fcada856422vboxsync );
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT xf86MonPtr xf86DoEDID_DDC2(ScrnInfoPtr pScrn, I2CBusPtr pBus);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT xf86MonPtr xf86DoEEDID(ScrnInfoPtr pScrn, I2CBusPtr pBus, Bool);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT xf86MonPtr xf86PrintEDID(xf86MonPtr monPtr);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT xf86MonPtr xf86InterpretEDID(int screenIndex, Uchar * block);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT xf86MonPtr xf86InterpretEEDID(int screenIndex, Uchar * block);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT void
13b74055eb6f4a737402e297e4488fcada856422vboxsync xf86EdidMonitorSet(int scrnIndex, MonPtr Monitor, xf86MonPtr DDC);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT Bool xf86SetDDCproperties(ScrnInfoPtr pScreen, xf86MonPtr DDC);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT Bool
13b74055eb6f4a737402e297e4488fcada856422vboxsync xf86MonitorIsHDMI(xf86MonPtr mon);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT DisplayModePtr
13b74055eb6f4a737402e297e4488fcada856422vboxsyncFindDMTMode(int hsize, int vsize, int refresh, Bool rb);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncextern _X_EXPORT const DisplayModeRec DMTModes[];
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsync/*
13b74055eb6f4a737402e297e4488fcada856422vboxsync * Quirks to work around broken EDID data from various monitors.
13b74055eb6f4a737402e297e4488fcada856422vboxsync */
13b74055eb6f4a737402e297e4488fcada856422vboxsynctypedef enum {
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_NONE = 0,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* First detailed mode is bogus, prefer largest mode at 60hz */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_PREFER_LARGE_60 = 1 << 0,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* 135MHz clock is too high, drop a bit */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_135_CLOCK_TOO_HIGH = 1 << 1,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* Prefer the largest mode at 75 Hz */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_PREFER_LARGE_75 = 1 << 2,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* Convert detailed timing's horizontal from units of cm to mm */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_DETAILED_H_IN_CM = 1 << 3,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* Convert detailed timing's vertical from units of cm to mm */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_DETAILED_V_IN_CM = 1 << 4,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* Detailed timing descriptors have bogus size values, so just take the
13b74055eb6f4a737402e297e4488fcada856422vboxsync * maximum size and use that.
13b74055eb6f4a737402e297e4488fcada856422vboxsync */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_DETAILED_USE_MAXIMUM_SIZE = 1 << 5,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* Monitor forgot to set the first detailed is preferred bit. */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_FIRST_DETAILED_PREFERRED = 1 << 6,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* use +hsync +vsync for detailed mode */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_DETAILED_SYNC_PP = 1 << 7,
13b74055eb6f4a737402e297e4488fcada856422vboxsync /* Force single-link DVI bandwidth limit */
13b74055eb6f4a737402e297e4488fcada856422vboxsync DDC_QUIRK_DVI_SINGLE_LINK = 1 << 8,
13b74055eb6f4a737402e297e4488fcada856422vboxsync} ddc_quirk_t;
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsynctypedef void (*handle_detailed_fn) (struct detailed_monitor_section *, void *);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncvoid xf86ForEachDetailedBlock(xf86MonPtr mon, handle_detailed_fn, void *data);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncddc_quirk_t xf86DDCDetectQuirks(int scrnIndex, xf86MonPtr DDC, Bool verbose);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncvoid xf86DetTimingApplyQuirks(struct detailed_monitor_section *det_mon,
13b74055eb6f4a737402e297e4488fcada856422vboxsync ddc_quirk_t quirks, int hsize, int vsize);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsynctypedef void (*handle_video_fn) (struct cea_video_block *, void *);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncvoid xf86ForEachVideoBlock(xf86MonPtr, handle_video_fn, void *);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsyncstruct cea_data_block *xf86MonitorFindHDMIBlock(xf86MonPtr mon);
13b74055eb6f4a737402e297e4488fcada856422vboxsync
13b74055eb6f4a737402e297e4488fcada856422vboxsync#endif
13b74055eb6f4a737402e297e4488fcada856422vboxsync