edid.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * drivers/video/edid.h - EDID/DDC Header
  3. *
  4. * Based on:
  5. * 1. XFree86 4.3.0, edid.h
  6. * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
  7. *
  8. * 2. John Fremlin <vii@users.sourceforge.net> and
  9. * Ani Joshi <ajoshi@unixbox.com>
  10. *
  11. * DDC is a Trademark of VESA (Video Electronics Standard Association).
  12. *
  13. * This file is subject to the terms and conditions of the GNU General Public
  14. * License. See the file COPYING in the main directory of this archive
  15. * for more details.
  16. */
  17. #ifndef __EDID_H__
  18. #define __EDID_H__
  19. #define EDID_LENGTH 0x80
  20. #define EDID_HEADER 0x00
  21. #define EDID_HEADER_END 0x07
  22. #define ID_MANUFACTURER_NAME 0x08
  23. #define ID_MANUFACTURER_NAME_END 0x09
  24. #define ID_MODEL 0x0a
  25. #define ID_SERIAL_NUMBER 0x0c
  26. #define MANUFACTURE_WEEK 0x10
  27. #define MANUFACTURE_YEAR 0x11
  28. #define EDID_STRUCT_VERSION 0x12
  29. #define EDID_STRUCT_REVISION 0x13
  30. #define EDID_STRUCT_DISPLAY 0x14
  31. #define DPMS_FLAGS 0x18
  32. #define ESTABLISHED_TIMING_1 0x23
  33. #define ESTABLISHED_TIMING_2 0x24
  34. #define MANUFACTURERS_TIMINGS 0x25
  35. /* standard timings supported */
  36. #define STD_TIMING 8
  37. #define STD_TIMING_DESCRIPTION_SIZE 2
  38. #define STD_TIMING_DESCRIPTIONS_START 0x26
  39. #define DETAILED_TIMING_DESCRIPTIONS_START 0x36
  40. #define DETAILED_TIMING_DESCRIPTION_SIZE 18
  41. #define NO_DETAILED_TIMING_DESCRIPTIONS 4
  42. #define DETAILED_TIMING_DESCRIPTION_1 0x36
  43. #define DETAILED_TIMING_DESCRIPTION_2 0x48
  44. #define DETAILED_TIMING_DESCRIPTION_3 0x5a
  45. #define DETAILED_TIMING_DESCRIPTION_4 0x6c
  46. #define DESCRIPTOR_DATA 5
  47. #define UPPER_NIBBLE( x ) \
  48. (((128|64|32|16) & (x)) >> 4)
  49. #define LOWER_NIBBLE( x ) \
  50. ((1|2|4|8) & (x))
  51. #define COMBINE_HI_8LO( hi, lo ) \
  52. ( (((unsigned)hi) << 8) | (unsigned)lo )
  53. #define COMBINE_HI_4LO( hi, lo ) \
  54. ( (((unsigned)hi) << 4) | (unsigned)lo )
  55. #define PIXEL_CLOCK_LO (unsigned)block[ 0 ]
  56. #define PIXEL_CLOCK_HI (unsigned)block[ 1 ]
  57. #define PIXEL_CLOCK (COMBINE_HI_8LO( PIXEL_CLOCK_HI,PIXEL_CLOCK_LO )*10000)
  58. #define H_ACTIVE_LO (unsigned)block[ 2 ]
  59. #define H_BLANKING_LO (unsigned)block[ 3 ]
  60. #define H_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 4 ] )
  61. #define H_ACTIVE COMBINE_HI_8LO( H_ACTIVE_HI, H_ACTIVE_LO )
  62. #define H_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 4 ] )
  63. #define H_BLANKING COMBINE_HI_8LO( H_BLANKING_HI, H_BLANKING_LO )
  64. #define V_ACTIVE_LO (unsigned)block[ 5 ]
  65. #define V_BLANKING_LO (unsigned)block[ 6 ]
  66. #define V_ACTIVE_HI UPPER_NIBBLE( (unsigned)block[ 7 ] )
  67. #define V_ACTIVE COMBINE_HI_8LO( V_ACTIVE_HI, V_ACTIVE_LO )
  68. #define V_BLANKING_HI LOWER_NIBBLE( (unsigned)block[ 7 ] )
  69. #define V_BLANKING COMBINE_HI_8LO( V_BLANKING_HI, V_BLANKING_LO )
  70. #define H_SYNC_OFFSET_LO (unsigned)block[ 8 ]
  71. #define H_SYNC_WIDTH_LO (unsigned)block[ 9 ]
  72. #define V_SYNC_OFFSET_LO UPPER_NIBBLE( (unsigned)block[ 10 ] )
  73. #define V_SYNC_WIDTH_LO LOWER_NIBBLE( (unsigned)block[ 10 ] )
  74. #define V_SYNC_WIDTH_HI ((unsigned)block[ 11 ] & (1|2))
  75. #define V_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (4|8)) >> 2)
  76. #define H_SYNC_WIDTH_HI (((unsigned)block[ 11 ] & (16|32)) >> 4)
  77. #define H_SYNC_OFFSET_HI (((unsigned)block[ 11 ] & (64|128)) >> 6)
  78. #define V_SYNC_WIDTH COMBINE_HI_4LO( V_SYNC_WIDTH_HI, V_SYNC_WIDTH_LO )
  79. #define V_SYNC_OFFSET COMBINE_HI_4LO( V_SYNC_OFFSET_HI, V_SYNC_OFFSET_LO )
  80. #define H_SYNC_WIDTH COMBINE_HI_8LO( H_SYNC_WIDTH_HI, H_SYNC_WIDTH_LO )
  81. #define H_SYNC_OFFSET COMBINE_HI_8LO( H_SYNC_OFFSET_HI, H_SYNC_OFFSET_LO )
  82. #define H_SIZE_LO (unsigned)block[ 12 ]
  83. #define V_SIZE_LO (unsigned)block[ 13 ]
  84. #define H_SIZE_HI UPPER_NIBBLE( (unsigned)block[ 14 ] )
  85. #define V_SIZE_HI LOWER_NIBBLE( (unsigned)block[ 14 ] )
  86. #define H_SIZE COMBINE_HI_8LO( H_SIZE_HI, H_SIZE_LO )
  87. #define V_SIZE COMBINE_HI_8LO( V_SIZE_HI, V_SIZE_LO )
  88. #define H_BORDER (unsigned)block[ 15 ]
  89. #define V_BORDER (unsigned)block[ 16 ]
  90. #define FLAGS (unsigned)block[ 17 ]
  91. #define INTERLACED (FLAGS&128)
  92. #define SYNC_TYPE (FLAGS&3<<3) /* bits 4,3 */
  93. #define SYNC_SEPARATE (3<<3)
  94. #define HSYNC_POSITIVE (FLAGS & 4)
  95. #define VSYNC_POSITIVE (FLAGS & 2)
  96. #define V_MIN_RATE block[ 5 ]
  97. #define V_MAX_RATE block[ 6 ]
  98. #define H_MIN_RATE block[ 7 ]
  99. #define H_MAX_RATE block[ 8 ]
  100. #define MAX_PIXEL_CLOCK (((int)block[ 9 ]) * 10)
  101. #define GTF_SUPPORT block[10]
  102. #define DPMS_ACTIVE_OFF (1 << 5)
  103. #define DPMS_SUSPEND (1 << 6)
  104. #define DPMS_STANDBY (1 << 7)
  105. #endif /* __EDID_H__ */