Lines Matching +full:0 +full:x720

33 #define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) & (BITS_PER_LONG - 1)))
34 #define BITMAP_LAST_WORD_MASK(nbits) (~0UL >> (-(nbits) & (BITS_PER_LONG - 1)))
35 #define EDID_PRODUCT_ID(e) ((e)->prod_code[0] | ((e)->prod_code[1] << 8))
48 #define EDID_QUIRK_PREFER_LARGE_60 BIT(0)
82 #define LEVEL_DMT 0
95 { "API", 0x7602, EDID_QUIRK_PREFER_LARGE_60 },
99 /* AEO model 0 reports 8 bpc, but is a 6 bpc panel */
100 { "AEO", 0, EDID_QUIRK_FORCE_6BPC },
104 { "MAX", 0x77e, EDID_QUIRK_PREFER_LARGE_60 },
119 { "LPL", 0, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
120 { "LPL", 0x2a00, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
135 { "SNY", 0x2541, EDID_QUIRK_FORCE_12BPC },
141 { "MED", 0x7b8, EDID_QUIRK_PREFER_LARGE_75 },
144 { "SEC", 0xd033, EDID_QUIRK_FORCE_8BPC },
163 752, 800, 480, 490, 492, 525, 0,
168 798, 858, 480, 489, 495, 525, 0,
173 798, 858, 480, 489, 495, 525, 0,
176 /* 4 - 1280x720@60Hz */
178 1430, 1650, 720, 725, 730, 750, 0,
183 2052, 2200, 1080, 1084, 1094, 1125, 0,
189 801, 858, 480, 488, 494, 525, 0,
195 801, 858, 480, 488, 494, 525, 0,
201 801, 858, 240, 244, 247, 262, 0,
207 801, 858, 240, 244, 247, 262, 0,
213 3204, 3432, 480, 488, 494, 525, 0,
219 3204, 3432, 480, 488, 494, 525, 0,
225 3204, 3432, 240, 244, 247, 262, 0,
230 3204, 3432, 240, 244, 247, 262, 0,
235 1596, 1716, 480, 489, 495, 525, 0,
240 1596, 1716, 480, 489, 495, 525, 0,
245 2052, 2200, 1080, 1084, 1089, 1125, 0,
250 796, 864, 576, 581, 586, 625, 0,
255 796, 864, 576, 581, 586, 625, 0,
258 /* 19 - 1280x720@50Hz */
260 1760, 1980, 720, 725, 730, 750, 0,
265 2492, 2640, 1080, 1084, 1094, 1125, 0,
271 795, 864, 576, 580, 586, 625, 0,
277 795, 864, 576, 580, 586, 625, 0,
283 795, 864, 288, 290, 293, 312, 0,
289 795, 864, 288, 290, 293, 312, 0,
295 3180, 3456, 576, 580, 586, 625, 0,
301 3180, 3456, 576, 580, 586, 625, 0,
307 3180, 3456, 288, 290, 293, 312, 0,
312 3180, 3456, 288, 290, 293, 312, 0,
317 1592, 1728, 576, 581, 586, 625, 0,
322 1592, 1728, 576, 581, 586, 625, 0,
327 2492, 2640, 1080, 1084, 1089, 1125, 0,
332 2602, 2750, 1080, 1084, 1089, 1125, 0,
337 2492, 2640, 1080, 1084, 1089, 1125, 0,
342 2052, 2200, 1080, 1084, 1089, 1125, 0,
347 3192, 3432, 480, 489, 495, 525, 0,
352 3192, 3432, 480, 489, 495, 525, 0,
357 3184, 3456, 576, 581, 586, 625, 0,
362 3184, 3456, 576, 581, 586, 625, 0,
367 2120, 2304, 1080, 1126, 1136, 1250, 0,
373 2492, 2640, 1080, 1084, 1094, 1125, 0,
377 /* 41 - 1280x720@100Hz */
379 1760, 1980, 720, 725, 730, 750, 0,
384 796, 864, 576, 581, 586, 625, 0,
389 796, 864, 576, 581, 586, 625, 0,
394 795, 864, 576, 580, 586, 625, 0,
400 795, 864, 576, 580, 586, 625, 0,
406 2052, 2200, 1080, 1084, 1094, 1125, 0,
410 /* 47 - 1280x720@120Hz */
412 1430, 1650, 720, 725, 730, 750, 0,
417 798, 858, 480, 489, 495, 525, 0,
422 798, 858, 480, 489, 495, 525, 0,
427 801, 858, 480, 488, 494, 525, 0,
433 801, 858, 480, 488, 494, 525, 0,
439 796, 864, 576, 581, 586, 625, 0,
444 796, 864, 576, 581, 586, 625, 0,
449 795, 864, 576, 580, 586, 625, 0,
455 795, 864, 576, 580, 586, 625, 0,
461 798, 858, 480, 489, 495, 525, 0,
466 798, 858, 480, 489, 495, 525, 0,
471 801, 858, 480, 488, 494, 525, 0,
477 801, 858, 480, 488, 494, 525, 0,
481 /* 60 - 1280x720@24Hz */
483 3080, 3300, 720, 725, 730, 750, 0,
486 /* 61 - 1280x720@25Hz */
488 3740, 3960, 720, 725, 730, 750, 0,
491 /* 62 - 1280x720@30Hz */
493 3080, 3300, 720, 725, 730, 750, 0,
498 2052, 2200, 1080, 1084, 1089, 1125, 0,
503 2492, 2640, 1080, 1084, 1089, 1125, 0,
506 /* 65 - 1280x720@24Hz */
508 3080, 3300, 720, 725, 730, 750, 0,
511 /* 66 - 1280x720@25Hz */
513 3740, 3960, 720, 725, 730, 750, 0,
516 /* 67 - 1280x720@30Hz */
518 3080, 3300, 720, 725, 730, 750, 0,
521 /* 68 - 1280x720@50Hz */
523 1760, 1980, 720, 725, 730, 750, 0,
526 /* 69 - 1280x720@60Hz */
528 1430, 1650, 720, 725, 730, 750, 0,
531 /* 70 - 1280x720@100Hz */
533 1760, 1980, 720, 725, 730, 750, 0,
536 /* 71 - 1280x720@120Hz */
538 1430, 1650, 720, 725, 730, 750, 0,
543 2602, 2750, 1080, 1084, 1089, 1125, 0,
548 2492, 2640, 1080, 1084, 1089, 1125, 0,
553 2052, 2200, 1080, 1084, 1089, 1125, 0,
558 2492, 2640, 1080, 1084, 1089, 1125, 0,
563 2052, 2200, 1080, 1084, 1089, 1125, 0,
568 2492, 2640, 1080, 1084, 1089, 1125, 0,
573 2052, 2200, 1080, 1084, 1089, 1125, 0,
576 /* 79 - 1680x720@24Hz */
578 3080, 3300, 720, 725, 730, 750, 0,
581 /* 80 - 1680x720@25Hz */
583 2948, 3168, 720, 725, 730, 750, 0,
586 /* 81 - 1680x720@30Hz */
588 2420, 2640, 720, 725, 730, 750, 0,
591 /* 82 - 1680x720@50Hz */
593 1980, 2200, 720, 725, 730, 750, 0,
596 /* 83 - 1680x720@60Hz */
598 1980, 2200, 720, 725, 730, 750, 0,
601 /* 84 - 1680x720@100Hz */
603 1780, 2000, 720, 725, 730, 825, 0,
606 /* 85 - 1680x720@120Hz */
608 1780, 2000, 720, 725, 730, 825, 0,
613 3602, 3750, 1080, 1084, 1089, 1100, 0,
618 3052, 3200, 1080, 1084, 1089, 1125, 0,
623 3372, 3520, 1080, 1084, 1089, 1125, 0,
628 3152, 3300, 1080, 1084, 1089, 1125, 0,
633 2852, 3000, 1080, 1084, 1089, 1100, 0,
638 2822, 2970, 1080, 1084, 1089, 1250, 0,
643 3152, 3300, 1080, 1084, 1089, 1250, 0,
648 5204, 5500, 2160, 2168, 2178, 2250, 0,
653 4984, 5280, 2160, 2168, 2178, 2250, 0,
658 4104, 4400, 2160, 2168, 2178, 2250, 0,
663 4984, 5280, 2160, 2168, 2178, 2250, 0,
668 4104, 4400, 2160, 2168, 2178, 2250, 0,
673 5204, 5500, 2160, 2168, 2178, 2250, 0,
678 5152, 5280, 2160, 2168, 2178, 2250, 0,
683 4272, 4400, 2160, 2168, 2178, 2250, 0,
688 5152, 5280, 2160, 2168, 2178, 2250, 0,
693 4272, 4400, 2160, 2168, 2178, 2250, 0,
698 5204, 5500, 2160, 2168, 2178, 2250, 0,
703 4104, 4400, 2160, 2168, 2178, 2250, 0,
708 4104, 4400, 2160, 2168, 2178, 2250, 0,
713 4984, 5280, 2160, 2168, 2178, 2250, 0,
718 4104, 4400, 2160, 2168, 2178, 2250, 0,
721 /* 108 - 1280x720@48Hz 16:9 */
723 2280, 2500, 720, 725, 730, 750, 0,
726 /* 109 - 1280x720@48Hz 64:27 */
728 2280, 2500, 720, 725, 730, 750, 0,
731 /* 110 - 1680x720@48Hz 64:27 */
733 2530, 2750, 720, 725, 730, 750, 0,
738 2602, 2750, 1080, 1084, 1089, 1125, 0,
743 2602, 2750, 1080, 1084, 1089, 1125, 0,
748 3602, 3750, 1080, 1084, 1089, 1100, 0,
753 5204, 5500, 2160, 2168, 2178, 2250, 0,
758 5204, 5500, 2160, 2168, 2178, 2250, 0,
763 5204, 5500, 2160, 2168, 2178, 2250, 0,
768 4984, 5280, 2160, 2168, 2178, 2250, 0,
773 4104, 4400, 2160, 2168, 2178, 2250, 0,
778 4984, 5280, 2160, 2168, 2178, 2250, 0,
783 4104, 4400, 2160, 2168, 2178, 2250, 0,
788 7204, 7500, 2160, 2168, 2178, 2200, 0,
793 6904, 7200, 2160, 2168, 2178, 2200, 0,
798 5872, 6000, 2160, 2168, 2178, 2200, 0,
803 5954, 6250, 2160, 2168, 2178, 2475, 0,
808 6304, 6600, 2160, 2168, 2178, 2250, 0,
813 5372, 5500, 2160, 2168, 2178, 2250, 0,
818 6304, 6600, 2160, 2168, 2178, 2250, 0,
826 5372, 5500, 2160, 2168, 2178, 2250, 0,
831 10408, 11000, 4320, 4336, 4356, 4500, 0,
836 10208, 10800, 4320, 4336, 4356, 4400, 0,
841 8408, 9000, 4320, 4336, 4356, 4400, 0,
846 10408, 11000, 4320, 4336, 4356, 4500, 0,
851 10208, 10800, 4320, 4336, 4356, 4400, 0,
856 8408, 9000, 4320, 4336, 4356, 4400, 0,
861 9968, 10560, 4320, 4336, 4356, 4500, 0,
866 8208, 8800, 4320, 4336, 4356, 4500, 0,
871 10408, 11000, 4320, 4336, 4356, 4500, 0,
876 10208, 10800, 4320, 4336, 4356, 4400, 0,
881 8408, 9000, 4320, 4336, 4356, 4400, 0,
886 10408, 11000, 4320, 4336, 4356, 4500, 0,
891 10208, 10800, 4320, 4336, 4356, 4400, 0,
896 8408, 9000, 4320, 4336, 4356, 4400, 0,
901 9968, 10560, 4320, 4336, 4356, 4500, 0,
906 8208, 8800, 4320, 4336, 4356, 4500, 0,
911 11908, 12500, 4320, 4336, 4356, 4950, 0,
916 12908, 13500, 4320, 4336, 4356, 4400, 0,
921 10704, 11000, 4320, 4336, 4356, 4500, 0,
926 11908, 12500, 4320, 4336, 4356, 4950, 0,
931 12908, 13500, 4320, 4336, 4356, 4400, 0,
936 10704, 11000, 4320, 4336, 4356, 4500, 0,
941 12608, 13200, 4320, 4336, 4356, 4500, 0,
946 10704, 11000, 4320, 4336, 4356, 4500, 0,
951 4984, 5280, 2160, 2168, 2178, 2250, 0,
956 4272, 4400, 2160, 2168, 2178, 2250, 0,
965 /* 0 - dummy, VICs start at 1 */
970 2160, 2168, 2178, 2250, 0,
976 2160, 2168, 2178, 2250, 0,
982 2160, 2168, 2178, 2250, 0,
988 2160, 2168, 2178, 2250, 0,
998 /* 0x01 - 640x350@85Hz */
1000 736, 832, 350, 382, 385, 445, 0,
1002 /* 0x02 - 640x400@85Hz */
1004 736, 832, 400, 401, 404, 445, 0,
1006 /* 0x03 - 720x400@85Hz */
1008 828, 936, 400, 401, 404, 446, 0,
1010 /* 0x04 - 640x480@60Hz */
1012 752, 800, 480, 490, 492, 525, 0,
1014 /* 0x05 - 640x480@72Hz */
1016 704, 832, 480, 489, 492, 520, 0,
1018 /* 0x06 - 640x480@75Hz */
1020 720, 840, 480, 481, 484, 500, 0,
1022 /* 0x07 - 640x480@85Hz */
1024 752, 832, 480, 481, 484, 509, 0,
1026 /* 0x08 - 800x600@56Hz */
1028 896, 1024, 600, 601, 603, 625, 0,
1030 /* 0x09 - 800x600@60Hz */
1032 968, 1056, 600, 601, 605, 628, 0,
1034 /* 0x0a - 800x600@72Hz */
1036 976, 1040, 600, 637, 643, 666, 0,
1038 /* 0x0b - 800x600@75Hz */
1040 896, 1056, 600, 601, 604, 625, 0,
1042 /* 0x0c - 800x600@85Hz */
1044 896, 1048, 600, 601, 604, 631, 0,
1046 /* 0x0d - 800x600@120Hz RB */
1048 880, 960, 600, 603, 607, 636, 0,
1050 /* 0x0e - 848x480@60Hz */
1052 976, 1088, 480, 486, 494, 517, 0,
1054 /* 0x0f - 1024x768@43Hz, interlace */
1056 1208, 1264, 768, 768, 772, 817, 0,
1059 /* 0x10 - 1024x768@60Hz */
1061 1184, 1344, 768, 771, 777, 806, 0,
1063 /* 0x11 - 1024x768@70Hz */
1065 1184, 1328, 768, 771, 777, 806, 0,
1067 /* 0x12 - 1024x768@75Hz */
1069 1136, 1312, 768, 769, 772, 800, 0,
1071 /* 0x13 - 1024x768@85Hz */
1073 1168, 1376, 768, 769, 772, 808, 0,
1075 /* 0x14 - 1024x768@120Hz RB */
1077 1104, 1184, 768, 771, 775, 813, 0,
1079 /* 0x15 - 1152x864@75Hz */
1081 1344, 1600, 864, 865, 868, 900, 0,
1083 /* 0x55 - 1280x720@60Hz */
1085 1430, 1650, 720, 725, 730, 750, 0,
1087 /* 0x16 - 1280x768@60Hz RB */
1089 1360, 1440, 768, 771, 778, 790, 0,
1091 /* 0x17 - 1280x768@60Hz */
1093 1472, 1664, 768, 771, 778, 798, 0,
1095 /* 0x18 - 1280x768@75Hz */
1097 1488, 1696, 768, 771, 778, 805, 0,
1099 /* 0x19 - 1280x768@85Hz */
1101 1496, 1712, 768, 771, 778, 809, 0,
1103 /* 0x1a - 1280x768@120Hz RB */
1105 1360, 1440, 768, 771, 778, 813, 0,
1107 /* 0x1b - 1280x800@60Hz RB */
1109 1360, 1440, 800, 803, 809, 823, 0,
1111 /* 0x1c - 1280x800@60Hz */
1113 1480, 1680, 800, 803, 809, 831, 0,
1115 /* 0x1d - 1280x800@75Hz */
1117 1488, 1696, 800, 803, 809, 838, 0,
1119 /* 0x1e - 1280x800@85Hz */
1121 1496, 1712, 800, 803, 809, 843, 0,
1123 /* 0x1f - 1280x800@120Hz RB */
1125 1360, 1440, 800, 803, 809, 847, 0,
1127 /* 0x20 - 1280x960@60Hz */
1129 1488, 1800, 960, 961, 964, 1000, 0,
1131 /* 0x21 - 1280x960@85Hz */
1133 1504, 1728, 960, 961, 964, 1011, 0,
1135 /* 0x22 - 1280x960@120Hz RB */
1137 1360, 1440, 960, 963, 967, 1017, 0,
1139 /* 0x23 - 1280x1024@60Hz */
1141 1440, 1688, 1024, 1025, 1028, 1066, 0,
1143 /* 0x24 - 1280x1024@75Hz */
1145 1440, 1688, 1024, 1025, 1028, 1066, 0,
1147 /* 0x25 - 1280x1024@85Hz */
1149 1504, 1728, 1024, 1025, 1028, 1072, 0,
1151 /* 0x26 - 1280x1024@120Hz RB */
1153 1360, 1440, 1024, 1027, 1034, 1084, 0,
1155 /* 0x27 - 1360x768@60Hz */
1157 1536, 1792, 768, 771, 777, 795, 0,
1159 /* 0x28 - 1360x768@120Hz RB */
1161 1440, 1520, 768, 771, 776, 813, 0,
1163 /* 0x51 - 1366x768@60Hz */
1165 1579, 1792, 768, 771, 774, 798, 0,
1167 /* 0x56 - 1366x768@60Hz */
1169 1436, 1500, 768, 769, 772, 800, 0,
1171 /* 0x29 - 1400x1050@60Hz RB */
1173 1480, 1560, 1050, 1053, 1057, 1080, 0,
1175 /* 0x2a - 1400x1050@60Hz */
1177 1632, 1864, 1050, 1053, 1057, 1089, 0,
1179 /* 0x2b - 1400x1050@75Hz */
1181 1648, 1896, 1050, 1053, 1057, 1099, 0,
1183 /* 0x2c - 1400x1050@85Hz */
1185 1656, 1912, 1050, 1053, 1057, 1105, 0,
1187 /* 0x2d - 1400x1050@120Hz RB */
1189 1480, 1560, 1050, 1053, 1057, 1112, 0,
1191 /* 0x2e - 1440x900@60Hz RB */
1193 1520, 1600, 900, 903, 909, 926, 0,
1195 /* 0x2f - 1440x900@60Hz */
1197 1672, 1904, 900, 903, 909, 934, 0,
1199 /* 0x30 - 1440x900@75Hz */
1201 1688, 1936, 900, 903, 909, 942, 0,
1203 /* 0x31 - 1440x900@85Hz */
1205 1696, 1952, 900, 903, 909, 948, 0,
1207 /* 0x32 - 1440x900@120Hz RB */
1209 1520, 1600, 900, 903, 909, 953, 0,
1211 /* 0x53 - 1600x900@60Hz */
1213 1704, 1800, 900, 901, 904, 1000, 0,
1215 /* 0x33 - 1600x1200@60Hz */
1217 1856, 2160, 1200, 1201, 1204, 1250, 0,
1219 /* 0x34 - 1600x1200@65Hz */
1221 1856, 2160, 1200, 1201, 1204, 1250, 0,
1223 /* 0x35 - 1600x1200@70Hz */
1225 1856, 2160, 1200, 1201, 1204, 1250, 0,
1227 /* 0x36 - 1600x1200@75Hz */
1229 1856, 2160, 1200, 1201, 1204, 1250, 0,
1231 /* 0x37 - 1600x1200@85Hz */
1233 1856, 2160, 1200, 1201, 1204, 1250, 0,
1235 /* 0x38 - 1600x1200@120Hz RB */
1237 1680, 1760, 1200, 1203, 1207, 1271, 0,
1239 /* 0x39 - 1680x1050@60Hz RB */
1241 1760, 1840, 1050, 1053, 1059, 1080, 0,
1243 /* 0x3a - 1680x1050@60Hz */
1245 1960, 2240, 1050, 1053, 1059, 1089, 0,
1247 /* 0x3b - 1680x1050@75Hz */
1249 1976, 2272, 1050, 1053, 1059, 1099, 0,
1251 /* 0x3c - 1680x1050@85Hz */
1253 1984, 2288, 1050, 1053, 1059, 1105, 0,
1255 /* 0x3d - 1680x1050@120Hz RB */
1257 1760, 1840, 1050, 1053, 1059, 1112, 0,
1259 /* 0x3e - 1792x1344@60Hz */
1261 2120, 2448, 1344, 1345, 1348, 1394, 0,
1263 /* 0x3f - 1792x1344@75Hz */
1265 2104, 2456, 1344, 1345, 1348, 1417, 0,
1267 /* 0x40 - 1792x1344@120Hz RB */
1269 1872, 1952, 1344, 1347, 1351, 1423, 0,
1271 /* 0x41 - 1856x1392@60Hz */
1273 2176, 2528, 1392, 1393, 1396, 1439, 0,
1275 /* 0x42 - 1856x1392@75Hz */
1277 2208, 2560, 1392, 1393, 1396, 1500, 0,
1279 /* 0x43 - 1856x1392@120Hz RB */
1281 1936, 2016, 1392, 1395, 1399, 1474, 0,
1283 /* 0x52 - 1920x1080@60Hz */
1285 2052, 2200, 1080, 1084, 1089, 1125, 0,
1287 /* 0x44 - 1920x1200@60Hz RB */
1289 2000, 2080, 1200, 1203, 1209, 1235, 0,
1291 /* 0x45 - 1920x1200@60Hz */
1293 2256, 2592, 1200, 1203, 1209, 1245, 0,
1295 /* 0x46 - 1920x1200@75Hz */
1297 2264, 2608, 1200, 1203, 1209, 1255, 0,
1299 /* 0x47 - 1920x1200@85Hz */
1301 2272, 2624, 1200, 1203, 1209, 1262, 0,
1303 /* 0x48 - 1920x1200@120Hz RB */
1305 2000, 2080, 1200, 1203, 1209, 1271, 0,
1307 /* 0x49 - 1920x1440@60Hz */
1309 2256, 2600, 1440, 1441, 1444, 1500, 0,
1311 /* 0x4a - 1920x1440@75Hz */
1313 2288, 2640, 1440, 1441, 1444, 1500, 0,
1315 /* 0x4b - 1920x1440@120Hz RB */
1317 2000, 2080, 1440, 1443, 1447, 1525, 0,
1319 /* 0x54 - 2048x1152@60Hz */
1321 2154, 2250, 1152, 1153, 1156, 1200, 0,
1323 /* 0x4c - 2560x1600@60Hz RB */
1325 2640, 2720, 1600, 1603, 1609, 1646, 0,
1327 /* 0x4d - 2560x1600@60Hz */
1329 3032, 3504, 1600, 1603, 1609, 1658, 0,
1331 /* 0x4e - 2560x1600@75Hz */
1333 3048, 3536, 1600, 1603, 1609, 1672, 0,
1335 /* 0x4f - 2560x1600@85Hz */
1337 3048, 3536, 1600, 1603, 1609, 1682, 0,
1339 /* 0x50 - 2560x1600@120Hz RB */
1341 2640, 2720, 1600, 1603, 1609, 1694, 0,
1343 /* 0x57 - 4096x2160@60Hz RB */
1345 4136, 4176, 2160, 2208, 2216, 2222, 0,
1347 /* 0x58 - 4096x2160@59.94Hz RB */
1349 4136, 4176, 2160, 2208, 2216, 2222, 0,
1365 968, 1056, 600, 601, 605, 628, 0,
1369 896, 1024, 600, 601, 603, 625, 0,
1373 720, 840, 480, 481, 484, 500, 0,
1377 704, 832, 480, 489, 492, 520, 0,
1381 768, 864, 480, 483, 486, 525, 0,
1385 752, 800, 480, 490, 492, 525, 0,
1389 846, 900, 400, 421, 423, 449, 0,
1393 846, 900, 400, 412, 414, 449, 0,
1397 1440, 1688, 1024, 1025, 1028, 1066, 0,
1401 1136, 1312, 768, 769, 772, 800, 0,
1405 1184, 1328, 768, 771, 777, 806, 0,
1409 1184, 1344, 768, 771, 777, 806, 0,
1413 1208, 1264, 768, 768, 776, 817, 0,
1418 928, 1152, 624, 625, 628, 667, 0,
1422 896, 1056, 600, 601, 604, 625, 0,
1426 976, 1040, 600, 637, 643, 666, 0,
1430 1344, 1600, 864, 865, 868, 900, 0,
1435 /* 0. vic:2 - 720x480@60Hz */
1437 798, 858, 480, 489, 495, 525, 0,
1442 798, 858, 480, 489, 495, 525, 0,
1447 1184, 1344, 768, 771, 777, 806, 0,
1449 /* 2. vic:4 - 1280x720@60Hz */
1451 1430, 1650, 720, 725, 730, 750, 0,
1456 2052, 2200, 1080, 1084, 1094, 1125, 0,
1462 801, 858, 480, 488, 494, 525, 0,
1468 2052, 2200, 1080, 1084, 1089, 1125, 0,
1473 796, 864, 576, 581, 586, 625, 0,
1478 796, 864, 576, 581, 586, 625, 0,
1481 /* 8. vic:19 - 1280x720@50Hz */
1483 1760, 1980, 720, 725, 730, 750, 0,
1488 2492, 2640, 1080, 1084, 1094, 1125, 0,
1494 795, 864, 576, 580, 586, 625, 0,
1500 2492, 2640, 1080, 1084, 1089, 1125, 0,
1505 2602, 2750, 1080, 1084, 1089, 1125, 0,
1510 2492, 2640, 1080, 1084, 1089, 1125, 0,
1515 2052, 2200, 1080, 1084, 1089, 1125, 0,
1520 2120, 2304, 1080, 1126, 1136, 1250, 0,
1524 /* 16. vic:60 - 1280x720@24Hz */
1526 3080, 3300, 720, 725, 730, 750, 0,
1529 /* 17. vic:61 - 1280x720@25Hz */
1531 3740, 3960, 720, 725, 730, 750, 0,
1534 /* 18. vic:62 - 1280x720@30Hz */
1536 3080, 3300, 720, 725, 730, 750, 0,
1541 5204, 5500, 2160, 2168, 2178, 2250, 0,
1546 4984, 5280, 2160, 2168, 2178, 2250, 0,
1551 4104, 4400, 2160, 2168, 2178, 2250, 0,
1556 4984, 5280, 2160, 2168, 2178, 2250, 0,
1561 4104, 4400, 2160, 2168, 2178, 2250, 0,
1566 5204, 5500, 2160, 2168, 2178, 2250, 0,
1571 5152, 5280, 2160, 2168, 2178, 2250, 0,
1576 4272, 4400, 2160, 2168, 2178, 2250, 0,
1581 5152, 5280, 2160, 2168, 2178, 2250, 0,
1586 4272, 4400, 2160, 2168, 2178, 2250, 0,
1591 4104, 4400, 2160, 2168, 2178, 2250, 0,
1596 8408, 9000, 4320, 4336, 4356, 4400, 0,
1601 10208, 10800, 4320, 4336, 4356, 4400, 0,
1606 8408, 9000, 4320, 4336, 4356, 4400, 0,
1620 { 640, 350, 85, 0 },
1621 { 640, 400, 85, 0 },
1622 { 720, 400, 85, 0 },
1623 { 640, 480, 85, 0 },
1624 { 848, 480, 60, 0 },
1625 { 800, 600, 85, 0 },
1626 { 1024, 768, 85, 0 },
1627 { 1152, 864, 75, 0 },
1630 { 1280, 768, 60, 0 },
1631 { 1280, 768, 75, 0 },
1632 { 1280, 768, 85, 0 },
1633 { 1280, 960, 60, 0 },
1634 { 1280, 960, 85, 0 },
1635 { 1280, 1024, 60, 0 },
1636 { 1280, 1024, 85, 0 },
1638 { 1360, 768, 60, 0 },
1640 { 1440, 900, 60, 0 },
1641 { 1440, 900, 75, 0 },
1642 { 1440, 900, 85, 0 },
1644 { 1400, 1050, 60, 0 },
1645 { 1400, 1050, 75, 0 },
1647 { 1400, 1050, 85, 0 },
1649 { 1680, 1050, 60, 0 },
1650 { 1680, 1050, 75, 0 },
1651 { 1680, 1050, 85, 0 },
1652 { 1600, 1200, 60, 0 },
1653 { 1600, 1200, 65, 0 },
1654 { 1600, 1200, 70, 0 },
1656 { 1600, 1200, 75, 0 },
1657 { 1600, 1200, 85, 0 },
1658 { 1792, 1344, 60, 0 },
1659 { 1792, 1344, 75, 0 },
1660 { 1856, 1392, 60, 0 },
1661 { 1856, 1392, 75, 0 },
1663 { 1920, 1200, 60, 0 },
1665 { 1920, 1200, 75, 0 },
1666 { 1920, 1200, 85, 0 },
1667 { 1920, 1440, 60, 0 },
1668 { 1920, 1440, 75, 0 },
1672 { 1024, 576, 60, 0 },
1673 { 1366, 768, 60, 0 },
1674 { 1600, 900, 60, 0 },
1675 { 1680, 945, 60, 0 },
1676 { 1920, 1080, 60, 0 },
1677 { 2048, 1152, 60, 0 },
1678 { 2048, 1536, 60, 0 },
1708 if ((edid_info == NULL) || (edid_info->version == 0)) in edid_check_info()
1714 if (edid_info->version == 0xff && edid_info->revision == 0xff) in edid_check_info()
1717 return 0; in edid_check_info()
1722 u8 checksum = 0; in edid_check_checksum()
1725 for (i = 0; i < 128; i++) in edid_check_checksum()
1728 return (checksum == 0) ? 0 : -EINVAL; in edid_check_checksum()
1738 *hmin = *hmax = *vmin = *vmax = 0; in edid_get_ranges()
1742 for (i = 0; i < ARRAY_SIZE(edid->monitor_details.descriptor); i++) { in edid_get_ranges()
1749 return 0; in edid_get_ranges()
1777 set_entry(&timing->pixelclock, (buf[0] + (buf[1] << 8)) * 10000); in decode_timing()
1778 x_mm = (buf[12] + ((buf[14] & 0xf0) << 4)); in decode_timing()
1779 y_mm = (buf[13] + ((buf[14] & 0x0f) << 8)); in decode_timing()
1780 ha = (buf[2] + ((buf[4] & 0xf0) << 4)); in decode_timing()
1781 hbl = (buf[3] + ((buf[4] & 0x0f) << 8)); in decode_timing()
1782 hso = (buf[8] + ((buf[11] & 0xc0) << 2)); in decode_timing()
1783 hspw = (buf[9] + ((buf[11] & 0x30) << 4)); in decode_timing()
1785 va = (buf[5] + ((buf[7] & 0xf0) << 4)); in decode_timing()
1786 vbl = (buf[6] + ((buf[7] & 0x0f) << 8)); in decode_timing()
1787 vso = ((buf[10] >> 4) + ((buf[11] & 0x0c) << 2)); in decode_timing()
1788 vspw = ((buf[10] & 0x0f) + ((buf[11] & 0x03) << 4)); in decode_timing()
1801 timing->flags = 0; in decode_timing()
1838 x_mm = (buf[12] + ((buf[14] & 0xf0) << 4)); in decode_mode()
1839 y_mm = (buf[13] + ((buf[14] & 0x0f) << 8)); in decode_mode()
1840 ha = (buf[2] + ((buf[4] & 0xf0) << 4)); in decode_mode()
1841 hbl = (buf[3] + ((buf[4] & 0x0f) << 8)); in decode_mode()
1842 hso = (buf[8] + ((buf[11] & 0xc0) << 2)); in decode_mode()
1843 hspw = (buf[9] + ((buf[11] & 0x30) << 4)); in decode_mode()
1845 va = (buf[5] + ((buf[7] & 0xf0) << 4)); in decode_mode()
1846 vbl = (buf[6] + ((buf[7] & 0x0f) << 8)); in decode_mode()
1847 vso = ((buf[10] >> 4) + ((buf[11] & 0x0c) << 2)); in decode_mode()
1848 vspw = ((buf[10] & 0x0f) + ((buf[11] & 0x03) << 4)); in decode_mode()
1852 mode->clock = (buf[0] + (buf[1] << 8)) * 10; in decode_mode()
1892 edid_vendor[0] = ((edid->mfg_id[0] & 0x7c) >> 2) + '@'; in edid_vendor()
1893 edid_vendor[1] = (((edid->mfg_id[0] & 0x3) << 3) | in edid_vendor()
1894 ((edid->mfg_id[1] & 0xe0) >> 5)) + '@'; in edid_vendor()
1895 edid_vendor[2] = (edid->mfg_id[1] & 0x1f) + '@'; in edid_vendor()
1907 u8 end, i = 0; in cea_is_hdmi_vsdb_present()
1911 if (end == 0) in cea_is_hdmi_vsdb_present()
1922 u32 oui = db[0] | (db[1] << 8) | (db[2] << 16); in cea_is_hdmi_vsdb_present()
1935 int refresh = 0; in drm_get_vrefresh()
1938 if (mode->vrefresh > 0) { in drm_get_vrefresh()
1940 } else if (mode->htotal > 0 && mode->vtotal > 0) { in drm_get_vrefresh()
1978 for (i = 0; i < 4; i++) { in edid_get_drm_mode()
1982 if (desc->zero_flag_1 != 0) { in edid_get_drm_mode()
2001 ((edid->video_input_definition & 0x70) >> 3) + 4; in edid_get_drm_mode()
2004 return 0; in edid_get_drm_mode()
2026 for (i = 0; i < 4; i++) { in edid_get_timing()
2030 if (desc->zero_flag_1 != 0) { in edid_get_timing()
2049 ((edid->video_input_definition & 0x70) >> 3) + 4; in edid_get_timing()
2061 return 0; in edid_get_timing()
2078 string[12] = '\0'; in snip()
2082 *s == '\0')) in snip()
2083 *(s--) = '\0'; in snip()
2101 if (bytes[0] == 0 && bytes[1] == 0) { in edid_print_dtd()
2133 if (v_total > 0 && h_total > 0) in edid_print_dtd()
2151 name[0] = EDID1_INFO_MANUFACTURER_NAME_CHAR1(*edid) + 'A' - 1; in edid_get_manufacturer_name()
2154 name[3] = '\0'; in edid_get_manufacturer_name()
2161 unsigned int have_timing = 0; in edid_print_info()
2178 if (serial_number != 0xffffffff) { in edid_print_info()
2179 if (strcmp(manufacturer, "MAG") == 0) in edid_print_info()
2180 serial_number -= 0x7000000; in edid_print_info()
2181 if (strcmp(manufacturer, "OQI") == 0) in edid_print_info()
2183 if (strcmp(manufacturer, "VSC") == 0) in edid_print_info()
2256 for (i = 0; i < ARRAY_SIZE(edid_info->standard_timings); i++) { in edid_print_info()
2264 ((xres != 0) && (xres != 1)) || in edid_print_info()
2265 ((vfreq != 0) && (vfreq != 1))) { in edid_print_info()
2284 x > 1000 ? ' ' : '\t', (vfreq & 0x3f) + 60); in edid_print_info()
2290 for (i = 0; i < ARRAY_SIZE(edid_info->monitor_details.descriptor); in edid_print_info()
2365 hmargin = 0; in drm_cvt_mode()
2380 vmargin = 0; in drm_cvt_mode()
2390 interlace = 0; in drm_cvt_mode()
2523 return db[0] & 0x1f; in cea_db_payload_len()
2535 return db[0] >> 5; in cea_db_tag()
2555 if (*end == 0) in cea_db_offsets()
2576 return 0; in cea_db_offsets()
2639 return vic > 0 && vic < ARRAY_SIZE(edid_4k_modes); in drm_valid_hdmi_vic()
2659 /* 0-6 bit vic, 7th bit native mode indicator */ in svd_to_vic()
2686 newmode->vrefresh = 0; in drm_display_mode_from_vic_index()
2698 while (len - bits_to_set >= 0) { in bitmap_set()
2702 mask_to_set = ~0UL; in bitmap_set()
2724 int i, modes = 0; in do_cea_modes()
2727 for (i = 0; i < len; i++) { in do_cea_modes()
2737 * For example, if the bit 0 in bitmap is set, in do_cea_modes()
2766 int modes = 0, i; in do_y420vdb_modes()
2769 for (i = 0; i < svds_len; i++) { in do_y420vdb_modes()
2816 int num = data->modes, modes = 0, i, k; in add_hdmi_mandatory_stereo_modes()
2818 for (k = 0; k < num; k++) { in add_hdmi_mandatory_stereo_modes()
2820 for (i = 0; i < ARRAY_SIZE(stereo_mandatory_modes); i++) { in add_hdmi_mandatory_stereo_modes()
2848 int modes = 0; in add_3d_struct_modes()
2850 if (structure & (1 << 0)) { in add_3d_struct_modes()
2891 return 0; in add_hdmi_mode()
2911 int modes = 0, offset = 0, i, multi_present = 0, multi_len; in do_hdmi_vsdb_modes()
2912 u8 vic_len, hdmi_3d_len = 0; in do_hdmi_vsdb_modes()
2943 multi_present = (db[8 + offset] & 0x60) >> 5; in do_hdmi_vsdb_modes()
2948 hdmi_3d_len = db[8 + offset] & 0x1f; in do_hdmi_vsdb_modes()
2950 for (i = 0; i < vic_len && len >= (9 + offset + i); i++) { in do_hdmi_vsdb_modes()
2964 multi_len = 0; in do_hdmi_vsdb_modes()
2980 mask = 0xffff; in do_hdmi_vsdb_modes()
2982 for (i = 0; i < 16; i++) { in do_hdmi_vsdb_modes()
2993 for (i = 0; i < (hdmi_3d_len - multi_len); i++) { in do_hdmi_vsdb_modes()
2996 unsigned int newflag = 0; in do_hdmi_vsdb_modes()
2999 detail_present = ((db[8 + offset + i] & 0x0f) > 7); in do_hdmi_vsdb_modes()
3008 switch (db[8 + offset + i] & 0x0f) { in do_hdmi_vsdb_modes()
3009 case 0: in do_hdmi_vsdb_modes()
3022 if (newflag != 0) { in do_hdmi_vsdb_modes()
3055 for (i = 0; i < ARRAY_SIZE(edid_quirk_list); i++) { in edid_get_quirks()
3063 return 0; in edid_get_quirks()
3073 u64 map = 0; in drm_parse_y420cmdb_bitmap()
3075 if (map_len == 0) { in drm_parse_y420cmdb_bitmap()
3084 * from VDB can support YCBCR420 output too. So if bit=0 is in drm_parse_y420cmdb_bitmap()
3097 for (count = 0; count < map_len; count++) in drm_parse_y420cmdb_bitmap()
3134 case 0: in drm_get_max_frl_rate()
3136 *max_lanes = 0; in drm_get_max_frl_rate()
3137 *max_rate_per_lane = 0; in drm_get_max_frl_rate()
3157 if (hf_vsdb[6] & 0x80) { in drm_parse_hdmi_forum_vsdb()
3159 if (hf_vsdb[6] & 0x40) in drm_parse_hdmi_forum_vsdb()
3187 if ((hf_vsdb[6] & 0x8)) in drm_parse_hdmi_forum_vsdb()
3216 hdmi_dsc->bpc_supported = 0; in drm_parse_hdmi_forum_vsdb()
3254 case 0: in drm_parse_hdmi_forum_vsdb()
3256 hdmi_dsc->max_slices = 0; in drm_parse_hdmi_forum_vsdb()
3257 hdmi_dsc->clk_per_slice = 0; in drm_parse_hdmi_forum_vsdb()
3287 unsigned int dc_bpc = 0; in drm_parse_hdmi_deep_color_info()
3313 if (dc_bpc == 0) { in drm_parse_hdmi_deep_color_info()
3348 for (i = 0; i < edid->extensions; i++) { in drm_find_edid_extension()
3350 if (edid_ext[0] == ext_id) in drm_find_edid_extension()
3362 return drm_find_edid_extension(edid, 0x02); in drm_find_cea_extension()
3365 #define AUDIO_BLOCK 0x01
3366 #define VIDEO_BLOCK 0x02
3367 #define VENDOR_BLOCK 0x03
3368 #define SPEAKER_BLOCK 0x04
3427 has_audio = ((edid_ext[3] & EDID_BASIC_AUDIO) != 0); in drm_detect_monitor_audio()
3443 (edid_ext[i + j] >> 3) & 0xf); in drm_detect_monitor_audio()
3508 info->bpc = 0; in drm_add_display_info()
3509 info->color_formats = 0; in drm_add_display_info()
3510 info->cea_rev = 0; in drm_add_display_info()
3511 info->max_tmds_clock = 0; in drm_add_display_info()
3513 info->edid_hdmi_dc_modes = 0; in drm_add_display_info()
3515 memset(&info->hdmi, 0, sizeof(info->hdmi)); in drm_add_display_info()
3532 if ((info->bpc == 0) && (edid->revision < 4) && in drm_add_display_info()
3563 info->bpc = 0; in drm_add_display_info()
3582 u8 dbl, hdmi_len, video_len = 0; in add_cea_modes()
3583 int modes = 0; in add_cea_modes()
3589 return 0; in add_cea_modes()
3605 /* Add 4:2:0(only) modes present in EDID */ in add_cea_modes()
3628 int i, n = 0; in cea_for_each_detailed_block()
3629 u8 d = ext[0x02]; in cea_for_each_detailed_block()
3636 for (i = 0; i < n; i++) in cea_for_each_detailed_block()
3643 unsigned int i, n = min((int)ext[0x02], 6); in vtb_for_each_detailed_block()
3646 if (ext[0x01] != 1) in vtb_for_each_detailed_block()
3649 for (i = 0; i < n; i++) in vtb_for_each_detailed_block()
3662 for (i = 0; i < EDID_DETAILED_TIMINGS; i++) in drm_for_each_detailed_block()
3665 for (i = 1; i <= raw_edid[0x7e]; i++) { in drm_for_each_detailed_block()
3710 for (i = 0; i < ARRAY_SIZE(cea_interlaced); i++) { in drm_mode_do_interlace_quirk()
3740 unsigned hactive = (pt->hactive_hblank_hi & 0xf0) << 4 | pt->hactive_lo; in drm_mode_detailed()
3741 unsigned vactive = (pt->vactive_vblank_hi & 0xf0) << 4 | pt->vactive_lo; in drm_mode_detailed()
3742 unsigned hblank = (pt->hactive_hblank_hi & 0xf) << 8 | pt->hblank_lo; in drm_mode_detailed()
3743 unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo; in drm_mode_detailed()
3745 (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) << 2 | in drm_mode_detailed()
3748 (pt->hsync_vsync_offset_pulse_width_hi & 0x30) << 4 | in drm_mode_detailed()
3750 unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) << in drm_mode_detailed()
3753 (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 4 | in drm_mode_detailed()
3754 (pt->vsync_offset_pulse_width_lo & 0xf); in drm_mode_detailed()
3835 if (cea_mode->vrefresh % 6 != 0) in cea_mode_alternate_clock()
3913 return 0; in drm_match_cea_mode_clock_tolerance()
3931 return 0; in drm_match_cea_mode_clock_tolerance()
3950 return 0; in drm_match_hdmi_mode_clock_tolerance()
3968 return 0; in drm_match_hdmi_mode_clock_tolerance()
4039 closure->preferred = 0; in do_detailed_mode()
4072 int i, j, modes = 0; in drm_cvt_modes()
4076 const u8 empty[3] = { 0, 0, 0 }; in drm_cvt_modes()
4078 for (i = 0; i < 4; i++) { in drm_cvt_modes()
4086 height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2; in drm_cvt_modes()
4087 switch (cvt->code[1] & 0x0c) { in drm_cvt_modes()
4088 case 0x00: in drm_cvt_modes()
4091 case 0x04: in drm_cvt_modes()
4094 case 0x08: in drm_cvt_modes()
4097 case 0x0c: in drm_cvt_modes()
4105 rates[j], j == 0, in drm_cvt_modes()
4150 if (r[3] == EDID_DETAIL_MONITOR_RANGE && r[10] == 0x02) in find_gtf2()
4161 return r ? (r[12] * 2) : 0; in drm_gtf2_hbreak()
4170 return r ? r[13] : 0; in drm_gtf2_2c()
4179 return r ? (r[15] << 8) + r[14] : 0; in drm_gtf2_m()
4188 return r ? r[16] : 0; in drm_gtf2_k()
4197 return r ? r[17] : 0; in drm_gtf2_2j()
4218 * 0 is reserved. The spec says 0x01 fill for unused timings. Some old
4219 * monitors fill with ascii space (0x20) instead.
4224 return (a == 0x00 && b == 0x00) || in bad_std_timing()
4225 (a == 0x01 && b == 0x01) || in bad_std_timing()
4226 (a == 0x20 && b == 0x20); in bad_std_timing()
4235 if (r[15] & 0x10) in is_rb()
4250 return ((edid->input & DRM_EDID_INPUT_DIGITAL) != 0); in drm_monitor_supports_rb()
4280 for (i = 0; i < ARRAY_SIZE(drm_dmt_modes); i++) { in drm_mode_find_dmt()
4360 top_margin = 0; in drm_gtf_mode_complex()
4371 interlace = 0; in drm_gtf_mode_complex()
4412 left_margin = 0; in drm_gtf_mode_complex()
4523 if (mode->htotal < 0) in drm_mode_hsync()
4524 return 0; in drm_mode_hsync()
4564 if (aspect_ratio == 0) { in drm_mode_std()
4591 for (i = 0; i < num; i++) in drm_mode_std()
4599 mode = drm_cvt_mode(1366, 768, vrefresh_rate, 0, 0, in drm_mode_std()
4624 mode = drm_gtf_mode(hsize, vsize, vrefresh_rate, 0, 0); in drm_mode_std()
4632 mode = drm_gtf_mode(hsize, vsize, vrefresh_rate, 0, 0); in drm_mode_std()
4638 vrefresh_rate, 0, 0, in drm_mode_std()
4646 mode = drm_cvt_mode(hsize, vsize, vrefresh_rate, 0, 0, in drm_mode_std()
4664 for (i = 0; i < 6; i++) { in do_standard_modes()
4690 int i, modes = 0; in add_standard_modes()
4696 for (i = 0; i < EDID_STD_TIMINGS; i++) { in add_standard_modes()
4708 if (version_greater(edid, 1, 0)) in add_standard_modes()
4720 int i, j, m, modes = 0; in drm_est3_modes()
4724 for (i = 0; i < 6; i++) { in drm_est3_modes()
4725 for (j = 7; j >= 0; j--) { in drm_est3_modes()
4770 ((edid->established_timings.mfg_rsvd & 0x80) << 9); in add_established_modes()
4771 int i, modes = 0; in add_established_modes()
4777 for (i = 0; i <= EDID_EST_TIMINGS; i++) { in add_established_modes()
4789 if (version_greater(edid, 1, 0)) in add_established_modes()
4801 return 0; in drm_match_hdmi_mode()
4816 return 0; in drm_match_hdmi_mode()
4823 int i, num, modes = 0; in add_alternate_cea_modes()
4827 return 0; in add_alternate_cea_modes()
4835 for (i = 0; i < num; i++) { in add_alternate_cea_modes()
4899 u8 csum = 0; in validate_displayid()
4904 debug("base revision 0x%x, length %d, %d %d\n", in validate_displayid()
4915 return 0; in validate_displayid()
4923 unsigned pixel_clock = (timings->pixel_clock[0] | in drm_displayid_detailed()
4926 unsigned hactive = (timings->hactive[0] | timings->hactive[1] << 8) + 1; in drm_displayid_detailed()
4927 unsigned hblank = (timings->hblank[0] | timings->hblank[1] << 8) + 1; in drm_displayid_detailed()
4928 unsigned hsync = (timings->hsync[0] | in drm_displayid_detailed()
4929 (timings->hsync[1] & 0x7f) << 8) + 1; in drm_displayid_detailed()
4930 unsigned hsync_width = (timings->hsw[0] | timings->hsw[1] << 8) + 1; in drm_displayid_detailed()
4931 unsigned vactive = (timings->vactive[0] | in drm_displayid_detailed()
4933 unsigned vblank = (timings->vblank[0] | timings->vblank[1] << 8) + 1; in drm_displayid_detailed()
4934 unsigned vsync = (timings->vsync[0] | in drm_displayid_detailed()
4935 (timings->vsync[1] & 0x7f) << 8) + 1; in drm_displayid_detailed()
4936 unsigned vsync_width = (timings->vsw[0] | timings->vsw[1] << 8) + 1; in drm_displayid_detailed()
4937 bool hsync_positive = (timings->hsync[1] >> 7) & 0x1; in drm_displayid_detailed()
4938 bool vsync_positive = (timings->vsync[1] >> 7) & 0x1; in drm_displayid_detailed()
4955 mode->flags = 0; in drm_displayid_detailed()
4962 if (timings->flags & 0x80) in drm_displayid_detailed()
4976 int num_modes = 0; in add_displayid_detailed_1_modes()
4981 return 0; in add_displayid_detailed_1_modes()
4984 for (i = 0; i < num_timings; i++) { in add_displayid_detailed_1_modes()
5007 int num_modes = 0; in add_displayid_detailed_modes()
5011 return 0; in add_displayid_detailed_modes()
5015 return 0; in add_displayid_detailed_modes()
5021 length && block->num_bytes > 0) { in add_displayid_detailed_modes()
5041 hmin += ((t[4] & 0x04) ? 255 : 0); in mode_in_hsync_range()
5044 hmax += ((t[4] & 0x08) ? 255 : 0); in mode_in_hsync_range()
5058 vmin += ((t[4] & 0x01) ? 255 : 0); in mode_in_vsync_range()
5061 vmax += ((t[4] & 0x02) ? 255 : 0); in mode_in_vsync_range()
5071 if (t[9] == 0 || t[9] == 255) in range_pixel_clock()
5072 return 0; in range_pixel_clock()
5075 if (edid->revision >= 4 && t[10] == 0x04) in range_pixel_clock()
5101 if (edid->revision >= 4 && t[10] == 0x04) in mode_in_range()
5103 (t[13] + (256 * (t[12] & 0x3)))) in mode_in_range()
5119 for (i = 0; i < data->modes; i++) { in valid_inferred_mode()
5136 int i, modes = 0; in drm_dmt_modes_for_range()
5138 for (i = 0; i < ARRAY_SIZE(drm_dmt_modes); i++) { in drm_dmt_modes_for_range()
5165 int i, modes = 0; in drm_gtf_modes_for_range()
5168 for (i = 0; i < ARRAY_SIZE(extra_modes); i++) { in drm_gtf_modes_for_range()
5171 newmode = drm_gtf_mode(m->w, m->h, m->r, 0, 0); in drm_gtf_modes_for_range()
5194 int i, modes = 0; in drm_cvt_modes_for_range()
5198 for (i = 0; i < ARRAY_SIZE(extra_modes); i++) { in drm_cvt_modes_for_range()
5201 newmode = drm_cvt_mode(m->w, m->h, m->r, rb, 0, 0); in drm_cvt_modes_for_range()
5238 case 0x02: /* secondary gtf, XXX could do more */ in do_inferred_modes()
5239 case 0x00: /* default gtf */ in do_inferred_modes()
5244 case 0x04: /* cvt, only in 1.4+ */ in do_inferred_modes()
5252 case 0x01: /* just the ranges, no formula */ in do_inferred_modes()
5266 if (version_greater(edid, 1, 0)) in add_inferred_modes()
5288 int i, target_refresh = 0; in edid_fixup_preferred()
5302 for (i = 0; i < num; i++) { in edid_fixup_preferred()
5329 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x00
5338 * Return: 8 if the header is perfect, down to 0 if it's totally wrong.
5342 int i, score = 0; in drm_edid_header_is_valid()
5344 for (i = 0; i < sizeof(edid_header); i++) in drm_edid_header_is_valid()
5354 u8 csum = 0; in drm_edid_block_checksum()
5356 for (i = 0; i < EDID_SIZE; i++) in drm_edid_block_checksum()
5364 if (memchr_inv(in_edid, 0, length)) in drm_edid_is_zero()
5373 * @block: type of block to validate (0 for base, extension otherwise)
5393 if (block == 0) { in drm_edid_block_valid()
5427 if (raw_edid[0] != 0x02) in drm_edid_block_valid()
5432 switch (raw_edid[0]) { in drm_edid_block_valid()
5433 case 0: /* base */ in drm_edid_block_valid()
5479 for (i = 0; i <= edid->extensions; i++) in drm_edid_is_valid()
5493 * Return: The number of modes added or 0 if we couldn't find any.
5497 int num_modes = 0; in drm_add_edid_modes()
5503 return 0; in drm_add_edid_modes()
5508 return 0; in drm_add_edid_modes()
5513 return 0; in drm_add_edid_modes()
5549 if (num_modes > 0) in drm_add_edid_modes()
5550 data->preferred_mode = &data->mode_buf[0]; in drm_add_edid_modes()
5576 return 0; in drm_match_cea_mode()
5592 return 0; in drm_match_cea_mode()
5616 if (err < 0) in drm_hdmi_avi_infoframe_from_display_mode()
5630 frame->video_code = 0; in drm_hdmi_avi_infoframe_from_display_mode()
5643 frame->video_code = 0; in drm_hdmi_avi_infoframe_from_display_mode()
5655 else if (frame->video_code > 0) in drm_hdmi_avi_infoframe_from_display_mode()
5664 return 0; in drm_hdmi_avi_infoframe_from_display_mode()
5671 * Returns 0 on success or a negative error code on failure.
5675 memset(frame, 0, sizeof(*frame)); in hdmi_vendor_infoframe_init()
5683 * 0 is a valid value for s3d_struct, so we use a special "not set" in hdmi_vendor_infoframe_init()
5688 return 0; in hdmi_vendor_infoframe_init()
5712 * default RGB quantization range for the mode, even when QS=0. in drm_hdmi_avi_infoframe_quant_range()
5724 * (e.g., when Limited Range RGB, set YQ=0 or when Full Range RGB, in drm_hdmi_avi_infoframe_quant_range()
5784 if (err < 0) in drm_hdmi_vendor_infoframe_from_display_mode()
5792 return 0; in drm_hdmi_vendor_infoframe_from_display_mode()
5797 u8 csum = 0; in hdmi_infoframe_checksum()
5801 for (i = 0; i < size; i++) in hdmi_infoframe_checksum()
5818 * Returns 0 on success or a negative error code on failure.
5822 memset(frame, 0, sizeof(*frame)); in hdmi_avi_infoframe_init()
5828 return 0; in hdmi_avi_infoframe_init()
5857 memset(buffer, 0, size); in hdmi_avi_infoframe_pack()
5859 ptr[0] = frame->type; in hdmi_avi_infoframe_pack()
5862 ptr[3] = 0; /* checksum */ in hdmi_avi_infoframe_pack()
5867 ptr[0] = ((frame->colorspace & 0x3) << 5) | (frame->scan_mode & 0x3); in hdmi_avi_infoframe_pack()
5873 if (frame->active_aspect & 0xf) in hdmi_avi_infoframe_pack()
5874 ptr[0] |= BIT(4); in hdmi_avi_infoframe_pack()
5878 ptr[0] |= BIT(3); in hdmi_avi_infoframe_pack()
5881 ptr[0] |= BIT(2); in hdmi_avi_infoframe_pack()
5883 ptr[1] = ((frame->colorimetry & 0x3) << 6) | in hdmi_avi_infoframe_pack()
5884 ((frame->picture_aspect & 0x3) << 4) | in hdmi_avi_infoframe_pack()
5885 (frame->active_aspect & 0xf); in hdmi_avi_infoframe_pack()
5887 ptr[2] = ((frame->extended_colorimetry & 0x7) << 4) | in hdmi_avi_infoframe_pack()
5888 ((frame->quantization_range & 0x3) << 2) | in hdmi_avi_infoframe_pack()
5889 (frame->nups & 0x3); in hdmi_avi_infoframe_pack()
5894 ptr[3] = frame->video_code & 0x7f; in hdmi_avi_infoframe_pack()
5896 ptr[4] = ((frame->ycc_quantization_range & 0x3) << 6) | in hdmi_avi_infoframe_pack()
5897 ((frame->content_type & 0x3) << 4) | in hdmi_avi_infoframe_pack()
5898 (frame->pixel_repeat & 0xf); in hdmi_avi_infoframe_pack()
5900 ptr[5] = frame->top_bar & 0xff; in hdmi_avi_infoframe_pack()
5901 ptr[6] = (frame->top_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack()
5902 ptr[7] = frame->bottom_bar & 0xff; in hdmi_avi_infoframe_pack()
5903 ptr[8] = (frame->bottom_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack()
5904 ptr[9] = frame->left_bar & 0xff; in hdmi_avi_infoframe_pack()
5905 ptr[10] = (frame->left_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack()
5906 ptr[11] = frame->right_bar & 0xff; in hdmi_avi_infoframe_pack()
5907 ptr[12] = (frame->right_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack()
5925 return 0; in hdmi_avi_infoframe_check_only()
5935 * Returns 0 on success or a negative error code on failure.
5973 memset(buffer, 0, size); in hdmi_avi_infoframe_pack_only()
5975 ptr[0] = frame->type; in hdmi_avi_infoframe_pack_only()
5978 ptr[3] = 0; /* checksum */ in hdmi_avi_infoframe_pack_only()
5983 ptr[0] = ((frame->colorspace & 0x3) << 5) | (frame->scan_mode & 0x3); in hdmi_avi_infoframe_pack_only()
5989 if (frame->active_aspect & 0xf) in hdmi_avi_infoframe_pack_only()
5990 ptr[0] |= BIT(4); in hdmi_avi_infoframe_pack_only()
5994 ptr[0] |= BIT(3); in hdmi_avi_infoframe_pack_only()
5997 ptr[0] |= BIT(2); in hdmi_avi_infoframe_pack_only()
5999 ptr[1] = ((frame->colorimetry & 0x3) << 6) | in hdmi_avi_infoframe_pack_only()
6000 ((frame->picture_aspect & 0x3) << 4) | in hdmi_avi_infoframe_pack_only()
6001 (frame->active_aspect & 0xf); in hdmi_avi_infoframe_pack_only()
6003 ptr[2] = ((frame->extended_colorimetry & 0x7) << 4) | in hdmi_avi_infoframe_pack_only()
6004 ((frame->quantization_range & 0x3) << 2) | in hdmi_avi_infoframe_pack_only()
6005 (frame->nups & 0x3); in hdmi_avi_infoframe_pack_only()
6010 ptr[3] = frame->video_code & 0xff; in hdmi_avi_infoframe_pack_only()
6012 ptr[4] = ((frame->ycc_quantization_range & 0x3) << 6) | in hdmi_avi_infoframe_pack_only()
6013 ((frame->content_type & 0x3) << 4) | in hdmi_avi_infoframe_pack_only()
6014 (frame->pixel_repeat & 0xf); in hdmi_avi_infoframe_pack_only()
6016 ptr[5] = frame->top_bar & 0xff; in hdmi_avi_infoframe_pack_only()
6017 ptr[6] = (frame->top_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
6018 ptr[7] = frame->bottom_bar & 0xff; in hdmi_avi_infoframe_pack_only()
6019 ptr[8] = (frame->bottom_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
6020 ptr[9] = frame->left_bar & 0xff; in hdmi_avi_infoframe_pack_only()
6021 ptr[10] = (frame->left_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
6022 ptr[11] = frame->right_bar & 0xff; in hdmi_avi_infoframe_pack_only()
6023 ptr[12] = (frame->right_bar >> 8) & 0xff; in hdmi_avi_infoframe_pack_only()
6037 * Returns 0 on success or a negative error code on failure.
6042 memset(frame, 0, sizeof(*frame)); in hdmi_spd_infoframe_init()
6051 return 0; in hdmi_spd_infoframe_init()
6080 memset(buffer, 0, size); in hdmi_spd_infoframe_pack()
6082 ptr[0] = frame->type; in hdmi_spd_infoframe_pack()
6085 ptr[3] = 0; /* checksum */ in hdmi_spd_infoframe_pack()
6105 * Returns 0 on success or a negative error code on failure.
6109 memset(frame, 0, sizeof(*frame)); in hdmi_audio_infoframe_init()
6115 return 0; in hdmi_audio_infoframe_init()
6144 memset(buffer, 0, size); in hdmi_audio_infoframe_pack()
6149 channels = 0; in hdmi_audio_infoframe_pack()
6151 ptr[0] = frame->type; in hdmi_audio_infoframe_pack()
6154 ptr[3] = 0; /* checksum */ in hdmi_audio_infoframe_pack()
6159 ptr[0] = ((frame->coding_type & 0xf) << 4) | (channels & 0x7); in hdmi_audio_infoframe_pack()
6160 ptr[1] = ((frame->sample_frequency & 0x7) << 2) | in hdmi_audio_infoframe_pack()
6161 (frame->sample_size & 0x3); in hdmi_audio_infoframe_pack()
6162 ptr[2] = frame->coding_type_ext & 0x1f; in hdmi_audio_infoframe_pack()
6164 ptr[4] = (frame->level_shift_value & 0xf) << 3; in hdmi_audio_infoframe_pack()
6195 if (frame->vic == 0 && frame->s3d_struct == HDMI_3D_STRUCTURE_INVALID) in hdmi_vendor_infoframe_pack()
6199 if (frame->vic != 0 && frame->s3d_struct != HDMI_3D_STRUCTURE_INVALID) in hdmi_vendor_infoframe_pack()
6213 memset(buffer, 0, size); in hdmi_vendor_infoframe_pack()
6215 ptr[0] = frame->type; in hdmi_vendor_infoframe_pack()
6218 ptr[3] = 0; /* checksum */ in hdmi_vendor_infoframe_pack()
6221 ptr[4] = 0x03; in hdmi_vendor_infoframe_pack()
6222 ptr[5] = 0x0c; in hdmi_vendor_infoframe_pack()
6223 ptr[6] = 0x00; in hdmi_vendor_infoframe_pack()
6226 ptr[7] = 0x1 << 5; /* video format */ in hdmi_vendor_infoframe_pack()
6229 ptr[7] = 0x2 << 5; /* video format */ in hdmi_vendor_infoframe_pack()
6230 ptr[8] = (frame->s3d_struct & 0xf) << 4; in hdmi_vendor_infoframe_pack()
6232 ptr[9] = (frame->s3d_ext_data & 0xf) << 4; in hdmi_vendor_infoframe_pack()
6245 * Returns 0 on success or a negative error code on failure.
6249 memset(frame, 0, sizeof(*frame)); in hdmi_drm_infoframe_init()
6254 return 0; in hdmi_drm_infoframe_init()
6282 memset(buffer, 0, size); in hdmi_drm_infoframe_pack()
6284 ptr[0] = frame->type; in hdmi_drm_infoframe_pack()
6287 ptr[3] = 0; /* checksum */ in hdmi_drm_infoframe_pack()
6292 ptr[0] = frame->eotf; in hdmi_drm_infoframe_pack()
6295 ptr[2] = frame->display_primaries_x[0] & 0xff; in hdmi_drm_infoframe_pack()
6296 ptr[3] = frame->display_primaries_x[0] >> 8; in hdmi_drm_infoframe_pack()
6298 ptr[4] = frame->display_primaries_x[1] & 0xff; in hdmi_drm_infoframe_pack()
6301 ptr[6] = frame->display_primaries_x[2] & 0xff; in hdmi_drm_infoframe_pack()
6304 ptr[9] = frame->display_primaries_y[0] & 0xff; in hdmi_drm_infoframe_pack()
6305 ptr[10] = frame->display_primaries_y[0] >> 8; in hdmi_drm_infoframe_pack()
6307 ptr[11] = frame->display_primaries_y[1] & 0xff; in hdmi_drm_infoframe_pack()
6310 ptr[13] = frame->display_primaries_y[2] & 0xff; in hdmi_drm_infoframe_pack()
6313 ptr[15] = frame->white_point_x & 0xff; in hdmi_drm_infoframe_pack()
6316 ptr[17] = frame->white_point_y & 0xff; in hdmi_drm_infoframe_pack()
6319 ptr[19] = frame->max_mastering_display_luminance & 0xff; in hdmi_drm_infoframe_pack()
6322 ptr[21] = frame->min_mastering_display_luminance & 0xff; in hdmi_drm_infoframe_pack()
6325 ptr[23] = frame->max_cll & 0xff; in hdmi_drm_infoframe_pack()
6328 ptr[25] = frame->max_fall & 0xff; in hdmi_drm_infoframe_pack()
6404 * Returns 0 on success or a negative error code on failure.
6412 if (ptr[0] != HDMI_INFOFRAME_TYPE_AVI || in hdmi_avi_infoframe_unpack()
6417 if (hdmi_infoframe_checksum(buffer, HDMI_INFOFRAME_SIZE(AVI)) != 0) in hdmi_avi_infoframe_unpack()
6426 frame->colorspace = (ptr[0] >> 5) & 0x3; in hdmi_avi_infoframe_unpack()
6427 if (ptr[0] & 0x10) in hdmi_avi_infoframe_unpack()
6428 frame->active_aspect = ptr[1] & 0xf; in hdmi_avi_infoframe_unpack()
6429 if (ptr[0] & 0x8) { in hdmi_avi_infoframe_unpack()
6433 if (ptr[0] & 0x4) { in hdmi_avi_infoframe_unpack()
6437 frame->scan_mode = ptr[0] & 0x3; in hdmi_avi_infoframe_unpack()
6439 frame->colorimetry = (ptr[1] >> 6) & 0x3; in hdmi_avi_infoframe_unpack()
6440 frame->picture_aspect = (ptr[1] >> 4) & 0x3; in hdmi_avi_infoframe_unpack()
6441 frame->active_aspect = ptr[1] & 0xf; in hdmi_avi_infoframe_unpack()
6443 frame->itc = ptr[2] & 0x80 ? true : false; in hdmi_avi_infoframe_unpack()
6444 frame->extended_colorimetry = (ptr[2] >> 4) & 0x7; in hdmi_avi_infoframe_unpack()
6445 frame->quantization_range = (ptr[2] >> 2) & 0x3; in hdmi_avi_infoframe_unpack()
6446 frame->nups = ptr[2] & 0x3; in hdmi_avi_infoframe_unpack()
6448 frame->video_code = ptr[3] & 0x7f; in hdmi_avi_infoframe_unpack()
6449 frame->ycc_quantization_range = (ptr[4] >> 6) & 0x3; in hdmi_avi_infoframe_unpack()
6450 frame->content_type = (ptr[4] >> 4) & 0x3; in hdmi_avi_infoframe_unpack()
6452 frame->pixel_repeat = ptr[4] & 0xf; in hdmi_avi_infoframe_unpack()
6454 return 0; in hdmi_avi_infoframe_unpack()
6467 * Returns 0 on success or a negative error code on failure.
6475 if (ptr[0] != HDMI_INFOFRAME_TYPE_SPD || in hdmi_spd_infoframe_unpack()
6481 if (hdmi_infoframe_checksum(buffer, HDMI_INFOFRAME_SIZE(SPD)) != 0) in hdmi_spd_infoframe_unpack()
6492 return 0; in hdmi_spd_infoframe_unpack()
6505 * Returns 0 on success or a negative error code on failure.
6513 if (ptr[0] != HDMI_INFOFRAME_TYPE_AUDIO || in hdmi_audio_infoframe_unpack()
6519 if (hdmi_infoframe_checksum(buffer, HDMI_INFOFRAME_SIZE(AUDIO)) != 0) in hdmi_audio_infoframe_unpack()
6528 frame->channels = ptr[0] & 0x7; in hdmi_audio_infoframe_unpack()
6529 frame->coding_type = (ptr[0] >> 4) & 0xf; in hdmi_audio_infoframe_unpack()
6530 frame->sample_size = ptr[1] & 0x3; in hdmi_audio_infoframe_unpack()
6531 frame->sample_frequency = (ptr[1] >> 2) & 0x7; in hdmi_audio_infoframe_unpack()
6532 frame->coding_type_ext = ptr[2] & 0x1f; in hdmi_audio_infoframe_unpack()
6534 frame->level_shift_value = (ptr[4] >> 3) & 0xf; in hdmi_audio_infoframe_unpack()
6535 frame->downmix_inhibit = ptr[4] & 0x80 ? true : false; in hdmi_audio_infoframe_unpack()
6537 return 0; in hdmi_audio_infoframe_unpack()
6550 * Returns 0 on success or a negative error code on failure.
6562 if (ptr[0] != HDMI_INFOFRAME_TYPE_VENDOR || in hdmi_vendor_any_infoframe_unpack()
6570 HDMI_INFOFRAME_HEADER_SIZE + length) != 0) in hdmi_vendor_any_infoframe_unpack()
6576 if (ptr[0] != 0x03 || in hdmi_vendor_any_infoframe_unpack()
6577 ptr[1] != 0x0c || in hdmi_vendor_any_infoframe_unpack()
6578 ptr[2] != 0x00) in hdmi_vendor_any_infoframe_unpack()
6583 if (hdmi_video_format > 0x2) in hdmi_vendor_any_infoframe_unpack()
6592 if (hdmi_video_format == 0x2) { in hdmi_vendor_any_infoframe_unpack()
6601 } else if (hdmi_video_format == 0x1) { in hdmi_vendor_any_infoframe_unpack()
6610 return 0; in hdmi_vendor_any_infoframe_unpack()
6623 * Returns 0 on success or a negative error code on failure.
6630 switch (ptr[0]) { in hdmi_infoframe_unpack()
6663 for (i = 0; i < (edid_data->modes - 1); i++) { in drm_mode_sort()
6667 diff = ((b->type & DRM_MODE_TYPE_PREFERRED) != 0) - in drm_mode_sort()
6668 ((a->type & DRM_MODE_TYPE_PREFERRED) != 0); in drm_mode_sort()
6670 if (diff > 0) { in drm_mode_sort()
6681 if (diff > 0) { in drm_mode_sort()
6691 if (diff > 0) { in drm_mode_sort()
6700 if (diff > 0) { in drm_mode_sort()
6707 edid_data->preferred_mode = &edid_data->mode_buf[0]; in drm_mode_sort()
6723 for (i = 0; i < num; i++) { in drm_mode_prune_invalid()
6734 memset(&mode_buf[num], 0, len * (edid_data->modes - num)); in drm_mode_prune_invalid()
6750 sizeof(resolution_white[0]); in drm_rk_filter_whitelist()
6751 for (i = 0; i < edid_data->modes; i++) { in drm_rk_filter_whitelist()
6752 for (j = 0; j < white_len; j++) { in drm_rk_filter_whitelist()
6794 memset(&mode, 0, sizeof(struct drm_display_mode)); in drm_rk_select_mode()
6797 for (i = 0; i < edid_data->modes; i++) { in drm_rk_select_mode()
6822 * Return: 0 on success or -1 on failure.
6837 .flags = 0, in drm_do_probe_ddc_edid()
6842 .flags = 0, in drm_do_probe_ddc_edid()
6864 return ret == xfers ? 0 : -1; in drm_do_probe_ddc_edid()
6869 int i, j, block_num, block = 0; in drm_do_get_edid()
6876 for (i = 0; i < 4; i++) { in drm_do_get_edid()
6877 if (drm_do_probe_ddc_edid(adap, edid, 0, HDMI_EDID_BLOCK_SIZE)) in drm_do_get_edid()
6879 if (drm_edid_block_valid(edid, 0, true, in drm_do_get_edid()
6882 if (i == 0 && drm_edid_is_zero(edid, HDMI_EDID_BLOCK_SIZE)) { in drm_do_get_edid()
6883 printf("edid base block is 0, get edid failed\n"); in drm_do_get_edid()
6893 block_num = edid[0x7e]; in drm_do_get_edid()
6896 for (i = 0; i < 4; i++) { in drm_do_get_edid()
6897 if (drm_do_probe_ddc_edid(adap, &edid[0x80 * j], j, in drm_do_get_edid()
6900 if (drm_edid_block_valid(&edid[0x80 * j], j, in drm_do_get_edid()
6912 for (i = 0; i < block_num + 1; i++) { in drm_do_get_edid()
6913 buff = &edid[0x80 * i]; in drm_do_get_edid()
6914 for (j = 0; j < HDMI_EDID_BLOCK_SIZE; j++) { in drm_do_get_edid()
6915 if (j % 16 == 0) in drm_do_get_edid()
6917 printf("0x%02x, ", buff[j]); in drm_do_get_edid()
6923 return 0; in drm_do_get_edid()
6928 memset(edid, 0, HDMI_EDID_BLOCK_SIZE * (block + 1)); in drm_do_get_edid()
6938 .flags = 0, in hdmi_ddc_read()
6957 .flags = 0, in hdmi_ddc_write()
6990 * 0 on success or a negative error code on failure.
7009 * 0 on success or a negative error code on failure.