1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
|
/*
SiI8348 Linux Driver
Copyright (C) 2013 Silicon Image, Inc.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation version 2.
This program is distributed AS-IS WITHOUT ANY WARRANTY of any
kind, whether express or implied; INCLUDING without the implied warranty
of MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE or NON-INFRINGEMENT. See
the GNU General Public License for more details at http://www.gnu.org/licenses/gpl-2.0.html.
*/
#if !defined(SI_EDID_H)
#define SI_EDID_H
SI_PUSH_STRUCT_PACKING //(
typedef struct SI_PACK_THIS_STRUCT _TwoBytes_t
{
unsigned char low;
unsigned char high;
}TwoBytes_t,*PTwoBytes_t;
#define EDID_EXTENSION_TAG 0x02
#define EDID_EXTENSION_BLOCK_MAP 0xF0
#define EDID_REV_THREE 0x03
//#define LONG_DESCR_LEN 18
#define EDID_BLOCK_0 0x00
#define EDID_BLOCK_2_3 0x01
//#define EDID_BLOCK_0_OFFSET 0x0000
typedef enum
{
DBTC_TERMINATOR = 0
,DBTC_AUDIO_DATA_BLOCK = 1
,DBTC_VIDEO_DATA_BLOCK = 2
,DBTC_VENDOR_SPECIFIC_DATA_BLOCK = 3
,DBTC_SPEAKER_ALLOCATION_DATA_BLOCK = 4
,DBTC_VESA_DTC_DATA_BLOCK = 5
//reserved = 6
,DBTC_USE_EXTENDED_TAG = 7
}data_block_tag_code_e;
typedef struct SI_PACK_THIS_STRUCT _data_block_header_fields_t
{
uint8_t length_following_header:5;
data_block_tag_code_e tag_code:3;
}data_block_header_fields_t,*Pdata_block_header_fields_t;
typedef union SI_PACK_THIS_STRUCT _data_block_header_byte_t
{
data_block_header_fields_t fields;
uint8_t as_byte;
}data_block_header_byte_t,*Pdata_block_header_byte_t;
typedef enum
{
ETC_VIDEO_CAPABILITY_DATA_BLOCK = 0
,ETC_VENDOR_SPECIFIC_VIDEO_DATA_BLOCK = 1
,ETC_VESA_VIDEO_DISPLAY_DEVICE_INFORMATION_DATA_BLOCK = 2
,ETC_VESA_VIDEO_DATA_BLOCK = 3
,ETC_HDMI_VIDEO_DATA_BLOCK = 4
,ETC_COLORIMETRY_DATA_BLOCK = 5
,ETC_VIDEO_RELATED = 6
,ETC_CEA_MISC_AUDIO_FIELDS = 16
,ETC_VENDOR_SPECIFIC_AUDIO_DATA_BLOCK = 17
,ETC_HDMI_AUDIO_DATA_BLOCK = 18
,ETC_AUDIO_RELATED = 19
,ETC_GENERAL = 32
}extended_tag_code_e;
typedef struct SI_PACK_THIS_STRUCT _extended_tag_code_t
{
extended_tag_code_e etc:8;
}extended_tag_code_t,*Pextended_tag_code_t;
typedef struct SI_PACK_THIS_STRUCT _cea_short_descriptor_t
{
unsigned char VIC:7;
unsigned char native:1;
}cea_short_descriptor_t,*Pcea_short_descriptor_t;
typedef struct SI_PACK_THIS_STRUCT _MHL_short_desc_t
{
cea_short_descriptor_t cea_short_desc;
MHL2_video_descriptor_t mhl_vid_desc;
}MHL_short_desc_t,*PMHL_short_desc_t;
typedef struct SI_PACK_THIS_STRUCT _video_data_block_t
{
data_block_header_byte_t header;
cea_short_descriptor_t short_descriptors[1];//open ended
}video_data_block_t,*p_video_data_block_t;
typedef enum
{
// reserved = 0
afd_linear_PCM_IEC60958 = 1
,afd_AC3 = 2
,afd_MPEG1_layers_1_2 = 3
,afd_MPEG1_layer_3 = 4
,afdMPEG2_MultiChannel = 5
,afd_AAC = 6
,afd_DTS = 7
,afd_ATRAC = 8
,afd_one_bit_audio = 9
,afd_dolby_digital = 10
,afd_DTS_HD = 11
,afd_MAT_MLP = 12
,afd_DST = 13
,afd_WMA_Pro = 14
//reserved = 15
}AudioFormatCodes_e;
typedef struct SI_PACK_THIS_STRUCT _CEA_short_audio_descriptor_t
{
unsigned char max_channels_minus_one :3;
AudioFormatCodes_e audio_format_code :4;
unsigned char F17 :1;
unsigned char freq_32_Khz :1;
unsigned char freq_44_1_KHz :1;
unsigned char freq_48_KHz :1;
unsigned char freq_88_2_KHz :1;
unsigned char freq_96_KHz :1;
unsigned char freq_176_4_KHz:1;
unsigned char freq_192_KHz :1;
unsigned char F27 :1;
union
{
struct SI_PACK_THIS_STRUCT
{
unsigned res_16_bit:1;
unsigned res_20_bit:1;
unsigned res_24_bit:1;
unsigned F33_37:5;
}audio_code_1_LPCM;
struct SI_PACK_THIS_STRUCT
{
uint8_t max_bit_rate_div_by_8_KHz;
}audio_codes_2_8;
struct SI_PACK_THIS_STRUCT
{
uint8_t default_zero;
}audio_codes_9_15;
}byte3;
}CEA_short_audio_descriptor_t,*PCEA_short_audio_descriptor_t;
typedef struct SI_PACK_THIS_STRUCT _audio_data_block_t
{
data_block_header_byte_t header;
CEA_short_audio_descriptor_t short_audio_descriptors[1]; // open ended
}audio_data_block_t,*Paudio_data_block_t;
typedef struct SI_PACK_THIS_STRUCT _speaker_allocation_flags_t
{
unsigned char spk_front_left_front_right:1;
unsigned char spk_LFE:1;
unsigned char spk_front_center:1;
unsigned char spk_rear_left_rear_right:1;
unsigned char spk_rear_center:1;
unsigned char spk_front_left_center_front_right_center:1;
unsigned char spk_rear_left_center_rear_right_center:1;
unsigned char spk_reserved:1;
}speaker_allocation_flags_t,*Pspeaker_allocation_flags_t;
typedef struct SI_PACK_THIS_STRUCT _speaker_allocation_data_block_payload_t
{
speaker_allocation_flags_t speaker_alloc_flags;
uint8_t reserved[2];
}speaker_allocation_data_block_payload_t,*Pspeaker_allocation_data_block_payload_t;
typedef struct SI_PACK_THIS_STRUCT _speaker_allocation_data_block_t
{
data_block_header_byte_t header;
speaker_allocation_data_block_payload_t payload;
}speaker_allocation_data_block_t,*Pspeaker_allocation_data_block_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_BA_t
{
unsigned char B:4;
unsigned char A:4;
}HDMI_LLC_BA_t,*PHDMI_LLC_BA_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_DC_t
{
unsigned char D:4;
unsigned char C:4;
}HDMI_LLC_DC_t,*PHDMI_LLC_DC_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_Byte6_t
{
unsigned char DVI_dual :1;
unsigned char reserved :2;
unsigned char DC_Y444 :1;
unsigned char DC_30bit :1;
unsigned char DC_36bit :1;
unsigned char DC_48bit :1;
unsigned char supports_AI :1;
}HDMI_LLC_Byte6_t,*PHDMI_LLC_Byte6_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_byte8_t
{
unsigned char CNC0_adjacent_pixels_independent :1;
unsigned char CNC1_specific_processing_still_pictures :1;
unsigned char CNC2_specific_processing_cinema_content :1;
unsigned char CNC3_specific_processing_low_AV_latency :1;
unsigned char reserved :1;
unsigned char HDMI_video_present :1;
unsigned char I_latency_fields_present :1;
unsigned char latency_fields_present :1;
}HDMI_LLC_byte8_t,*PHDMI_LLC_byte8_t;
typedef enum
{
imsz_NO_ADDITIONAL = 0
,imsz_ASPECT_RATIO_CORRECT_BUT_NO_GUARRANTEE_OF_CORRECT_SIZE = 1
,imsz_CORRECT_SIZES_ROUNDED_TO_NEAREST_1_CM = 2
,imsz_CORRECT_SIZES_DIVIDED_BY_5_ROUNDED_TO_NEAREST_5_CM = 3
}image_size_e;
typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_Byte13_t
{
unsigned char reserved :3;
image_size_e image_size :2;
unsigned char _3D_multi_present :2;
unsigned char _3D_present :1;
}HDMI_LLC_Byte13_t,*PHDMI_LLC_Byte13_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_Byte14_t
{
unsigned char HDMI_3D_len :5;
unsigned char HDMI_VIC_len:3;
}HDMI_LLC_Byte14_t,*PHDMI_LLC_Byte14_t;
typedef struct SI_PACK_THIS_STRUCT _VSDB_byte_13_through_byte_15_t
{
HDMI_LLC_Byte13_t byte13;
HDMI_LLC_Byte14_t byte14;
uint8_t vicList[1]; // variable length list base on HDMI_VIC_len
}VSDB_byte_13_through_byte_15_t,*PVSDB_byte_13_through_byte_15_t;
typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte15_t
{
uint8_t video_latency;
uint8_t audio_latency;
uint8_t interlaced_video_latency;
uint8_t interlaced_audio_latency;
VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
// There must be no fields after here
}VSDB_all_fields_byte_9_through_byte15_t,*PVSDB_all_fields_byte_9_through_byte15_t;
typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t
{
uint8_t interlaced_video_latency;
uint8_t interlaced_audio_latency;
VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
// There must be no fields after here
}VSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t,*PVSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t;
typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t
{
uint8_t video_latency;
uint8_t audio_latency;
VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
// There must be no fields after here
}VSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t,*PVSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t;
typedef struct SI_PACK_THIS_STRUCT _VSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t
{
VSDB_byte_13_through_byte_15_t byte_13_through_byte_15;
// There must be no fields after here
}VSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t,*PVSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_LLC_vsdb_payload_t
{
HDMI_LLC_BA_t B_A;
HDMI_LLC_DC_t D_C;
HDMI_LLC_Byte6_t byte6;
uint8_t maxTMDSclock;
HDMI_LLC_byte8_t byte8;
union
{
VSDB_all_fields_byte_9_through_byte_15_sans_all_latency_t vsdb_all_fields_byte_9_through_byte_15_sans_all_latency;
VSDB_all_fields_byte_9_through_byte_15_sans_progressive_latency_t vsdb_all_fields_byte_9_through_byte_15_sans_progressive_latency;
VSDB_all_fields_byte_9_through_byte_15_sans_interlaced_latency_t vsdb_all_fields_byte_9_through_byte_15_sans_interlaced_latency;
VSDB_all_fields_byte_9_through_byte15_t vsdb_all_fields_byte_9_through_byte_15;
}vsdb_fields_byte_9_through_byte_15;
// There must be no fields after here
}HDMI_LLC_vsdb_payload_t,*PHDMI_LLC_vsdb_payload_t;
typedef struct SI_PACK_THIS_STRUCT st_3D_structure_all_15_8_t
{
uint8_t frame_packing : 1;
uint8_t reserved1 : 5;
uint8_t top_bottom : 1;
uint8_t reserved2 : 1;
}_3D_structure_all_15_8_t,*P_3D_structure_all_15_8_t;
typedef struct SI_PACK_THIS_STRUCT st_3D_structure_all_7_0_t
{
uint8_t side_by_side : 1;
uint8_t reserved : 7;
}_3D_structure_all_7_0_t,*P_3D_structure_all_7_0_t;
typedef struct SI_PACK_THIS_STRUCT tag_3D_structure_all_t
{
_3D_structure_all_15_8_t _3D_structure_all_15_8;
_3D_structure_all_7_0_t _3D_structure_all_7_0;
}_3D_structure_all_t,*P_3D_structure_all_t;
typedef struct SI_PACK_THIS_STRUCT tag_3D_mask_t
{
uint8_t _3D_mask_15_8;
uint8_t _3D_mask_7_0;
}_3D_mask_t,*P_3D_mask_t;
typedef struct SI_PACK_THIS_STRUCT tag_2D_VIC_order_3D_structure_t
{
_3D_structure_e _3D_structure:4; // definition from info frame
unsigned _2D_VIC_order:4;
}_2D_VIC_order_3D_structure_t,*P_2D_VIC_order_3D_structure_t;
typedef struct SI_PACK_THIS_STRUCT tag_3D_detail_t
{
unsigned char reserved :4;
unsigned char _3D_detail :4;
}_3D_detail_t,*P_3D_detail_t;
typedef struct SI_PACK_THIS_STRUCT tag_3D_structure_and_detail_entry_sans_byte1_t
{
_2D_VIC_order_3D_structure_t byte0;
/*see HDMI 1.4 spec w.r.t. contents of 3D_structure_X */
}_3D_structure_and_detail_entry_sans_byte1_t,*P_3D_structure_and_detail_entry_sans_byte1_t;
typedef struct SI_PACK_THIS_STRUCT tag_3D_structure_and_detail_entry_with_byte1_t
{
_2D_VIC_order_3D_structure_t byte0;
_3D_detail_t byte1;
}_3D_structure_and_detail_entry_with_byte1_t,*P_3D_structure_and_detail_entry_with_byte1_t;
typedef union tag_3D_structure_and_detail_entry_u
{
_3D_structure_and_detail_entry_sans_byte1_t sans_byte1;
_3D_structure_and_detail_entry_with_byte1_t with_byte1;
}_3D_structure_and_detail_entry_u,*P_3D_structure_and_detail_entry_u;
typedef struct SI_PACK_THIS_STRUCT _HDMI_3D_sub_block_sans_all_AND_mask_t
{
_3D_structure_and_detail_entry_u _3D_structure_and_detail_list[1];
}HDMI_3D_sub_block_sans_all_AND_mask_t,*PHDMI_3D_sub_block_sans_all_AND_mask_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_3D_sub_block_sans_mask_t
{
_3D_structure_all_t _3D_structure_all;
_3D_structure_and_detail_entry_u _3D_structure_and_detail_list[1];
}HDMI_3D_sub_block_sans_mask_t,*PHDMI_3D_sub_block_sans_mask_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_3D_sub_block_with_all_AND_mask_t
{
_3D_structure_all_t _3D_structure_all;
_3D_mask_t _3D_mask;
_3D_structure_and_detail_entry_u _3D_structure_and_detail_list[1];
}HDMI_3D_sub_block_with_all_AND_mask_t,*PHDMI_3D_sub_block_with_all_AND_mask_t;
typedef union
{
HDMI_3D_sub_block_sans_all_AND_mask_t hDMI_3D_sub_block_sans_all_AND_mask;
HDMI_3D_sub_block_sans_mask_t HDMI_3D_sub_block_sans_mask;
HDMI_3D_sub_block_with_all_AND_mask_t HDMI_3D_sub_block_with_all_AND_mask;
}HDMI_3D_sub_block_t,*PHDMI_3D_sub_block_t;
typedef struct SI_PACK_THIS_STRUCT _vsdb_t
{
data_block_header_byte_t header;
uint8_t IEEE_OUI[3];
union
{
HDMI_LLC_vsdb_payload_t HDMI_LLC;
uint8_t payload[1]; // open ended
}payload_u;
}vsdb_t,*P_vsdb_t;
typedef enum
{
xvYCC_601 = 1
,xvYCC_709 = 2
}colorimetry_xvYCC_e;
typedef struct SI_PACK_THIS_STRUCT _colorimetry_xvYCC_t
{
colorimetry_xvYCC_e xvYCC :2;
unsigned char reserved1 :6;
}colorimetry_xvYCC_t,*Pcolorimetry_xvYCC_t;
typedef struct SI_PACK_THIS_STRUCT _colorimetry_meta_data_t
{
unsigned char meta_data :3;
unsigned char reserved2 :5;
}colorimetry_meta_data_t,*Pcolorimetry_meta_data_t;
typedef struct SI_PACK_THIS_STRUCT _colorimetry_data_payload_t
{
colorimetry_xvYCC_t ci_data;
colorimetry_meta_data_t cm_meta_data;
}colorimetry_data_payload_t,*Pcolorimetry_data_payload_t;
typedef struct SI_PACK_THIS_STRUCT _colorimetry_data_block_t
{
data_block_header_byte_t header;
extended_tag_code_t extended_tag;
colorimetry_data_payload_t payload;
}colorimetry_data_block_t,*Pcolorimetry_data_block_t;
typedef enum
{
ceou_NEITHER = 0
,ceou_ALWAYS_OVERSCANNED = 1
,ceou_ALWAYS_UNDERSCANNED = 2
,ceou_BOTH = 3
}CE_overscan_underscan_behavior_e;
typedef enum
{
itou_NEITHER = 0
,itou_ALWAYS_OVERSCANNED = 1
,itou_ALWAYS_UNDERSCANNED = 2
,itou_BOTH = 3
}IT_overscan_underscan_behavior_e;
typedef enum
{
ptou_NEITHER = 0
,ptou_ALWAYS_OVERSCANNED = 1
,ptou_ALWAYS_UNDERSCANNED = 2
,ptou_BOTH = 3
}PT_overscan_underscan_behavior_e;
typedef struct SI_PACK_THIS_STRUCT _video_capability_data_payload_t
{
CE_overscan_underscan_behavior_e S_CE :2;
IT_overscan_underscan_behavior_e S_IT :2;
PT_overscan_underscan_behavior_e S_PT :2;
unsigned QS :1;
unsigned quantization_range_selectable:1;
}video_capability_data_payload_t,*Pvideo_capability_data_payload_t;
typedef struct SI_PACK_THIS_STRUCT _video_capability_data_block_t
{
data_block_header_byte_t header;
extended_tag_code_t extended_tag;
video_capability_data_payload_t payload;
}video_capability_data_block_t,*Pvideo_capability_data_block_t;
typedef struct SI_PACK_THIS_STRUCT _CEA_data_block_collection_t
{
data_block_header_byte_t header;
union
{
extended_tag_code_t extended_tag;
cea_short_descriptor_t short_descriptor;
}payload_u;
// open ended array of cea_short_descriptor_t starts here
}CEA_data_block_collection_t,*PCEA_data_block_collection_t;
typedef struct SI_PACK_THIS_STRUCT _CEA_extension_version_1_t
{
uint8_t reservedMustBeZero;
uint8_t reserved[123];
}CEA_extension_version_1_t,*PCEA_extension_version_1_t;
typedef struct SI_PACK_THIS_STRUCT _CEA_extension_2_3_misc_support_t
{
uint8_t total_number_detailed_timing_descriptors_in_entire_EDID:4;
uint8_t YCrCb422_support:1;
uint8_t YCrCb444_support:1;
uint8_t basic_audio_support:1;
uint8_t underscan_IT_formats_by_default:1;
}CEA_extension_2_3_misc_support_t,*PCEA_extension_2_3_misc_support_t;
typedef struct SI_PACK_THIS_STRUCT _CEA_extension_version_2_t
{
CEA_extension_2_3_misc_support_t misc_support;
uint8_t reserved[123];
}CEA_extension_version_2_t,*PCEA_extension_version_2_t;
typedef struct SI_PACK_THIS_STRUCT _CEA_extension_version_3_t
{
CEA_extension_2_3_misc_support_t misc_support;
union
{
uint8_t data_block_collection[123];
uint8_t reserved[123];
}Offset4_u;
}CEA_extension_version_3_t,*PCEA_extension_version_3_t;
typedef struct SI_PACK_THIS_STRUCT _block_map_t
{
uint8_t tag;
uint8_t block_tags[126];
uint8_t checksum;
}block_map_t, *Pblock_map_t;
typedef struct SI_PACK_THIS_STRUCT _CEA_extension_t
{
uint8_t tag;
uint8_t revision;
uint8_t byte_offset_to_18_byte_descriptors;
union
{
CEA_extension_version_1_t version1;
CEA_extension_version_2_t version2;
CEA_extension_version_3_t version3;
}version_u;
uint8_t checksum;
}CEA_extension_t,*PCEA_extension_t;
typedef struct SI_PACK_THIS_STRUCT _detailed_timing_descriptor_t
{
uint8_t pixel_clock_low;
uint8_t pixel_clock_high;
uint8_t horz_active_7_0;
uint8_t horz_blanking_7_0;
struct SI_PACK_THIS_STRUCT
{
unsigned char horz_blanking_11_8 :4;
unsigned char horz_active_11_8 :4;
}horz_active_blanking_high;
uint8_t vert_active_7_0;
uint8_t vert_blanking_7_0;
struct SI_PACK_THIS_STRUCT
{
unsigned char vert_blanking_11_8 :4;
unsigned char vert_active_11_8 :4;
}vert_active_blanking_high;
uint8_t horz_sync_offset_7_0;
uint8_t horz_sync_pulse_width7_0;
struct SI_PACK_THIS_STRUCT
{
unsigned char vert_sync_pulse_width_3_0 :4;
unsigned char vert_sync_offset_3_0 :4;
}vert_sync_offset_width;
struct SI_PACK_THIS_STRUCT
{
unsigned char vert_sync_pulse_width_5_4 :2;
unsigned char vert_sync_offset_5_4 :2;
unsigned char horz_sync_pulse_width_9_8 :2;
unsigned char horzSyncOffset9_8 :2;
}hs_offset_hs_pulse_width_vs_offset_vs_pulse_width;
uint8_t horz_image_size_in_mm_7_0;
uint8_t vert_image_size_in_mm_7_0;
struct SI_PACK_THIS_STRUCT
{
unsigned char vert_image_size_in_mm_11_8 :4;
unsigned char horz_image_size_in_mm_11_8 :4;
}image_size_high;
uint8_t horz_border_in_lines;
uint8_t vert_border_in_pixels;
struct SI_PACK_THIS_STRUCT
{
unsigned char stereo_bit_0 :1;
unsigned char sync_signal_options :2;
unsigned char sync_signal_type :2;
unsigned char stereo_bits_2_1 :2;
unsigned char interlaced :1;
}flags;
}detailed_timing_descriptor_t,*Pdetailed_timing_descriptor_t;
typedef struct SI_PACK_THIS_STRUCT _red_green_bits_1_0_t
{
unsigned char green_y :2;
unsigned char green_x :2;
unsigned char red_y :2;
unsigned char red_x :2;
}red_green_bits_1_0_t,*Pred_green_bits_1_0_t;
typedef struct SI_PACK_THIS_STRUCT _blue_white_bits_1_0_t
{
unsigned char white_y :2;
unsigned char white_x :2;
unsigned char blue_y :2;
unsigned char blue_x :2;
}blue_white_bits_1_0_t,*Pblue_white_bits_1_0_t;
typedef struct SI_PACK_THIS_STRUCT _established_timings_I_t
{
unsigned char et800x600_60Hz :1;
unsigned char et800x600_56Hz :1;
unsigned char et640x480_75Hz :1;
unsigned char et640x480_72Hz :1;
unsigned char et640x480_67Hz :1;
unsigned char et640x480_60Hz :1;
unsigned char et720x400_88Hz :1;
unsigned char et720x400_70Hz :1;
}established_timings_I_t,*Pestablished_timings_I_t;
typedef struct SI_PACK_THIS_STRUCT _established_timings_II_t
{
unsigned char et1280x1024_75Hz:1;
unsigned char et1024x768_75Hz :1;
unsigned char et1024x768_70Hz :1;
unsigned char et1024x768_60Hz :1;
unsigned char et1024x768_87HzI:1;
unsigned char et832x624_75Hz :1;
unsigned char et800x600_75Hz :1;
unsigned char et800x600_72Hz :1;
}established_timings_II_t,*Pestablished_timings_II_t;
typedef struct SI_PACK_THIS_STRUCT _manufacturers_timings_t
{
unsigned char reserved :7;
unsigned char et1152x870_75Hz :1;
}manufacturers_timings_t,*Pmanufacturers_timings_t;
typedef enum
{
iar_16_to_10 = 0
,iar_4_to_3 = 1
,iar_5_to_4 = 2
,iar_16_to_9 = 3
}image_aspect_ratio_e;
typedef struct SI_PACK_THIS_STRUCT _standard_timing_t
{
unsigned char horz_pix_div_8_minus_31;
unsigned char field_refresh_rate_minus_60:6;
image_aspect_ratio_e image_aspect_ratio :2;
}standard_timing_t,*Pstandard_timing_t;
typedef struct SI_PACK_THIS_STRUCT _EDID_block0_t
{
unsigned char header_data[8];
TwoBytes_t id_manufacturer_name;
TwoBytes_t id_product_code;
unsigned char serial_number[4];
unsigned char week_of_manufacture;
unsigned char year_of_manufacture;
unsigned char EDID_version;
unsigned char EDID_revision;
unsigned char video_input_definition;
unsigned char horz_screen_size_or_aspect_ratio;
unsigned char vert_screen_size_or_aspect_ratio;
unsigned char display_transfer_characteristic;
unsigned char feature_support;
red_green_bits_1_0_t red_green_bits_1_0;
blue_white_bits_1_0_t blue_white_bits_1_0;
unsigned char red_x;
unsigned char red_y;
unsigned char green_x;
unsigned char green_y;
unsigned char blue_x;
unsigned char blue_y;
unsigned char white_x;
unsigned char white_y;
established_timings_I_t established_timings_I;
established_timings_II_t established_timings_II;
manufacturers_timings_t manufacturers_timings;
standard_timing_t standard_timings[8];
detailed_timing_descriptor_t detailed_timing_descriptors[4];
unsigned char extension_flag;
unsigned char checksum;
}EDID_block0_t,*PEDID_block0_t;
typedef struct SI_PACK_THIS_STRUCT _monitor_name_t
{
uint8_t flag_required[2];
uint8_t flag_reserved;
uint8_t data_type_tag;
uint8_t flag;
uint8_t ascii_name[13];
}monitor_name_t,*Pmonitor_name_t;
typedef struct SI_PACK_THIS_STRUCT _monitor_range_limits_t
{
uint8_t flag_required[2];
uint8_t flag_reserved;
uint8_t data_type_tag;
uint8_t flag;
uint8_t min_vertical_rate_in_Hz;
uint8_t max_vertical_rate_in_Hz;
uint8_t min_horizontal_rate_in_KHz;
uint8_t max_horizontal_rate_in_KHz;
uint8_t max_pixel_clock_in_MHz_div_10;
uint8_t tag_secondary_formula;
uint8_t filler[7];
}monitor_range_limits_t,*Pmonitor_range_limits_t;
typedef union tag_18_byte_descriptor_u
{
detailed_timing_descriptor_t dtd;
monitor_name_t name;
monitor_range_limits_t range_limits;
}_18_byte_descriptor_u,*P_18_byte_descriptor_u;
typedef struct SI_PACK_THIS_STRUCT _display_mode_3D_info_t
{
unsigned char dmi_3D_supported:1;
unsigned char dmi_sufficient_bandwidth:1;
}display_mode_3D_info_t,*Pdisplay_mode_3D_info_t;
typedef enum
{
vif_single_frame_rate = 0x00
,vif_dual_frame_rate = 0x01
}VIC_info_flags_e;
typedef enum
{
vsm_progressive = 0
,vsm_interlaced = 1
}VIC_scan_mode_e;
typedef enum
{
par_1_to_1
,par_16_to_15
,par_16_to_27
,par_16_to_45
,par_16_to_45_160_to_45
,par_1_to_15_10_to_15
,par_1_to_9_10_to_9
,par_2_to_15_20_to_15
,par_2_to_9
,par_2_to_9_20_to_9
,par_32_to_27
,par_32_to_45
,par_4_to_27_40_to_27
,par_4_to_9
,par_4_to_15
,par_64_to_45
,par_8_to_15
,par_8_to_27
,par_8_to_27_80_to_27
,par_8_to_45_80_to_45
,par_8_to_9
}pixel_aspect_ratio_e;
typedef struct SI_PACK_THIS_STRUCT _VIC_info_fields_t
{
image_aspect_ratio_e image_aspect_ratio :2;
VIC_scan_mode_e interlaced :1;
pixel_aspect_ratio_e pixel_aspect_ratio :5;
VIC_info_flags_e frame_rate_info :1;
uint8_t clocks_per_pixel_shift_count:2;
uint8_t field2_v_blank :2;
uint8_t reserved :3;
}VIC_info_fields_t,*PVIC_info_fields_t;
typedef struct SI_PACK_THIS_STRUCT _VIC_info_t
{
uint16_t columns;
uint16_t rows;
uint16_t h_blank_in_pixels;
uint16_t v_blank_in_pixels;
uint32_t field_rate_in_milliHz;
VIC_info_fields_t fields;
// uint16_t pixClockDiv10000;
}VIC_info_t,*PVIC_info_t;
typedef struct SI_PACK_THIS_STRUCT _HDMI_VIC_info_t
{
uint16_t columns;
uint16_t rows;
uint32_t field_rate_0_in_milliHz,field_rate_1_in_milliHz;
uint32_t pixel_clock_0,pixel_clock_1;
}HDMI_VIC_info_t,*PHDMI_VIC_info_t;
#if 1//def ENABLE_EDID_DEBUG_PRINT //(
void dump_EDID_block_impl(const char *pszFunction, int iLineNum,uint8_t override,uint8_t *pData,uint16_t length);
void clear_EDID_block_impl(uint8_t *pData);
#define DUMP_EDID_BLOCK(override,pData,length) dump_EDID_block_impl(__func__,__LINE__,override,(uint8_t *)pData,length);
#define CLEAR_EDID_BLOCK(pData) clear_EDID_block_impl(pData);
#else //)(
#define DUMP_EDID_BLOCK(override,pData,length) /* nothing to do */
#define CLEAR_EDID_BLOCK(pData) /* nothing to do */
#endif //)
enum EDID_error_codes
{
EDID_OK,
EDID_INCORRECT_HEADER,
EDID_CHECKSUM_ERROR,
EDID_NO_861_EXTENSIONS,
EDID_SHORT_DESCRIPTORS_OK,
EDID_LONG_DESCRIPTORS_OK,
EDID_EXT_TAG_ERROR,
EDID_REV_ADDR_ERROR,
EDID_V_DESCR_OVERFLOW,
EDID_UNKNOWN_TAG_CODE,
EDID_NO_DETAILED_DESCRIPTORS,
EDID_DDC_BUS_REQ_FAILURE,
EDID_DDC_BUS_RELEASE_FAILURE,
EDID_READ_TIMEOUT
};
SI_POP_STRUCT_PACKING //)
#endif /* #if !defined(SI_EDID_H) */
|