edid.S 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. /*
  2. edid.S: EDID data template
  3. Copyright (C) 2012 Carsten Emde <C.Emde@osadl.org>
  4. This program is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU General Public License
  6. as published by the Free Software Foundation; either version 2
  7. of the License, or (at your option) any later version.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with this program; if not, write to the Free Software
  14. Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  15. */
  16. /* Manufacturer */
  17. #define MFG_LNX1 'L'
  18. #define MFG_LNX2 'N'
  19. #define MFG_LNX3 'X'
  20. #define SERIAL 0
  21. #define YEAR 2012
  22. #define WEEK 5
  23. /* EDID 1.3 standard definitions */
  24. #define XY_RATIO_16_10 0b00
  25. #define XY_RATIO_4_3 0b01
  26. #define XY_RATIO_5_4 0b10
  27. #define XY_RATIO_16_9 0b11
  28. /* Provide defaults for the timing bits */
  29. #ifndef ESTABLISHED_TIMING1_BITS
  30. #define ESTABLISHED_TIMING1_BITS 0x00
  31. #endif
  32. #ifndef ESTABLISHED_TIMING2_BITS
  33. #define ESTABLISHED_TIMING2_BITS 0x00
  34. #endif
  35. #ifndef ESTABLISHED_TIMING3_BITS
  36. #define ESTABLISHED_TIMING3_BITS 0x00
  37. #endif
  38. #define mfgname2id(v1,v2,v3) \
  39. ((((v1-'@')&0x1f)<<10)+(((v2-'@')&0x1f)<<5)+((v3-'@')&0x1f))
  40. #define swap16(v1) ((v1>>8)+((v1&0xff)<<8))
  41. #define msbs2(v1,v2) ((((v1>>8)&0x0f)<<4)+((v2>>8)&0x0f))
  42. #define msbs4(v1,v2,v3,v4) \
  43. (((v1&0x03)>>2)+((v2&0x03)>>4)+((v3&0x03)>>6)+((v4&0x03)>>8))
  44. #define pixdpi2mm(pix,dpi) ((pix*25)/dpi)
  45. #define xsize pixdpi2mm(XPIX,DPI)
  46. #define ysize pixdpi2mm(YPIX,DPI)
  47. .data
  48. /* Fixed header pattern */
  49. header: .byte 0x00,0xff,0xff,0xff,0xff,0xff,0xff,0x00
  50. mfg_id: .word swap16(mfgname2id(MFG_LNX1, MFG_LNX2, MFG_LNX3))
  51. prod_code: .word 0
  52. /* Serial number. 32 bits, little endian. */
  53. serial_number: .long SERIAL
  54. /* Week of manufacture */
  55. week: .byte WEEK
  56. /* Year of manufacture, less 1990. (1990-2245)
  57. If week=255, it is the model year instead */
  58. year: .byte YEAR-1990
  59. version: .byte VERSION /* EDID version, usually 1 (for 1.3) */
  60. revision: .byte REVISION /* EDID revision, usually 3 (for 1.3) */
  61. /* If Bit 7=1 Digital input. If set, the following bit definitions apply:
  62. Bits 6-1 Reserved, must be 0
  63. Bit 0 Signal is compatible with VESA DFP 1.x TMDS CRGB,
  64. 1 pixel per clock, up to 8 bits per color, MSB aligned,
  65. If Bit 7=0 Analog input. If clear, the following bit definitions apply:
  66. Bits 6-5 Video white and sync levels, relative to blank
  67. 00=+0.7/-0.3 V; 01=+0.714/-0.286 V;
  68. 10=+1.0/-0.4 V; 11=+0.7/0 V
  69. Bit 4 Blank-to-black setup (pedestal) expected
  70. Bit 3 Separate sync supported
  71. Bit 2 Composite sync (on HSync) supported
  72. Bit 1 Sync on green supported
  73. Bit 0 VSync pulse must be serrated when somposite or
  74. sync-on-green is used. */
  75. video_parms: .byte 0x6d
  76. /* Maximum horizontal image size, in centimetres
  77. (max 292 cm/115 in at 16:9 aspect ratio) */
  78. max_hor_size: .byte xsize/10
  79. /* Maximum vertical image size, in centimetres.
  80. If either byte is 0, undefined (e.g. projector) */
  81. max_vert_size: .byte ysize/10
  82. /* Display gamma, minus 1, times 100 (range 1.00-3.5 */
  83. gamma: .byte 120
  84. /* Bit 7 DPMS standby supported
  85. Bit 6 DPMS suspend supported
  86. Bit 5 DPMS active-off supported
  87. Bits 4-3 Display type: 00=monochrome; 01=RGB colour;
  88. 10=non-RGB multicolour; 11=undefined
  89. Bit 2 Standard sRGB colour space. Bytes 25-34 must contain
  90. sRGB standard values.
  91. Bit 1 Preferred timing mode specified in descriptor block 1.
  92. Bit 0 GTF supported with default parameter values. */
  93. dsp_features: .byte 0xea
  94. /* Chromaticity coordinates. */
  95. /* Red and green least-significant bits
  96. Bits 7-6 Red x value least-significant 2 bits
  97. Bits 5-4 Red y value least-significant 2 bits
  98. Bits 3-2 Green x value lst-significant 2 bits
  99. Bits 1-0 Green y value least-significant 2 bits */
  100. red_green_lsb: .byte 0x5e
  101. /* Blue and white least-significant 2 bits */
  102. blue_white_lsb: .byte 0xc0
  103. /* Red x value most significant 8 bits.
  104. 0-255 encodes 0-0.996 (255/256); 0-0.999 (1023/1024) with lsbits */
  105. red_x_msb: .byte 0xa4
  106. /* Red y value most significant 8 bits */
  107. red_y_msb: .byte 0x59
  108. /* Green x and y value most significant 8 bits */
  109. green_x_y_msb: .byte 0x4a,0x98
  110. /* Blue x and y value most significant 8 bits */
  111. blue_x_y_msb: .byte 0x25,0x20
  112. /* Default white point x and y value most significant 8 bits */
  113. white_x_y_msb: .byte 0x50,0x54
  114. /* Established timings */
  115. /* Bit 7 720x400 @ 70 Hz
  116. Bit 6 720x400 @ 88 Hz
  117. Bit 5 640x480 @ 60 Hz
  118. Bit 4 640x480 @ 67 Hz
  119. Bit 3 640x480 @ 72 Hz
  120. Bit 2 640x480 @ 75 Hz
  121. Bit 1 800x600 @ 56 Hz
  122. Bit 0 800x600 @ 60 Hz */
  123. estbl_timing1: .byte ESTABLISHED_TIMING1_BITS
  124. /* Bit 7 800x600 @ 72 Hz
  125. Bit 6 800x600 @ 75 Hz
  126. Bit 5 832x624 @ 75 Hz
  127. Bit 4 1024x768 @ 87 Hz, interlaced (1024x768)
  128. Bit 3 1024x768 @ 60 Hz
  129. Bit 2 1024x768 @ 72 Hz
  130. Bit 1 1024x768 @ 75 Hz
  131. Bit 0 1280x1024 @ 75 Hz */
  132. estbl_timing2: .byte ESTABLISHED_TIMING2_BITS
  133. /* Bit 7 1152x870 @ 75 Hz (Apple Macintosh II)
  134. Bits 6-0 Other manufacturer-specific display mod */
  135. estbl_timing3: .byte ESTABLISHED_TIMING3_BITS
  136. /* Standard timing */
  137. /* X resolution, less 31, divided by 8 (256-2288 pixels) */
  138. std_xres: .byte (XPIX/8)-31
  139. /* Y resolution, X:Y pixel ratio
  140. Bits 7-6 X:Y pixel ratio: 00=16:10; 01=4:3; 10=5:4; 11=16:9.
  141. Bits 5-0 Vertical frequency, less 60 (60-123 Hz) */
  142. std_vres: .byte (XY_RATIO<<6)+VFREQ-60
  143. .fill 7,2,0x0101 /* Unused */
  144. descriptor1:
  145. /* Pixel clock in 10 kHz units. (0.-655.35 MHz, little-endian) */
  146. clock: .word CLOCK/10
  147. /* Horizontal active pixels 8 lsbits (0-4095) */
  148. x_act_lsb: .byte XPIX&0xff
  149. /* Horizontal blanking pixels 8 lsbits (0-4095)
  150. End of active to start of next active. */
  151. x_blk_lsb: .byte XBLANK&0xff
  152. /* Bits 7-4 Horizontal active pixels 4 msbits
  153. Bits 3-0 Horizontal blanking pixels 4 msbits */
  154. x_msbs: .byte msbs2(XPIX,XBLANK)
  155. /* Vertical active lines 8 lsbits (0-4095) */
  156. y_act_lsb: .byte YPIX&0xff
  157. /* Vertical blanking lines 8 lsbits (0-4095) */
  158. y_blk_lsb: .byte YBLANK&0xff
  159. /* Bits 7-4 Vertical active lines 4 msbits
  160. Bits 3-0 Vertical blanking lines 4 msbits */
  161. y_msbs: .byte msbs2(YPIX,YBLANK)
  162. /* Horizontal sync offset pixels 8 lsbits (0-1023) From blanking start */
  163. x_snc_off_lsb: .byte XOFFSET&0xff
  164. /* Horizontal sync pulse width pixels 8 lsbits (0-1023) */
  165. x_snc_pls_lsb: .byte XPULSE&0xff
  166. /* Bits 7-4 Vertical sync offset lines 4 lsbits -63)
  167. Bits 3-0 Vertical sync pulse width lines 4 lsbits -63) */
  168. y_snc_lsb: .byte ((YOFFSET-63)<<4)+(YPULSE-63)
  169. /* Bits 7-6 Horizontal sync offset pixels 2 msbits
  170. Bits 5-4 Horizontal sync pulse width pixels 2 msbits
  171. Bits 3-2 Vertical sync offset lines 2 msbits
  172. Bits 1-0 Vertical sync pulse width lines 2 msbits */
  173. xy_snc_msbs: .byte msbs4(XOFFSET,XPULSE,YOFFSET,YPULSE)
  174. /* Horizontal display size, mm, 8 lsbits (0-4095 mm, 161 in) */
  175. x_dsp_size: .byte xsize&0xff
  176. /* Vertical display size, mm, 8 lsbits (0-4095 mm, 161 in) */
  177. y_dsp_size: .byte ysize&0xff
  178. /* Bits 7-4 Horizontal display size, mm, 4 msbits
  179. Bits 3-0 Vertical display size, mm, 4 msbits */
  180. dsp_size_mbsb: .byte msbs2(xsize,ysize)
  181. /* Horizontal border pixels (each side; total is twice this) */
  182. x_border: .byte 0
  183. /* Vertical border lines (each side; total is twice this) */
  184. y_border: .byte 0
  185. /* Bit 7 Interlaced
  186. Bits 6-5 Stereo mode: 00=No stereo; other values depend on bit 0:
  187. Bit 0=0: 01=Field sequential, sync=1 during right; 10=similar,
  188. sync=1 during left; 11=4-way interleaved stereo
  189. Bit 0=1 2-way interleaved stereo: 01=Right image on even lines;
  190. 10=Left image on even lines; 11=side-by-side
  191. Bits 4-3 Sync type: 00=Analog composite; 01=Bipolar analog composite;
  192. 10=Digital composite (on HSync); 11=Digital separate
  193. Bit 2 If digital separate: Vertical sync polarity (1=positive)
  194. Other types: VSync serrated (HSync during VSync)
  195. Bit 1 If analog sync: Sync on all 3 RGB lines (else green only)
  196. Digital: HSync polarity (1=positive)
  197. Bit 0 2-way line-interleaved stereo, if bits 4-3 are not 00. */
  198. features: .byte 0x18+(VSYNC_POL<<2)+(HSYNC_POL<<1)
  199. descriptor2: .byte 0,0 /* Not a detailed timing descriptor */
  200. .byte 0 /* Must be zero */
  201. .byte 0xff /* Descriptor is monitor serial number (text) */
  202. .byte 0 /* Must be zero */
  203. start1: .ascii "Linux #0"
  204. end1: .byte 0x0a /* End marker */
  205. .fill 12-(end1-start1), 1, 0x20 /* Padded spaces */
  206. descriptor3: .byte 0,0 /* Not a detailed timing descriptor */
  207. .byte 0 /* Must be zero */
  208. .byte 0xfd /* Descriptor is monitor range limits */
  209. .byte 0 /* Must be zero */
  210. start2: .byte VFREQ-1 /* Minimum vertical field rate (1-255 Hz) */
  211. .byte VFREQ+1 /* Maximum vertical field rate (1-255 Hz) */
  212. .byte (CLOCK/(XPIX+XBLANK))-1 /* Minimum horizontal line rate
  213. (1-255 kHz) */
  214. .byte (CLOCK/(XPIX+XBLANK))+1 /* Maximum horizontal line rate
  215. (1-255 kHz) */
  216. .byte (CLOCK/10000)+1 /* Maximum pixel clock rate, rounded up
  217. to 10 MHz multiple (10-2550 MHz) */
  218. .byte 0 /* No extended timing information type */
  219. end2: .byte 0x0a /* End marker */
  220. .fill 12-(end2-start2), 1, 0x20 /* Padded spaces */
  221. descriptor4: .byte 0,0 /* Not a detailed timing descriptor */
  222. .byte 0 /* Must be zero */
  223. .byte 0xfc /* Descriptor is text */
  224. .byte 0 /* Must be zero */
  225. start3: .ascii TIMING_NAME
  226. end3: .byte 0x0a /* End marker */
  227. .fill 12-(end3-start3), 1, 0x20 /* Padded spaces */
  228. extensions: .byte 0 /* Number of extensions to follow */
  229. checksum: .byte CRC /* Sum of all bytes must be 0 */