vdif.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
0N/A/* $XFree86: xc/programs/Xserver/hw/xfree86/ddc/vdif.h,v 1.4tsi Exp $ */
2362N/A
0N/A#ifndef _VDIF_H
0N/A#define _VDIF_H
0N/A
0N/A#define VDIF_MONITOR_MONOCHROME 0
0N/A#define VDIF_MONITOR_COLOR 1
0N/A#define VDIF_VIDEO_TTL 0
0N/A#define VDIF_VIDEO_ANALOG 1
0N/A#define VDIF_VIDEO_ECL 2
0N/A#define VDIF_VIDEO_DECL 3
0N/A#define VDIF_VIDEO_OTHER 4
0N/A#define VDIF_SYNC_SEPARATE 0
0N/A#define VDIF_SYNC_C 1
0N/A#define VDIF_SYNC_CP 2
0N/A#define VDIF_SYNC_G 3
0N/A#define VDIF_SYNC_GP 4
0N/A#define VDIF_SYNC_OTHER 5
2362N/A#define VDIF_SCAN_NONINTERLACED 0
2362N/A#define VDIF_SCAN_INTERLACED 1
2362N/A#define VDIF_SCAN_OTHER 2
0N/A#define VDIF_POLARITY_NEGATIVE 0
0N/A#define VDIF_POLARITY_POSITIVE 1
0N/A
0N/A#include <X11/Xmd.h>
0N/A
0N/A#undef CARD32
0N/A#define CARD32 unsigned int /* ... on all supported platforms */
0N/A
0N/Atypedef struct _VDIF { /* Monitor Description: */
0N/A CARD8 VDIFId[4]; /* alway "VDIF" */
0N/A CARD32 FileLength; /* lenght of the whole file */
0N/A CARD32 Checksum; /* sum of all bytes in the file after*/
0N/A /* this field */
0N/A CARD16 VDIFVersion; /* structure version number */
0N/A CARD16 VDIFRevision; /* structure revision number */
0N/A CARD16 Date[3]; /* file date Year/Month/Day */
0N/A CARD16 DateManufactured[3]; /* date Year/Month/Day */
0N/A CARD32 FileRevision; /* file revision string */
0N/A CARD32 Manufacturer; /* ASCII ID of the manufacturer */
0N/A CARD32 ModelNumber; /* ASCII ID of the model */
0N/A CARD32 MinVDIFIndex; /* ASCII ID of Minimum VDIF index */
0N/A CARD32 Version; /* ASCII ID of the model version */
0N/A CARD32 SerialNumber; /* ASCII ID of the serial number */
0N/A CARD8 MonitorType; /* Monochrome or Color */
0N/A CARD8 CRTSize; /* inches */
0N/A CARD8 BorderRed; /* percent */
0N/A CARD8 BorderGreen; /* percent */
0N/A CARD8 BorderBlue; /* percent */
0N/A CARD8 Reserved1; /* padding */
0N/A CARD16 Reserved2; /* padding */
0N/A CARD32 RedPhosphorDecay; /* microseconds */
0N/A CARD32 GreenPhosphorDecay; /* microseconds */
0N/A CARD32 BluePhosphorDecay; /* microseconds */
0N/A CARD16 WhitePoint_x; /* WhitePoint in CIExyY (scale 1000) */
0N/A CARD16 WhitePoint_y;
0N/A CARD16 WhitePoint_Y;
0N/A CARD16 RedChromaticity_x; /* Red chromaticity in x,y */
0N/A CARD16 RedChromaticity_y;
0N/A CARD16 GreenChromaticity_x; /* Green chromaticity in x,y */
0N/A CARD16 GreenChromaticity_y;
0N/A CARD16 BlueChromaticity_x; /* Blue chromaticity in x,y */
0N/A CARD16 BlueChromaticity_y;
0N/A CARD16 RedGamma; /* Gamme curve exponent (scale 1000) */
0N/A CARD16 GreenGamma;
0N/A CARD16 BlueGamma;
0N/A CARD32 NumberOperationalLimits;
0N/A CARD32 OffsetOperationalLimits;
0N/A CARD32 NumberOptions; /* optinal sections (gamma table) */
0N/A CARD32 OffsetOptions;
0N/A CARD32 OffsetStringTable;
0N/A} xf86VdifRec, *xf86VdifPtr;
0N/A
0N/Atypedef enum { /* Tags for section identification */
0N/A VDIF_OPERATIONAL_LIMITS_TAG = 1,
0N/A VDIF_PREADJUSTED_TIMING_TAG,
0N/A VDIF_GAMMA_TABLE_TAG
0N/A} VDIFScnTag;
0N/A
0N/Atypedef struct _VDIFScnHdr { /* Generic Section Header: */
0N/A CARD32 ScnLength; /* lenght of section */
0N/A CARD32 ScnTag; /* tag for section identification */
0N/A} VDIFScnHdrRec, *VDIFScnHdrPtr;
0N/A
0N/Atypedef struct _VDIFLimits { /* Operational Limits: */
0N/A VDIFScnHdrRec Header; /* common section info */
0N/A CARD16 MaxHorPixel; /* pixels */
0N/A CARD16 MaxVerPixel; /* lines */
0N/A CARD16 MaxHorActiveLength; /* millimeters */
0N/A CARD16 MaxVerActiveHeight; /* millimeters */
0N/A CARD8 VideoType; /* TTL / Analog / ECL / DECL */
0N/A CARD8 SyncType; /* TTL / Analog / ECL / DECL */
0N/A CARD8 SyncConfiguration; /* separate / composite / other */
0N/A CARD8 Reserved1; /* padding */
0N/A CARD16 Reserved2; /* padding */
0N/A CARD16 TerminationResistance; /* */
0N/A CARD16 WhiteLevel; /* millivolts */
0N/A CARD16 BlackLevel; /* millivolts */
0N/A CARD16 BlankLevel; /* millivolts */
0N/A CARD16 SyncLevel; /* millivolts */
0N/A CARD32 MaxPixelClock; /* kiloHertz */
0N/A CARD32 MinHorFrequency; /* Hertz */
0N/A CARD32 MaxHorFrequency; /* Hertz */
0N/A CARD32 MinVerFrequency; /* milliHertz */
0N/A CARD32 MaxVerFrequency; /* milliHertz */
0N/A CARD16 MinHorRetrace; /* nanoseconds */
0N/A CARD16 MinVerRetrace; /* microseconds */
0N/A CARD32 NumberPreadjustedTimings;
0N/A CARD32 OffsetNextLimits;
0N/A} xf86VdifLimitsRec, *xf86VdifLimitsPtr;
0N/A
0N/Atypedef struct _VDIFTiming { /* Preadjusted Timing: */
0N/A VDIFScnHdrRec Header; /* common section info */
0N/A CARD32 PreadjustedTimingName; /* SVGA/SVPMI mode number */
0N/A CARD16 HorPixel; /* pixels */
0N/A CARD16 VerPixel; /* lines */
0N/A CARD16 HorAddrLength; /* millimeters */
0N/A CARD16 VerAddrHeight; /* millimeters */
0N/A CARD8 PixelWidthRatio; /* gives H:V */
0N/A CARD8 PixelHeightRatio;
0N/A CARD8 Reserved1; /* padding */
0N/A CARD8 ScanType; /* noninterlaced / interlaced / other*/
0N/A CARD8 HorSyncPolarity; /* negative / positive */
0N/A CARD8 VerSyncPolarity; /* negative / positive */
0N/A CARD16 CharacterWidth; /* pixels */
0N/A CARD32 PixelClock; /* kiloHertz */
0N/A CARD32 HorFrequency; /* Hertz */
0N/A CARD32 VerFrequency; /* milliHertz */
0N/A CARD32 HorTotalTime; /* nanoseconds */
0N/A CARD32 VerTotalTime; /* microseconds */
0N/A CARD16 HorAddrTime; /* nanoseconds */
0N/A CARD16 HorBlankStart; /* nanoseconds */
0N/A CARD16 HorBlankTime; /* nanoseconds */
0N/A CARD16 HorSyncStart; /* nanoseconds */
0N/A CARD16 HorSyncTime; /* nanoseconds */
0N/A CARD16 VerAddrTime; /* microseconds */
0N/A CARD16 VerBlankStart; /* microseconds */
0N/A CARD16 VerBlankTime; /* microseconds */
0N/A CARD16 VerSyncStart; /* microseconds */
0N/A CARD16 VerSyncTime; /* microseconds */
0N/A} xf86VdifTimingRec, *xf86VdifTimingPtr;
0N/A
0N/Atypedef struct _VDIFGamma { /* Gamma Table: */
0N/A VDIFScnHdrRec Header; /* common section info */
0N/A CARD16 GammaTableEntries; /* count of grays or RGB 3-tuples */
0N/A CARD16 Unused1;
0N/A} xf86VdifGammaRec, *xf86VdifGammaPtr;
0N/A
0N/A/* access macros */
0N/A#define VDIF_OPERATIONAL_LIMITS(vdif) \
0N/A((xf86VdifLimitsPtr)((char*)(vdif) + (vdif)->OffsetOperationalLimits))
0N/A#define VDIF_NEXT_OPERATIONAL_LIMITS(limits) limits = \
0N/A ((xf86VdifLimitsPtr)((char*)(limits) + (limits)->OffsetNextLimits))
0N/A#define VDIF_PREADJUSTED_TIMING(limits) \
0N/A((xf86VdifTimingPtr)((char*)(limits) + (limits)->Header.ScnLength))
0N/A#define VDIF_NEXT_PREADJUSTED_TIMING(timing) timing = \
0N/A ((xf86VdifTimingPtr)((char*)(timing) + (timing)->Header.ScnLength))
0N/A#define VDIF_OPTIONS(vdif) \
0N/A ((VDIFScnHdrPtr)((char*)(vdif) + (vdif)->OffsetOptions))
0N/A#define VDIF_NEXT_OPTIONS(options) options = \
0N/A ((xf86VdifGammaPtr)((char*)(options) + (options)->Header.ScnLength))
0N/A#define VDIF_STRING(vdif, string) \
0N/A ((char*)((char*)vdif + vdif->OffsetStringTable + (string)))
0N/A
0N/Atypedef struct _vdif {
0N/A xf86VdifPtr vdif;
0N/A xf86VdifLimitsPtr *limits;
0N/A xf86VdifTimingPtr *timings;
0N/A xf86VdifGammaPtr *gamma;
0N/A char * strings;
0N/A} xf86vdif, *xf86vdifPtr;
0N/A
0N/A#undef CARD32
0N/A
0N/A#endif
0N/A