Lines Matching +full:current +full:- +full:num +full:- +full:sinks
3 * Copyright (c) 2007-2008 Intel Corporation
24 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
78 /* Force reduced-blanking timings for detailed modes */
129 /* BOE model on HP Pavilion 15-n233sl reports 8 bpc, but is a 6 bpc panel */
135 /* SDC panel of Lenovo B50-80 reports 8 bpc, but is a 6 bpc panel */
145 /* Envision Peripherals, Inc. EN-7100e */
163 /* LG Philips LCD LP154W01-A5 */
169 /* Samsung SyncMaster 22[5-6]BW */
173 /* Sony PVM-2541A does up to 12 bpc, but only reports max 8 bpc */
185 /* Panel in Samsung NP700G7A-S01PL notebook reports 6bpc */
188 /* Rotel RSX-1058 forwards sink's EDID but only does HDMI 1.1*/
244 /* 0x01 - 640x350@85Hz */
248 /* 0x02 - 640x400@85Hz */
252 /* 0x03 - 720x400@85Hz */
256 /* 0x04 - 640x480@60Hz */
260 /* 0x05 - 640x480@72Hz */
264 /* 0x06 - 640x480@75Hz */
268 /* 0x07 - 640x480@85Hz */
272 /* 0x08 - 800x600@56Hz */
276 /* 0x09 - 800x600@60Hz */
280 /* 0x0a - 800x600@72Hz */
284 /* 0x0b - 800x600@75Hz */
288 /* 0x0c - 800x600@85Hz */
292 /* 0x0d - 800x600@120Hz RB */
296 /* 0x0e - 848x480@60Hz */
300 /* 0x0f - 1024x768@43Hz, interlace */
305 /* 0x10 - 1024x768@60Hz */
309 /* 0x11 - 1024x768@70Hz */
313 /* 0x12 - 1024x768@75Hz */
317 /* 0x13 - 1024x768@85Hz */
321 /* 0x14 - 1024x768@120Hz RB */
325 /* 0x15 - 1152x864@75Hz */
329 /* 0x55 - 1280x720@60Hz */
333 /* 0x16 - 1280x768@60Hz RB */
337 /* 0x17 - 1280x768@60Hz */
341 /* 0x18 - 1280x768@75Hz */
345 /* 0x19 - 1280x768@85Hz */
349 /* 0x1a - 1280x768@120Hz RB */
353 /* 0x1b - 1280x800@60Hz RB */
357 /* 0x1c - 1280x800@60Hz */
361 /* 0x1d - 1280x800@75Hz */
365 /* 0x1e - 1280x800@85Hz */
369 /* 0x1f - 1280x800@120Hz RB */
373 /* 0x20 - 1280x960@60Hz */
377 /* 0x21 - 1280x960@85Hz */
381 /* 0x22 - 1280x960@120Hz RB */
385 /* 0x23 - 1280x1024@60Hz */
389 /* 0x24 - 1280x1024@75Hz */
393 /* 0x25 - 1280x1024@85Hz */
397 /* 0x26 - 1280x1024@120Hz RB */
401 /* 0x27 - 1360x768@60Hz */
405 /* 0x28 - 1360x768@120Hz RB */
409 /* 0x51 - 1366x768@60Hz */
413 /* 0x56 - 1366x768@60Hz */
417 /* 0x29 - 1400x1050@60Hz RB */
421 /* 0x2a - 1400x1050@60Hz */
425 /* 0x2b - 1400x1050@75Hz */
429 /* 0x2c - 1400x1050@85Hz */
433 /* 0x2d - 1400x1050@120Hz RB */
437 /* 0x2e - 1440x900@60Hz RB */
441 /* 0x2f - 1440x900@60Hz */
445 /* 0x30 - 1440x900@75Hz */
449 /* 0x31 - 1440x900@85Hz */
453 /* 0x32 - 1440x900@120Hz RB */
457 /* 0x53 - 1600x900@60Hz */
461 /* 0x33 - 1600x1200@60Hz */
465 /* 0x34 - 1600x1200@65Hz */
469 /* 0x35 - 1600x1200@70Hz */
473 /* 0x36 - 1600x1200@75Hz */
477 /* 0x37 - 1600x1200@85Hz */
481 /* 0x38 - 1600x1200@120Hz RB */
485 /* 0x39 - 1680x1050@60Hz RB */
489 /* 0x3a - 1680x1050@60Hz */
493 /* 0x3b - 1680x1050@75Hz */
497 /* 0x3c - 1680x1050@85Hz */
501 /* 0x3d - 1680x1050@120Hz RB */
505 /* 0x3e - 1792x1344@60Hz */
509 /* 0x3f - 1792x1344@75Hz */
513 /* 0x40 - 1792x1344@120Hz RB */
517 /* 0x41 - 1856x1392@60Hz */
521 /* 0x42 - 1856x1392@75Hz */
525 /* 0x43 - 1856x1392@120Hz RB */
529 /* 0x52 - 1920x1080@60Hz */
533 /* 0x44 - 1920x1200@60Hz RB */
537 /* 0x45 - 1920x1200@60Hz */
541 /* 0x46 - 1920x1200@75Hz */
545 /* 0x47 - 1920x1200@85Hz */
549 /* 0x48 - 1920x1200@120Hz RB */
553 /* 0x49 - 1920x1440@60Hz */
557 /* 0x4a - 1920x1440@75Hz */
561 /* 0x4b - 1920x1440@120Hz RB */
565 /* 0x54 - 2048x1152@60Hz */
569 /* 0x4c - 2560x1600@60Hz RB */
573 /* 0x4d - 2560x1600@60Hz */
577 /* 0x4e - 2560x1600@75Hz */
581 /* 0x4f - 2560x1600@85Hz */
585 /* 0x50 - 2560x1600@120Hz RB */
589 /* 0x57 - 4096x2160@60Hz RB */
593 /* 0x58 - 4096x2160@59.94Hz RB */
602 * modes are old-school Mac modes. The EDID spec says the 1152x864@75 mode
606 * The DMT modes have been fact-checked; the rest are mild guesses.
733 * From CEA/CTA-861 spec.
738 /* 1 - 640x480@60Hz 4:3 */
743 /* 2 - 720x480@60Hz 4:3 */
748 /* 3 - 720x480@60Hz 16:9 */
753 /* 4 - 1280x720@60Hz 16:9 */
758 /* 5 - 1920x1080i@60Hz 16:9 */
764 /* 6 - 720(1440)x480i@60Hz 4:3 */
770 /* 7 - 720(1440)x480i@60Hz 16:9 */
776 /* 8 - 720(1440)x240@60Hz 4:3 */
782 /* 9 - 720(1440)x240@60Hz 16:9 */
788 /* 10 - 2880x480i@60Hz 4:3 */
794 /* 11 - 2880x480i@60Hz 16:9 */
800 /* 12 - 2880x240@60Hz 4:3 */
805 /* 13 - 2880x240@60Hz 16:9 */
810 /* 14 - 1440x480@60Hz 4:3 */
815 /* 15 - 1440x480@60Hz 16:9 */
820 /* 16 - 1920x1080@60Hz 16:9 */
825 /* 17 - 720x576@50Hz 4:3 */
830 /* 18 - 720x576@50Hz 16:9 */
835 /* 19 - 1280x720@50Hz 16:9 */
840 /* 20 - 1920x1080i@50Hz 16:9 */
846 /* 21 - 720(1440)x576i@50Hz 4:3 */
852 /* 22 - 720(1440)x576i@50Hz 16:9 */
858 /* 23 - 720(1440)x288@50Hz 4:3 */
864 /* 24 - 720(1440)x288@50Hz 16:9 */
870 /* 25 - 2880x576i@50Hz 4:3 */
876 /* 26 - 2880x576i@50Hz 16:9 */
882 /* 27 - 2880x288@50Hz 4:3 */
887 /* 28 - 2880x288@50Hz 16:9 */
892 /* 29 - 1440x576@50Hz 4:3 */
897 /* 30 - 1440x576@50Hz 16:9 */
902 /* 31 - 1920x1080@50Hz 16:9 */
907 /* 32 - 1920x1080@24Hz 16:9 */
912 /* 33 - 1920x1080@25Hz 16:9 */
917 /* 34 - 1920x1080@30Hz 16:9 */
922 /* 35 - 2880x480@60Hz 4:3 */
927 /* 36 - 2880x480@60Hz 16:9 */
932 /* 37 - 2880x576@50Hz 4:3 */
937 /* 38 - 2880x576@50Hz 16:9 */
942 /* 39 - 1920x1080i@50Hz 16:9 */
948 /* 40 - 1920x1080i@100Hz 16:9 */
954 /* 41 - 1280x720@100Hz 16:9 */
959 /* 42 - 720x576@100Hz 4:3 */
964 /* 43 - 720x576@100Hz 16:9 */
969 /* 44 - 720(1440)x576i@100Hz 4:3 */
975 /* 45 - 720(1440)x576i@100Hz 16:9 */
981 /* 46 - 1920x1080i@120Hz 16:9 */
987 /* 47 - 1280x720@120Hz 16:9 */
992 /* 48 - 720x480@120Hz 4:3 */
997 /* 49 - 720x480@120Hz 16:9 */
1002 /* 50 - 720(1440)x480i@120Hz 4:3 */
1008 /* 51 - 720(1440)x480i@120Hz 16:9 */
1014 /* 52 - 720x576@200Hz 4:3 */
1019 /* 53 - 720x576@200Hz 16:9 */
1024 /* 54 - 720(1440)x576i@200Hz 4:3 */
1030 /* 55 - 720(1440)x576i@200Hz 16:9 */
1036 /* 56 - 720x480@240Hz 4:3 */
1041 /* 57 - 720x480@240Hz 16:9 */
1046 /* 58 - 720(1440)x480i@240Hz 4:3 */
1052 /* 59 - 720(1440)x480i@240Hz 16:9 */
1058 /* 60 - 1280x720@24Hz 16:9 */
1063 /* 61 - 1280x720@25Hz 16:9 */
1068 /* 62 - 1280x720@30Hz 16:9 */
1073 /* 63 - 1920x1080@120Hz 16:9 */
1078 /* 64 - 1920x1080@100Hz 16:9 */
1083 /* 65 - 1280x720@24Hz 64:27 */
1088 /* 66 - 1280x720@25Hz 64:27 */
1093 /* 67 - 1280x720@30Hz 64:27 */
1098 /* 68 - 1280x720@50Hz 64:27 */
1103 /* 69 - 1280x720@60Hz 64:27 */
1108 /* 70 - 1280x720@100Hz 64:27 */
1113 /* 71 - 1280x720@120Hz 64:27 */
1118 /* 72 - 1920x1080@24Hz 64:27 */
1123 /* 73 - 1920x1080@25Hz 64:27 */
1128 /* 74 - 1920x1080@30Hz 64:27 */
1133 /* 75 - 1920x1080@50Hz 64:27 */
1138 /* 76 - 1920x1080@60Hz 64:27 */
1143 /* 77 - 1920x1080@100Hz 64:27 */
1148 /* 78 - 1920x1080@120Hz 64:27 */
1153 /* 79 - 1680x720@24Hz 64:27 */
1158 /* 80 - 1680x720@25Hz 64:27 */
1163 /* 81 - 1680x720@30Hz 64:27 */
1168 /* 82 - 1680x720@50Hz 64:27 */
1173 /* 83 - 1680x720@60Hz 64:27 */
1178 /* 84 - 1680x720@100Hz 64:27 */
1183 /* 85 - 1680x720@120Hz 64:27 */
1188 /* 86 - 2560x1080@24Hz 64:27 */
1193 /* 87 - 2560x1080@25Hz 64:27 */
1198 /* 88 - 2560x1080@30Hz 64:27 */
1203 /* 89 - 2560x1080@50Hz 64:27 */
1208 /* 90 - 2560x1080@60Hz 64:27 */
1213 /* 91 - 2560x1080@100Hz 64:27 */
1218 /* 92 - 2560x1080@120Hz 64:27 */
1223 /* 93 - 3840x2160@24Hz 16:9 */
1228 /* 94 - 3840x2160@25Hz 16:9 */
1233 /* 95 - 3840x2160@30Hz 16:9 */
1238 /* 96 - 3840x2160@50Hz 16:9 */
1243 /* 97 - 3840x2160@60Hz 16:9 */
1248 /* 98 - 4096x2160@24Hz 256:135 */
1253 /* 99 - 4096x2160@25Hz 256:135 */
1258 /* 100 - 4096x2160@30Hz 256:135 */
1263 /* 101 - 4096x2160@50Hz 256:135 */
1268 /* 102 - 4096x2160@60Hz 256:135 */
1273 /* 103 - 3840x2160@24Hz 64:27 */
1278 /* 104 - 3840x2160@25Hz 64:27 */
1283 /* 105 - 3840x2160@30Hz 64:27 */
1288 /* 106 - 3840x2160@50Hz 64:27 */
1293 /* 107 - 3840x2160@60Hz 64:27 */
1298 /* 108 - 1280x720@48Hz 16:9 */
1303 /* 109 - 1280x720@48Hz 64:27 */
1308 /* 110 - 1680x720@48Hz 64:27 */
1313 /* 111 - 1920x1080@48Hz 16:9 */
1318 /* 112 - 1920x1080@48Hz 64:27 */
1323 /* 113 - 2560x1080@48Hz 64:27 */
1328 /* 114 - 3840x2160@48Hz 16:9 */
1333 /* 115 - 4096x2160@48Hz 256:135 */
1338 /* 116 - 3840x2160@48Hz 64:27 */
1343 /* 117 - 3840x2160@100Hz 16:9 */
1348 /* 118 - 3840x2160@120Hz 16:9 */
1353 /* 119 - 3840x2160@100Hz 64:27 */
1358 /* 120 - 3840x2160@120Hz 64:27 */
1363 /* 121 - 5120x2160@24Hz 64:27 */
1368 /* 122 - 5120x2160@25Hz 64:27 */
1373 /* 123 - 5120x2160@30Hz 64:27 */
1378 /* 124 - 5120x2160@48Hz 64:27 */
1383 /* 125 - 5120x2160@50Hz 64:27 */
1388 /* 126 - 5120x2160@60Hz 64:27 */
1393 /* 127 - 5120x2160@100Hz 64:27 */
1401 * From CEA/CTA-861 spec.
1406 /* 193 - 5120x2160@120Hz 64:27 */
1411 /* 194 - 7680x4320@24Hz 16:9 */
1416 /* 195 - 7680x4320@25Hz 16:9 */
1421 /* 196 - 7680x4320@30Hz 16:9 */
1426 /* 197 - 7680x4320@48Hz 16:9 */
1431 /* 198 - 7680x4320@50Hz 16:9 */
1436 /* 199 - 7680x4320@60Hz 16:9 */
1441 /* 200 - 7680x4320@100Hz 16:9 */
1446 /* 201 - 7680x4320@120Hz 16:9 */
1451 /* 202 - 7680x4320@24Hz 64:27 */
1456 /* 203 - 7680x4320@25Hz 64:27 */
1461 /* 204 - 7680x4320@30Hz 64:27 */
1466 /* 205 - 7680x4320@48Hz 64:27 */
1471 /* 206 - 7680x4320@50Hz 64:27 */
1476 /* 207 - 7680x4320@60Hz 64:27 */
1481 /* 208 - 7680x4320@100Hz 64:27 */
1486 /* 209 - 7680x4320@120Hz 64:27 */
1491 /* 210 - 10240x4320@24Hz 64:27 */
1496 /* 211 - 10240x4320@25Hz 64:27 */
1501 /* 212 - 10240x4320@30Hz 64:27 */
1506 /* 213 - 10240x4320@48Hz 64:27 */
1511 /* 214 - 10240x4320@50Hz 64:27 */
1516 /* 215 - 10240x4320@60Hz 64:27 */
1521 /* 216 - 10240x4320@100Hz 64:27 */
1526 /* 217 - 10240x4320@120Hz 64:27 */
1531 /* 218 - 4096x2160@100Hz 256:135 */
1536 /* 219 - 4096x2160@120Hz 256:135 */
1547 /* 0 - dummy, VICs start at 1 */
1549 /* 1 - 3840x2160@30Hz */
1555 /* 2 - 3840x2160@25Hz */
1561 /* 3 - 3840x2160@24Hz */
1567 /* 4 - 4096x2160@24Hz (SMPTE) */
1597 return edid->extensions; in edid_extension_block_count()
1633 num_blocks = edid_block_count(drm_edid->edid); in __drm_edid_block_count()
1635 /* HF-EEODB override */ in __drm_edid_block_count()
1636 if (drm_edid->size >= edid_size_by_blocks(2)) { in __drm_edid_block_count()
1640 * Note: HF-EEODB may specify a smaller extension count than the in __drm_edid_block_count()
1643 eeodb = edid_hfeeodb_block_count(drm_edid->edid); in __drm_edid_block_count()
1656 (int)drm_edid->size / EDID_LENGTH); in drm_edid_block_count()
1662 return drm_edid_block_count(drm_edid) - 1; in drm_edid_extension_block_count()
1667 return edid_block_data(drm_edid->edid, index); in drm_edid_block_data()
1673 return edid_extension_block_data(drm_edid->edid, index); in drm_edid_extension_block_data()
1688 drm_edid->edid = edid; in drm_edid_legacy_init()
1689 drm_edid->size = edid_size(edid); in drm_edid_legacy_init()
1709 /* Current block index. */
1718 iter->drm_edid = drm_edid; in drm_edid_iter_begin()
1725 if (!iter->drm_edid) in __drm_edid_iter_next()
1728 if (iter->index < drm_edid_block_count(iter->drm_edid)) in __drm_edid_iter_next()
1729 block = drm_edid_block_data(iter->drm_edid, iter->index++); in __drm_edid_iter_next()
1752 * drm_edid_header_is_valid - sanity check the header of the base EDID block
1765 if (edid->header[i] == edid_header[i]) in drm_edid_header_is_valid()
1776 "Minimum number of valid EDID header bytes (0-8, default 6)");
1784 for (i = 0; i < EDID_LENGTH - 1; i++) in edid_block_compute_checksum()
1787 crc = 0x100 - csum; in edid_block_compute_checksum()
1796 return block->checksum; in edid_block_get_checksum()
1812 * drm_edid_are_equal - compare two edid blobs.
1884 if (block->version != 1) in edid_block_check()
1942 block->version); in edid_block_status_print()
1969 * drm_edid_block_valid - Sanity check the EDID block (base or extension)
2029 * drm_edid_is_valid - sanity check EDID data
2032 * Sanity-check an entire EDID record (including extensions)
2055 * drm_edid_valid - sanity check EDID data
2070 if (edid_size_by_blocks(__drm_edid_block_count(drm_edid)) != drm_edid->size) in drm_edid_valid()
2091 * Note: If the EDID uses HF-EEODB, but has invalid blocks, we'll revert in edid_filter_invalid_blocks()
2093 * modifying the HF-EEODB extension too. in edid_filter_invalid_blocks()
2112 edid->extensions = valid_blocks - 1; in edid_filter_invalid_blocks()
2113 edid->checksum = edid_block_compute_checksum(edid); in edid_filter_invalid_blocks()
2126 * drm_do_probe_ddc_edid() - get EDID information via I2C
2134 * Return: 0 on success or -1 on failure.
2147 * adapter reports EAGAIN. However, we find that bit-banging transfers in drm_do_probe_ddc_edid()
2173 * Avoid sending the segment addr to not upset non-compliant in drm_do_probe_ddc_edid()
2176 ret = i2c_transfer(adapter, &msgs[3 - xfers], xfers); in drm_do_probe_ddc_edid()
2178 if (ret == -ENXIO) { in drm_do_probe_ddc_edid()
2179 DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n", in drm_do_probe_ddc_edid()
2180 adapter->name); in drm_do_probe_ddc_edid()
2183 } while (ret != xfers && --retries); in drm_do_probe_ddc_edid()
2185 return ret == xfers ? 0 : -1; in drm_do_probe_ddc_edid()
2200 last_block = edid->extensions; in connector_bad_edid()
2204 connector->real_edid_checksum = in connector_bad_edid()
2207 if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS)) in connector_bad_edid()
2210 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID is invalid:\n", in connector_bad_edid()
2211 connector->base.id, connector->name); in connector_bad_edid()
2221 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_get()
2223 if (connector->edid_override) in drm_edid_override_get()
2224 override = drm_edid_dup(connector->edid_override); in drm_edid_override_get()
2226 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_get()
2239 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_show()
2241 drm_edid = connector->edid_override; in drm_edid_override_show()
2243 seq_write(m, drm_edid->edid, drm_edid->size); in drm_edid_override_show()
2245 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_show()
2258 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override invalid\n", in drm_edid_override_set()
2259 connector->base.id, connector->name); in drm_edid_override_set()
2261 return -EINVAL; in drm_edid_override_set()
2264 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override set\n", in drm_edid_override_set()
2265 connector->base.id, connector->name); in drm_edid_override_set()
2267 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_set()
2269 drm_edid_free(connector->edid_override); in drm_edid_override_set()
2270 connector->edid_override = drm_edid; in drm_edid_override_set()
2272 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_set()
2280 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override reset\n", in drm_edid_override_reset()
2281 connector->base.id, connector->name); in drm_edid_override_reset()
2283 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_reset()
2285 drm_edid_free(connector->edid_override); in drm_edid_override_reset()
2286 connector->edid_override = NULL; in drm_edid_override_reset()
2288 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_reset()
2294 * drm_edid_override_connector_update - add modes from override/firmware EDID
2316 drm_dbg_kms(connector->dev, in drm_edid_override_connector_update()
2318 connector->base.id, connector->name, num_modes); in drm_edid_override_connector_update()
2372 alloc_size = override->size; in _drm_do_get_edid()
2373 edid = kmemdup(override->edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2393 connector->edid_corrupt = false; in _drm_do_get_edid()
2395 connector->edid_corrupt = true; in _drm_do_get_edid()
2399 connector->null_edid_counter++; in _drm_do_get_edid()
2429 * the first Data Block is HF-EEODB, override the in _drm_do_get_edid()
2432 * Note: HF-EEODB could specify a smaller extension in _drm_do_get_edid()
2467 * drm_do_get_edid - get EDID data using a custom EDID block read function
2495 * drm_edid_raw - Get a pointer to the raw EDID data.
2506 if (!drm_edid || !drm_edid->size) in drm_edid_raw()
2513 if (WARN_ON(edid_size(drm_edid->edid) > drm_edid->size)) in drm_edid_raw()
2516 return drm_edid->edid; in drm_edid_raw()
2530 drm_edid->edid = edid; in _drm_edid_alloc()
2531 drm_edid->size = size; in _drm_edid_alloc()
2538 * drm_edid_alloc - Allocate a new drm_edid container
2571 * drm_edid_dup - Duplicate a drm_edid container
2583 return drm_edid_alloc(drm_edid->edid, drm_edid->size); in drm_edid_dup()
2588 * drm_edid_free - Free the drm_edid container
2596 kfree(drm_edid->edid); in drm_edid_free()
2602 * drm_probe_ddc() - probe DDC presence
2617 * drm_get_edid - get EDID data, if available
2631 if (connector->force == DRM_FORCE_OFF) in drm_get_edid()
2634 if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter)) in drm_get_edid()
2644 * drm_edid_read_custom - Read EDID data using given EDID block read function
2679 drm_WARN_ON(connector->dev, !size); in drm_edid_read_custom()
2690 * drm_edid_read_ddc - Read EDID data using given I2C adapter
2700 * Prefer initializing connector->ddc with drm_connector_init_with_ddc() and
2712 if (connector->force == DRM_FORCE_OFF) in drm_edid_read_ddc()
2715 if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter)) in drm_edid_read_ddc()
2727 * drm_edid_read - Read EDID data using connector's I2C adapter
2742 if (drm_WARN_ON(connector->dev, !connector->ddc)) in drm_edid_read()
2745 return drm_edid_read_ddc(connector, connector->ddc); in drm_edid_read()
2752 * We represent the ID as a 32-bit number so it can easily be compared in edid_extract_panel_id()
2764 return (u32)edid->mfg_id[0] << 24 | in edid_extract_panel_id()
2765 (u32)edid->mfg_id[1] << 16 | in edid_extract_panel_id()
2770 * drm_edid_get_panel_id - Get a panel's ID through DDC
2774 * that the EDID is valid) extracts the ID out of it. The ID is a 32-bit value
2775 * (16 bits of manufacturer ID and 16 bits of per-manufacturer ID) that's
2787 * Return: A 32-bit ID that should be different for each make/model of panel.
2824 * drm_get_edid_switcheroo - get EDID data for a vga_switcheroo output
2837 struct drm_device *dev = connector->dev; in drm_get_edid_switcheroo()
2838 struct pci_dev *pdev = to_pci_dev(dev->dev); in drm_get_edid_switcheroo()
2841 if (drm_WARN_ON_ONCE(dev, !dev_is_pci(dev->dev))) in drm_get_edid_switcheroo()
2853 * drm_edid_read_switcheroo - get EDID data for a vga_switcheroo output
2866 struct drm_device *dev = connector->dev; in drm_edid_read_switcheroo()
2867 struct pci_dev *pdev = to_pci_dev(dev->dev); in drm_edid_read_switcheroo()
2870 if (drm_WARN_ON_ONCE(dev, !dev_is_pci(dev->dev))) in drm_edid_read_switcheroo()
2882 * drm_edid_duplicate - duplicate an EDID and the extensions
2899 * edid_get_quirks - return quirk flags for a given EDID
2906 u32 panel_id = edid_extract_panel_id(drm_edid->edid); in edid_get_quirks()
2912 if (quirk->panel_id == panel_id) in edid_get_quirks()
2913 return quirk->quirks; in edid_get_quirks()
2919 #define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay)
2920 #define MODE_REFRESH_DIFF(c,t) (abs((c) - (t)))
2928 const struct drm_display_info *info = &connector->display_info; in edid_fixup_preferred()
2933 if (list_empty(&connector->probed_modes)) in edid_fixup_preferred()
2936 if (info->quirks & EDID_QUIRK_PREFER_LARGE_60) in edid_fixup_preferred()
2938 if (info->quirks & EDID_QUIRK_PREFER_LARGE_75) in edid_fixup_preferred()
2941 preferred_mode = list_first_entry(&connector->probed_modes, in edid_fixup_preferred()
2944 list_for_each_entry_safe(cur_mode, t, &connector->probed_modes, head) { in edid_fixup_preferred()
2945 cur_mode->type &= ~DRM_MODE_TYPE_PREFERRED; in edid_fixup_preferred()
2964 preferred_mode->type |= DRM_MODE_TYPE_PREFERRED; in edid_fixup_preferred()
2970 return (mode->htotal - mode->hdisplay == 160) && in mode_is_rb()
2971 (mode->hsync_end - mode->hdisplay == 80) && in mode_is_rb()
2972 (mode->hsync_end - mode->hsync_start == 32) && in mode_is_rb()
2973 (mode->vsync_start - mode->vdisplay == 3); in mode_is_rb()
2977 * drm_mode_find_dmt - Create a copy of a mode if present in DMT
2982 * @rb: Mode reduced-blanking-ness
2997 if (hsize != ptr->hdisplay) in drm_mode_find_dmt()
2999 if (vsize != ptr->vdisplay) in drm_mode_find_dmt()
3019 return descriptor->pixel_clock == 0 && in is_display_descriptor()
3020 descriptor->data.other_data.pad1 == 0 && in is_display_descriptor()
3021 descriptor->data.other_data.type == type; in is_display_descriptor()
3028 return descriptor->pixel_clock != 0; in is_detailed_timing_descriptor()
3043 n = (127 - d) / 18; in cea_for_each_detailed_block()
3072 cb(&drm_edid->edid->detailed_timings[i], closure); in drm_for_each_detailed_block()
3101 if (descriptor->data.other_data.data.range.flags == DRM_EDID_CVT_SUPPORT_FLAG && in is_rb()
3102 descriptor->data.other_data.data.range.formula.cvt.flags & DRM_EDID_CVT_FLAGS_REDUCED_BLANKING) in is_rb()
3110 if (drm_edid->edid->revision >= 4) { in drm_monitor_supports_rb()
3117 return ((drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL) != 0); in drm_monitor_supports_rb()
3130 if (descriptor->data.other_data.data.range.flags == DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG) in find_gtf2()
3144 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.hfreq_start_khz * 2 : 0; in drm_gtf2_hbreak()
3156 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.c : 0; in drm_gtf2_2c()
3168 return descriptor ? le16_to_cpu(descriptor->data.other_data.data.range.formula.gtf2.m) : 0; in drm_gtf2_m()
3180 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.k : 0; in drm_gtf2_k()
3192 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.j : 0; in drm_gtf2_2j()
3205 switch (descriptor->data.other_data.data.range.flags) { in get_timing_level()
3223 const struct edid *edid = drm_edid->edid; in standard_timing_level()
3225 if (edid->revision >= 4) { in standard_timing_level()
3235 } else if (edid->revision >= 3 && drm_gtf2_hbreak(drm_edid)) { in standard_timing_level()
3237 } else if (edid->revision >= 2) { in standard_timing_level()
3258 if (mode->htotal <= 0) in drm_mode_hsync()
3261 return DIV_ROUND_CLOSEST(mode->clock, mode->htotal); in drm_mode_hsync()
3301 struct drm_device *dev = connector->dev; in drm_mode_std()
3305 unsigned aspect_ratio = (t->vfreq_aspect & EDID_TIMING_ASPECT_MASK) in drm_mode_std()
3307 unsigned vfreq = (t->vfreq_aspect & EDID_TIMING_VFREQ_MASK) in drm_mode_std()
3311 if (bad_std_timing(t->hsize, t->vfreq_aspect)) in drm_mode_std()
3315 hsize = t->hsize * 8 + 248; in drm_mode_std()
3320 if (drm_edid->edid->revision < 3) in drm_mode_std()
3345 list_for_each_entry(m, &connector->probed_modes, head) in drm_mode_std()
3346 if (m->hdisplay == hsize && m->vdisplay == vsize && in drm_mode_std()
3356 mode->hdisplay = 1366; in drm_mode_std()
3357 mode->hsync_start = mode->hsync_start - 1; in drm_mode_std()
3358 mode->hsync_end = mode->hsync_end - 1; in drm_mode_std()
3416 if (!(pt->misc & DRM_EDID_PT_INTERLACED)) in drm_mode_do_interlace_quirk()
3420 if ((mode->hdisplay == cea_interlaced[i].w) && in drm_mode_do_interlace_quirk()
3421 (mode->vdisplay == cea_interlaced[i].h / 2)) { in drm_mode_do_interlace_quirk()
3422 mode->vdisplay *= 2; in drm_mode_do_interlace_quirk()
3423 mode->vsync_start *= 2; in drm_mode_do_interlace_quirk()
3424 mode->vsync_end *= 2; in drm_mode_do_interlace_quirk()
3425 mode->vtotal *= 2; in drm_mode_do_interlace_quirk()
3426 mode->vtotal |= 1; in drm_mode_do_interlace_quirk()
3430 mode->flags |= DRM_MODE_FLAG_INTERLACE; in drm_mode_do_interlace_quirk()
3442 const struct drm_display_info *info = &connector->display_info; in drm_mode_detailed()
3443 struct drm_device *dev = connector->dev; in drm_mode_detailed()
3445 const struct detailed_pixel_timing *pt = &timing->data.pixel_data; in drm_mode_detailed()
3446 unsigned hactive = (pt->hactive_hblank_hi & 0xf0) << 4 | pt->hactive_lo; in drm_mode_detailed()
3447 unsigned vactive = (pt->vactive_vblank_hi & 0xf0) << 4 | pt->vactive_lo; in drm_mode_detailed()
3448 unsigned hblank = (pt->hactive_hblank_hi & 0xf) << 8 | pt->hblank_lo; in drm_mode_detailed()
3449 unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo; in drm_mode_detailed()
3450 unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) << 2 | pt->hsync_offset_lo; in drm_mode_detailed()
3451 …unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x30) << 4 | pt->hsync_pulse… in drm_mode_detailed()
3452 …unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) << 2 | pt->vsync_offset_puls… in drm_mode_detailed()
3453 …unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 4 | (pt->vsync_offse… in drm_mode_detailed()
3459 if (pt->misc & DRM_EDID_PT_STEREO) { in drm_mode_detailed()
3461 connector->base.id, connector->name); in drm_mode_detailed()
3464 if (!(pt->misc & DRM_EDID_PT_SEPARATE_SYNC)) { in drm_mode_detailed()
3466 connector->base.id, connector->name); in drm_mode_detailed()
3472 connector->base.id, connector->name); in drm_mode_detailed()
3476 if (info->quirks & EDID_QUIRK_FORCE_REDUCED_BLANKING) { in drm_mode_detailed()
3488 if (info->quirks & EDID_QUIRK_135_CLOCK_TOO_HIGH) in drm_mode_detailed()
3489 mode->clock = 1088 * 10; in drm_mode_detailed()
3491 mode->clock = le16_to_cpu(timing->pixel_clock) * 10; in drm_mode_detailed()
3493 mode->hdisplay = hactive; in drm_mode_detailed()
3494 mode->hsync_start = mode->hdisplay + hsync_offset; in drm_mode_detailed()
3495 mode->hsync_end = mode->hsync_start + hsync_pulse_width; in drm_mode_detailed()
3496 mode->htotal = mode->hdisplay + hblank; in drm_mode_detailed()
3498 mode->vdisplay = vactive; in drm_mode_detailed()
3499 mode->vsync_start = mode->vdisplay + vsync_offset; in drm_mode_detailed()
3500 mode->vsync_end = mode->vsync_start + vsync_pulse_width; in drm_mode_detailed()
3501 mode->vtotal = mode->vdisplay + vblank; in drm_mode_detailed()
3504 if (mode->hsync_end > mode->htotal) { in drm_mode_detailed()
3505 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing hsync_end %d->%d\n", in drm_mode_detailed()
3506 connector->base.id, connector->name, in drm_mode_detailed()
3507 mode->hsync_end, mode->htotal); in drm_mode_detailed()
3508 mode->hsync_end = mode->htotal; in drm_mode_detailed()
3510 if (mode->vsync_end > mode->vtotal) { in drm_mode_detailed()
3511 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing vsync_end %d->%d\n", in drm_mode_detailed()
3512 connector->base.id, connector->name, in drm_mode_detailed()
3513 mode->vsync_end, mode->vtotal); in drm_mode_detailed()
3514 mode->vsync_end = mode->vtotal; in drm_mode_detailed()
3519 if (info->quirks & EDID_QUIRK_DETAILED_SYNC_PP) { in drm_mode_detailed()
3520 mode->flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC; in drm_mode_detailed()
3522 mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ? in drm_mode_detailed()
3524 mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ? in drm_mode_detailed()
3529 mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4; in drm_mode_detailed()
3530 mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8; in drm_mode_detailed()
3532 if (info->quirks & EDID_QUIRK_DETAILED_IN_CM) { in drm_mode_detailed()
3533 mode->width_mm *= 10; in drm_mode_detailed()
3534 mode->height_mm *= 10; in drm_mode_detailed()
3537 if (info->quirks & EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE) { in drm_mode_detailed()
3538 mode->width_mm = drm_edid->edid->width_cm * 10; in drm_mode_detailed()
3539 mode->height_mm = drm_edid->edid->height_cm * 10; in drm_mode_detailed()
3542 mode->type = DRM_MODE_TYPE_DRIVER; in drm_mode_detailed()
3555 if (edid->revision >= 4) in mode_in_hsync_range()
3558 if (edid->revision >= 4) in mode_in_hsync_range()
3572 if (edid->revision >= 4) in mode_in_vsync_range()
3575 if (edid->revision >= 4) in mode_in_vsync_range()
3590 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in range_pixel_clock()
3591 return (t[9] * 10000) - ((t[12] >> 2) * 250); in range_pixel_clock()
3601 const struct edid *edid = drm_edid->edid; in mode_in_range()
3612 if (mode->clock > max_clock) in mode_in_range()
3616 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in mode_in_range()
3617 if (t[13] && mode->hdisplay > 8 * (t[13] + (256 * (t[12]&0x3)))) in mode_in_range()
3632 list_for_each_entry(m, &connector->probed_modes, head) { in valid_inferred_mode()
3633 if (mode->hdisplay == m->hdisplay && in valid_inferred_mode()
3634 mode->vdisplay == m->vdisplay && in valid_inferred_mode()
3637 if (mode->hdisplay <= m->hdisplay && in valid_inferred_mode()
3638 mode->vdisplay <= m->vdisplay) in valid_inferred_mode()
3650 struct drm_device *dev = connector->dev; in drm_dmt_modes_for_range()
3671 if (mode->hdisplay == 1368 && mode->vdisplay == 768) { in drm_mode_fixup_1366x768()
3672 mode->hdisplay = 1366; in drm_mode_fixup_1366x768()
3673 mode->hsync_start--; in drm_mode_fixup_1366x768()
3674 mode->hsync_end--; in drm_mode_fixup_1366x768()
3685 struct drm_device *dev = connector->dev; in drm_gtf_modes_for_range()
3690 newmode = drm_gtf_mode(dev, m->w, m->h, m->r, 0, 0); in drm_gtf_modes_for_range()
3714 struct drm_device *dev = connector->dev; in drm_gtf2_modes_for_range()
3719 newmode = drm_gtf2_mode(dev, drm_edid, m->w, m->h, m->r); in drm_gtf2_modes_for_range()
3743 struct drm_device *dev = connector->dev; in drm_cvt_modes_for_range()
3749 newmode = drm_cvt_mode(dev, m->w, m->h, m->r, rb, 0, 0); in drm_cvt_modes_for_range()
3771 const struct detailed_non_pixel *data = &timing->data.other_data; in do_inferred_modes()
3772 const struct detailed_data_monitor_range *range = &data->data.range; in do_inferred_modes()
3777 closure->modes += drm_dmt_modes_for_range(closure->connector, in do_inferred_modes()
3778 closure->drm_edid, in do_inferred_modes()
3781 if (closure->drm_edid->edid->revision < 2) in do_inferred_modes()
3784 switch (range->flags) { in do_inferred_modes()
3786 closure->modes += drm_gtf2_modes_for_range(closure->connector, in do_inferred_modes()
3787 closure->drm_edid, in do_inferred_modes()
3791 closure->modes += drm_gtf_modes_for_range(closure->connector, in do_inferred_modes()
3792 closure->drm_edid, in do_inferred_modes()
3796 if (closure->drm_edid->edid->revision < 4) in do_inferred_modes()
3799 closure->modes += drm_cvt_modes_for_range(closure->connector, in do_inferred_modes()
3800 closure->drm_edid, in do_inferred_modes()
3817 if (drm_edid->edid->revision >= 1) in add_inferred_modes()
3831 for (j = 7; j >= 0; j--) { in drm_est3_modes()
3832 m = (i * 8) + (7 - j); in drm_est3_modes()
3836 mode = drm_mode_find_dmt(connector->dev, in drm_est3_modes()
3860 closure->modes += drm_est3_modes(closure->connector, timing); in do_established_modes()
3871 struct drm_device *dev = connector->dev; in add_established_modes()
3872 const struct edid *edid = drm_edid->edid; in add_established_modes()
3873 unsigned long est_bits = edid->established_timings.t1 | in add_established_modes()
3874 (edid->established_timings.t2 << 8) | in add_established_modes()
3875 ((edid->established_timings.mfg_rsvd & 0x80) << 9); in add_established_modes()
3894 if (edid->revision >= 1) in add_established_modes()
3905 const struct detailed_non_pixel *data = &timing->data.other_data; in do_standard_modes()
3906 struct drm_connector *connector = closure->connector; in do_standard_modes()
3913 const struct std_timing *std = &data->data.timings[i]; in do_standard_modes()
3916 newmode = drm_mode_std(connector, closure->drm_edid, std); in do_standard_modes()
3919 closure->modes++; in do_standard_modes()
3942 &drm_edid->edid->standard_timings[i]); in add_standard_modes()
3949 if (drm_edid->edid->revision >= 1) in add_standard_modes()
3963 struct drm_device *dev = connector->dev; in drm_cvt_modes()
3971 cvt = &(timing->data.other_data.data.cvt[i]); in drm_cvt_modes()
3973 if (!memcmp(cvt->code, empty, 3)) in drm_cvt_modes()
3976 height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2; in drm_cvt_modes()
3977 switch (cvt->code[1] & 0x0c) { in drm_cvt_modes()
3978 /* default - because compiler doesn't see that we've enumerated all cases */ in drm_cvt_modes()
3995 if (cvt->code[2] & (1 << j)) { in drm_cvt_modes()
4018 closure->modes += drm_cvt_modes(closure->connector, timing); in do_cvt_mode()
4029 if (drm_edid->edid->revision >= 3) in add_cvt_modes()
4049 newmode = drm_mode_detailed(closure->connector, in do_detailed_mode()
4050 closure->drm_edid, timing); in do_detailed_mode()
4054 if (closure->preferred) in do_detailed_mode()
4055 newmode->type |= DRM_MODE_TYPE_PREFERRED; in do_detailed_mode()
4062 fixup_detailed_cea_mode_clock(closure->connector, newmode); in do_detailed_mode()
4064 drm_mode_probed_add(closure->connector, newmode); in do_detailed_mode()
4065 closure->modes++; in do_detailed_mode()
4066 closure->preferred = false; in do_detailed_mode()
4070 * add_detailed_modes - Add modes from detailed timings
4082 if (drm_edid->edid->revision >= 4) in add_detailed_modes()
4086 drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING; in add_detailed_modes()
4093 /* CTA-861-H Table 60 - CTA Tag Codes */
4100 /* CTA-861-H Table 62 - CTA Extended Tag Codes */
4159 if (block->tag == DATA_BLOCK_CTA) { in drm_edid_has_cta_extension()
4171 BUILD_BUG_ON(1 + ARRAY_SIZE(edid_cea_modes_1) - 1 != 127); in cea_mode_for_vic()
4172 BUILD_BUG_ON(193 + ARRAY_SIZE(edid_cea_modes_193) - 1 != 219); in cea_mode_for_vic()
4175 return &edid_cea_modes_1[vic - 1]; in cea_mode_for_vic()
4177 return &edid_cea_modes_193[vic - 193]; in cea_mode_for_vic()
4200 unsigned int clock = cea_mode->clock; in cea_mode_alternate_clock()
4210 if (cea_mode->vdisplay == 240 || cea_mode->vdisplay == 480) in cea_mode_alternate_clock()
4230 BUILD_BUG_ON(cea_mode_for_vic(8)->vtotal != 262 || in cea_mode_alternate_timings()
4231 cea_mode_for_vic(9)->vtotal != 262 || in cea_mode_alternate_timings()
4232 cea_mode_for_vic(12)->vtotal != 262 || in cea_mode_alternate_timings()
4233 cea_mode_for_vic(13)->vtotal != 262 || in cea_mode_alternate_timings()
4234 cea_mode_for_vic(23)->vtotal != 312 || in cea_mode_alternate_timings()
4235 cea_mode_for_vic(24)->vtotal != 312 || in cea_mode_alternate_timings()
4236 cea_mode_for_vic(27)->vtotal != 312 || in cea_mode_alternate_timings()
4237 cea_mode_for_vic(28)->vtotal != 312); in cea_mode_alternate_timings()
4240 vic == 12 || vic == 13) && mode->vtotal < 263) || in cea_mode_alternate_timings()
4242 vic == 27 || vic == 28) && mode->vtotal < 314)) { in cea_mode_alternate_timings()
4243 mode->vsync_start++; in cea_mode_alternate_timings()
4244 mode->vsync_end++; in cea_mode_alternate_timings()
4245 mode->vtotal++; in cea_mode_alternate_timings()
4259 if (!to_match->clock) in drm_match_cea_mode_clock_tolerance()
4262 if (to_match->picture_aspect_ratio) in drm_match_cea_mode_clock_tolerance()
4275 if (abs(to_match->clock - clock1) > clock_tolerance && in drm_match_cea_mode_clock_tolerance()
4276 abs(to_match->clock - clock2) > clock_tolerance) in drm_match_cea_mode_clock_tolerance()
4289 * drm_match_cea_mode - look for a CEA mode matching given mode
4292 * Return: The CEA Video ID (VIC) of the mode or 0 if it isn't a CEA-861
4300 if (!to_match->clock) in drm_match_cea_mode()
4303 if (to_match->picture_aspect_ratio) in drm_match_cea_mode()
4316 if (KHZ2PICOS(to_match->clock) != KHZ2PICOS(clock1) && in drm_match_cea_mode()
4317 KHZ2PICOS(to_match->clock) != KHZ2PICOS(clock2)) in drm_match_cea_mode()
4340 return mode->picture_aspect_ratio; in drm_get_cea_aspect_ratio()
4366 if (!to_match->clock) in drm_match_hdmi_mode_clock_tolerance()
4369 if (to_match->picture_aspect_ratio) in drm_match_hdmi_mode_clock_tolerance()
4377 clock1 = hdmi_mode->clock; in drm_match_hdmi_mode_clock_tolerance()
4380 if (abs(to_match->clock - clock1) > clock_tolerance && in drm_match_hdmi_mode_clock_tolerance()
4381 abs(to_match->clock - clock2) > clock_tolerance) in drm_match_hdmi_mode_clock_tolerance()
4392 * drm_match_hdmi_mode - look for a HDMI mode matching given mode
4404 if (!to_match->clock) in drm_match_hdmi_mode()
4407 if (to_match->picture_aspect_ratio) in drm_match_hdmi_mode()
4415 clock1 = hdmi_mode->clock; in drm_match_hdmi_mode()
4418 if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) || in drm_match_hdmi_mode()
4419 KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) && in drm_match_hdmi_mode()
4434 struct drm_device *dev = connector->dev; in add_alternate_cea_modes()
4447 list_for_each_entry(mode, &connector->probed_modes, head) { in add_alternate_cea_modes()
4467 clock1 = cea_mode->clock; in add_alternate_cea_modes()
4472 if (mode->clock != clock1 && mode->clock != clock2) in add_alternate_cea_modes()
4480 newmode->flags |= mode->flags & DRM_MODE_FLAG_3D_MASK; in add_alternate_cea_modes()
4483 * The current mode could be either variant. Make in add_alternate_cea_modes()
4486 if (mode->clock != clock1) in add_alternate_cea_modes()
4487 newmode->clock = clock1; in add_alternate_cea_modes()
4489 newmode->clock = clock2; in add_alternate_cea_modes()
4491 list_add_tail(&newmode->head, &list); in add_alternate_cea_modes()
4495 list_del(&mode->head); in add_alternate_cea_modes()
4505 /* 0-6 bit vic, 7th bit native mode indicator */ in svd_to_vic()
4513 * Return a display mode for the 0-based vic_index'th VIC across all CTA VDBs in
4519 const struct drm_display_info *info = &connector->display_info; in drm_display_mode_from_vic_index()
4520 struct drm_device *dev = connector->dev; in drm_display_mode_from_vic_index()
4522 if (!info->vics || vic_index >= info->vics_len || !info->vics[vic_index]) in drm_display_mode_from_vic_index()
4525 return drm_display_mode_from_cea_vic(dev, info->vics[vic_index]); in drm_display_mode_from_vic_index()
4529 * do_y420vdb_modes - Parse YCBCR 420 only modes
4534 * Parse the CEA-861-F YCBCR 420 Video Data Block (Y420VDB)
4541 struct drm_device *dev = connector->dev; in do_y420vdb_modes()
4562 * drm_display_mode_from_cea_vic() - return a mode for CEA VIC
4592 const struct drm_display_info *info = &connector->display_info; in add_cta_vdb_modes()
4595 if (!info->vics) in add_cta_vdb_modes()
4598 for (i = 0; i < info->vics_len; i++) { in add_cta_vdb_modes()
4633 unsigned int interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; in stereo_match_mandatory()
4635 return mode->hdisplay == stereo_mode->width && in stereo_match_mandatory()
4636 mode->vdisplay == stereo_mode->height && in stereo_match_mandatory()
4637 interlaced == (stereo_mode->flags & DRM_MODE_FLAG_INTERLACE) && in stereo_match_mandatory()
4638 drm_mode_vrefresh(mode) == stereo_mode->vrefresh; in stereo_match_mandatory()
4643 struct drm_device *dev = connector->dev; in add_hdmi_mandatory_stereo_modes()
4650 list_for_each_entry(mode, &connector->probed_modes, head) { in add_hdmi_mandatory_stereo_modes()
4664 new_mode->flags |= mandatory->flags; in add_hdmi_mandatory_stereo_modes()
4665 list_add_tail(&new_mode->head, &stereo_modes); in add_hdmi_mandatory_stereo_modes()
4670 list_splice_tail(&stereo_modes, &connector->probed_modes); in add_hdmi_mandatory_stereo_modes()
4677 struct drm_device *dev = connector->dev; in add_hdmi_mode()
4681 drm_err(connector->dev, "[CONNECTOR:%d:%s] Unknown HDMI VIC: %d\n", in add_hdmi_mode()
4682 connector->base.id, connector->name, vic); in add_hdmi_mode()
4704 newmode->flags |= DRM_MODE_FLAG_3D_FRAME_PACKING; in add_3d_struct_modes()
4712 newmode->flags |= DRM_MODE_FLAG_3D_TOP_AND_BOTTOM; in add_3d_struct_modes()
4720 newmode->flags |= DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF; in add_3d_struct_modes()
4750 * do_hdmi_vsdb_modes - Parse the HDMI Vendor Specific data block
4808 if (len < (8 + offset + hdmi_3d_len - 1)) in do_hdmi_vsdb_modes()
4833 for (i = 0; i < (hdmi_3d_len - multi_len); i++) { in do_hdmi_vsdb_modes()
4841 if (detail_present && (i + 1 == hdmi_3d_len - multi_len)) in do_hdmi_vsdb_modes()
4867 newmode->flags |= newflag; in do_hdmi_vsdb_modes()
4913 /* Current Data Block Collection. */
4916 /* Current Data Block index in current collection. */
4919 /* End index in current collection. */
4923 /* CTA-861-H section 7.4 CTA Data BLock Collection */
4931 return db->tag_length >> 5; in cea_db_tag()
4939 return db->tag_length & 0x1f; in cea_db_payload_len()
4944 return db->data; in cea_db_data()
4951 db->data[0] == tag; in cea_db_is_extended_tag()
4968 drm_edid_iter_begin(drm_edid, &iter->edid_iter); in cea_db_iter_edid_begin()
4969 displayid_iter_edid_begin(drm_edid, &iter->displayid_iter); in cea_db_iter_edid_begin()
4977 if (!iter->collection) in __cea_db_iter_current_block()
4980 db = (const struct cea_db *)&iter->collection[iter->index]; in __cea_db_iter_current_block()
4982 if (iter->index + sizeof(*db) <= iter->end && in __cea_db_iter_current_block()
4983 iter->index + sizeof(*db) + cea_db_payload_len(db) <= iter->end) in __cea_db_iter_current_block()
4991 * - CTA-861-H section 7.3.3 CTA Extension Version 3
5000 return d - 4; in cea_db_collection_size()
5005 * - VESA E-EDID v1.4
5006 * - CTA-861-H section 7.3.3 CTA Extension Version 3
5012 drm_edid_iter_for_each(ext, &iter->edid_iter) { in __cea_db_iter_edid_next()
5023 iter->index = 4; in __cea_db_iter_edid_next()
5024 iter->end = iter->index + size; in __cea_db_iter_edid_next()
5034 * - DisplayID v1.3 Appendix C: CEA Data Block within a DisplayID Data Block
5035 * - DisplayID v2.0 section 4.10 CTA DisplayID Data Block
5044 displayid_iter_for_each(block, &iter->displayid_iter) { in __cea_db_iter_displayid_next()
5045 if (block->tag != DATA_BLOCK_CTA) in __cea_db_iter_displayid_next()
5052 iter->index = sizeof(*block); in __cea_db_iter_displayid_next()
5053 iter->end = iter->index + block->num_bytes; in __cea_db_iter_displayid_next()
5065 if (iter->collection) { in __cea_db_iter_next()
5066 /* Current collection should always be valid. */ in __cea_db_iter_next()
5069 iter->collection = NULL; in __cea_db_iter_next()
5074 iter->index += sizeof(*db) + cea_db_payload_len(db); in __cea_db_iter_next()
5090 iter->collection = __cea_db_iter_edid_next(iter); in __cea_db_iter_next()
5091 if (!iter->collection) in __cea_db_iter_next()
5092 iter->collection = __cea_db_iter_displayid_next(iter); in __cea_db_iter_next()
5094 if (!iter->collection) in __cea_db_iter_next()
5108 displayid_iter_end(&iter->displayid_iter); in cea_db_iter_end()
5109 drm_edid_iter_end(&iter->edid_iter); in cea_db_iter_end()
5167 * Get the HF-EEODB override extension block count from EDID.
5177 * - HDMI 2.1 section 10.3.6 HDMI Forum EDID Extension Override Data Block
5183 /* No extensions according to base block, no HF-EEODB. */ in edid_hfeeodb_extension_block_count()
5187 /* HF-EEODB is always in the first EDID extension block only */ in edid_hfeeodb_extension_block_count()
5197 * Sinks that include the HF-EEODB in their E-EDID shall include one and in edid_hfeeodb_extension_block_count()
5198 * only one instance of the HF-EEODB in the E-EDID, occupying bytes 4 in edid_hfeeodb_extension_block_count()
5199 * through 6 of Block 1 of the E-EDID. in edid_hfeeodb_extension_block_count()
5208 * CTA-861 YCbCr 4:2:0 Capability Map Data Block (CTA Y420CMDB)
5218 struct drm_display_info *info = &connector->display_info; in parse_cta_y420cmdb()
5219 int i, map_len = cea_db_payload_len(db) - 1; in parse_cta_y420cmdb()
5249 info->color_formats |= DRM_COLOR_FORMAT_YCBCR420; in parse_cta_y420cmdb()
5274 cea_db_payload_len(db) - 1); in add_cea_modes()
5298 clock1 = cea_mode->clock; in fixup_detailed_cea_mode_clock()
5305 clock1 = cea_mode->clock; in fixup_detailed_cea_mode_clock()
5313 if (abs(mode->clock - clock1) < abs(mode->clock - clock2)) in fixup_detailed_cea_mode_clock()
5318 if (mode->clock == clock) in fixup_detailed_cea_mode_clock()
5321 drm_dbg_kms(connector->dev, in fixup_detailed_cea_mode_clock()
5322 "[CONNECTOR:%d:%s] detailed mode matches %s VIC %d, adjusting clock %d -> %d\n", in fixup_detailed_cea_mode_clock()
5323 connector->base.id, connector->name, in fixup_detailed_cea_mode_clock()
5324 type, vic, mode->clock, clock); in fixup_detailed_cea_mode_clock()
5325 mode->clock = clock; in fixup_detailed_cea_mode_clock()
5330 struct hdr_static_metadata *hdr_metadata = &connector->hdr_sink_metadata.hdmi_type1; in drm_calculate_luminance_range()
5332 &connector->display_info.luminance_range; in drm_calculate_luminance_range()
5339 if (!(hdr_metadata->metadata_type & BIT(HDMI_STATIC_METADATA_TYPE1))) in drm_calculate_luminance_range()
5342 max_avg = hdr_metadata->max_fall; in drm_calculate_luminance_range()
5343 min_cll = hdr_metadata->min_cll; in drm_calculate_luminance_range()
5346 * From the specification (CTA-861-G), for calculating the maximum in drm_calculate_luminance_range()
5349 * Where CV is a one-byte value. in drm_calculate_luminance_range()
5355 * need to pre-compute the value of r/32. For pre-computing the values in drm_calculate_luminance_range()
5369 luminance_range->min_luminance = min; in drm_calculate_luminance_range()
5370 luminance_range->max_luminance = max; in drm_calculate_luminance_range()
5395 connector->hdr_sink_metadata.hdmi_type1.eotf = in drm_parse_hdr_metadata_block()
5397 connector->hdr_sink_metadata.hdmi_type1.metadata_type = in drm_parse_hdr_metadata_block()
5401 connector->hdr_sink_metadata.hdmi_type1.max_cll = db[4]; in drm_parse_hdr_metadata_block()
5403 connector->hdr_sink_metadata.hdmi_type1.max_fall = db[5]; in drm_parse_hdr_metadata_block()
5405 connector->hdr_sink_metadata.hdmi_type1.min_cll = db[6]; in drm_parse_hdr_metadata_block()
5412 /* HDMI Vendor-Specific Data Block (HDMI VSDB, H14b-VSDB) */
5419 connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE] |= DRM_ELD_SUPPORTS_AI; in drm_parse_hdmi_vsdb_audio()
5422 connector->latency_present[0] = true; in drm_parse_hdmi_vsdb_audio()
5423 connector->video_latency[0] = db[9]; in drm_parse_hdmi_vsdb_audio()
5424 connector->audio_latency[0] = db[10]; in drm_parse_hdmi_vsdb_audio()
5428 connector->latency_present[1] = true; in drm_parse_hdmi_vsdb_audio()
5429 connector->video_latency[1] = db[11]; in drm_parse_hdmi_vsdb_audio()
5430 connector->audio_latency[1] = db[12]; in drm_parse_hdmi_vsdb_audio()
5433 drm_dbg_kms(connector->dev, in drm_parse_hdmi_vsdb_audio()
5435 connector->base.id, connector->name, in drm_parse_hdmi_vsdb_audio()
5436 connector->latency_present[0], connector->latency_present[1], in drm_parse_hdmi_vsdb_audio()
5437 connector->video_latency[0], connector->video_latency[1], in drm_parse_hdmi_vsdb_audio()
5438 connector->audio_latency[0], connector->audio_latency[1]); in drm_parse_hdmi_vsdb_audio()
5449 *res = timing->data.other_data.data.str.str; in monitor_name()
5472 * drm_edid_get_monitor_name - fetch the monitor name from the edid
5492 name_length = min(get_monitor_name(&drm_edid, buf), bufsize - 1); in drm_edid_get_monitor_name()
5502 mutex_lock(&connector->eld_mutex); in clear_eld()
5503 memset(connector->eld, 0, sizeof(connector->eld)); in clear_eld()
5504 mutex_unlock(&connector->eld_mutex); in clear_eld()
5506 connector->latency_present[0] = false; in clear_eld()
5507 connector->latency_present[1] = false; in clear_eld()
5508 connector->video_latency[0] = 0; in clear_eld()
5509 connector->audio_latency[0] = 0; in clear_eld()
5510 connector->video_latency[1] = 0; in clear_eld()
5511 connector->audio_latency[1] = 0; in clear_eld()
5515 * drm_edid_to_eld - build ELD from EDID
5519 * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The
5525 const struct drm_display_info *info = &connector->display_info; in drm_edid_to_eld()
5528 uint8_t *eld = connector->eld; in drm_edid_to_eld()
5535 mutex_lock(&connector->eld_mutex); in drm_edid_to_eld()
5538 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD monitor %s\n", in drm_edid_to_eld()
5539 connector->base.id, connector->name, in drm_edid_to_eld()
5542 eld[DRM_ELD_CEA_EDID_VER_MNL] = info->cea_rev << DRM_ELD_CEA_EDID_VER_SHIFT; in drm_edid_to_eld()
5547 eld[DRM_ELD_MANUFACTURER_NAME0] = drm_edid->edid->mfg_id[0]; in drm_edid_to_eld()
5548 eld[DRM_ELD_MANUFACTURER_NAME1] = drm_edid->edid->mfg_id[1]; in drm_edid_to_eld()
5549 eld[DRM_ELD_PRODUCT_CODE0] = drm_edid->edid->prod_code[0]; in drm_edid_to_eld()
5550 eld[DRM_ELD_PRODUCT_CODE1] = drm_edid->edid->prod_code[1]; in drm_edid_to_eld()
5561 sad_count = min(len / 3, 15 - total_sad_count); in drm_edid_to_eld()
5573 /* HDMI Vendor-Specific Data Block */ in drm_edid_to_eld()
5585 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || in drm_edid_to_eld()
5586 connector->connector_type == DRM_MODE_CONNECTOR_eDP) in drm_edid_to_eld()
5594 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD size %d, SAD count %d\n", in drm_edid_to_eld()
5595 connector->base.id, connector->name, in drm_edid_to_eld()
5598 mutex_unlock(&connector->eld_mutex); in drm_edid_to_eld()
5616 return -ENOMEM; in _drm_edid_to_sad()
5618 const u8 *sad = &db->data[j * 3]; in _drm_edid_to_sad()
5636 * drm_edid_to_sad - extracts SADs from EDID
5665 *sadb = kmemdup(db->data, cea_db_payload_len(db), in _drm_edid_to_speaker_allocation()
5668 return -ENOMEM; in _drm_edid_to_speaker_allocation()
5681 * drm_edid_to_speaker_allocation - extracts Speaker Allocation Data Blocks from EDID
5702 * drm_av_sync_delay - compute the HDMI/DP sink audio-video sync delay
5706 * Return: The HDMI/DP sink's audio-video sync delay in milliseconds or 0 if
5712 int i = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_av_sync_delay()
5715 if (!connector->latency_present[0]) in drm_av_sync_delay()
5717 if (!connector->latency_present[1]) in drm_av_sync_delay()
5720 a = connector->audio_latency[i]; in drm_av_sync_delay()
5721 v = connector->video_latency[i]; in drm_av_sync_delay()
5734 a = min(2 * (a - 1), 500); in drm_av_sync_delay()
5736 v = min(2 * (v - 1), 500); in drm_av_sync_delay()
5738 return max(v - a, 0); in drm_av_sync_delay()
5765 * drm_detect_hdmi_monitor - detect whether monitor is HDMI
5768 * Parse the CEA extension according to CEA-861-B.
5826 * drm_detect_monitor_audio - check monitor audio capability
5847 * drm_default_rgb_quant_range - default RGB quantization range
5851 * as specified in CEA-861.
5865 /* CTA-861 Video Data Block (CTA VDB) */
5868 struct drm_display_info *info = &connector->display_info; in parse_cta_vdb()
5877 vics = krealloc(info->vics, info->vics_len + len, GFP_KERNEL); in parse_cta_vdb()
5881 vic_index = info->vics_len; in parse_cta_vdb()
5882 info->vics_len += len; in parse_cta_vdb()
5883 info->vics = vics; in parse_cta_vdb()
5891 info->vics[vic_index++] = vic; in parse_cta_vdb()
5903 struct drm_display_info *info = &connector->display_info; in update_cta_y420cmdb()
5904 struct drm_hdmi_info *hdmi = &info->hdmi; in update_cta_y420cmdb()
5905 int i, len = min_t(int, info->vics_len, BITS_PER_TYPE(y420cmdb_map)); in update_cta_y420cmdb()
5908 u8 vic = info->vics[i]; in update_cta_y420cmdb()
5911 bitmap_set(hdmi->y420_cmdb_modes, vic, 1); in update_cta_y420cmdb()
5917 const struct drm_display_info *info = &connector->display_info; in cta_vdb_has_vic()
5920 if (!vic || !info->vics) in cta_vdb_has_vic()
5923 for (i = 0; i < info->vics_len; i++) { in cta_vdb_has_vic()
5924 if (info->vics[i] == vic) in cta_vdb_has_vic()
5931 /* CTA-861-H YCbCr 4:2:0 Video Data Block (CTA Y420VDB) */
5935 struct drm_display_info *info = &connector->display_info; in parse_cta_y420vdb()
5936 struct drm_hdmi_info *hdmi = &info->hdmi; in parse_cta_y420vdb()
5940 for (i = 0; i < cea_db_payload_len(db) - 1; i++) { in parse_cta_y420vdb()
5946 bitmap_set(hdmi->y420_vdb_modes, vic, 1); in parse_cta_y420vdb()
5947 info->color_formats |= DRM_COLOR_FORMAT_YCBCR420; in parse_cta_y420vdb()
5953 struct drm_display_info *info = &connector->display_info; in drm_parse_vcdb()
5955 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] CEA VCDB 0x%02x\n", in drm_parse_vcdb()
5956 connector->base.id, connector->name, db[2]); in drm_parse_vcdb()
5959 info->rgb_quant_range_selectable = true; in drm_parse_vcdb()
6001 struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; in drm_parse_ycbcr420_deep_color_info()
6004 hdmi->y420_dc_modes = dc_mask; in drm_parse_ycbcr420_deep_color_info()
6010 hdmi_dsc->v_1p2 = hf_scds[11] & DRM_EDID_DSC_1P2; in drm_parse_dsc_info()
6012 if (!hdmi_dsc->v_1p2) in drm_parse_dsc_info()
6015 hdmi_dsc->native_420 = hf_scds[11] & DRM_EDID_DSC_NATIVE_420; in drm_parse_dsc_info()
6016 hdmi_dsc->all_bpp = hf_scds[11] & DRM_EDID_DSC_ALL_BPP; in drm_parse_dsc_info()
6019 hdmi_dsc->bpc_supported = 16; in drm_parse_dsc_info()
6021 hdmi_dsc->bpc_supported = 12; in drm_parse_dsc_info()
6023 hdmi_dsc->bpc_supported = 10; in drm_parse_dsc_info()
6026 hdmi_dsc->bpc_supported = 8; in drm_parse_dsc_info()
6033 drm_get_max_frl_rate(dsc_max_frl_rate, &hdmi_dsc->max_lanes, in drm_parse_dsc_info()
6034 &hdmi_dsc->max_frl_rate_per_lane); in drm_parse_dsc_info()
6040 hdmi_dsc->max_slices = 1; in drm_parse_dsc_info()
6041 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6044 hdmi_dsc->max_slices = 2; in drm_parse_dsc_info()
6045 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6048 hdmi_dsc->max_slices = 4; in drm_parse_dsc_info()
6049 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6052 hdmi_dsc->max_slices = 8; in drm_parse_dsc_info()
6053 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6056 hdmi_dsc->max_slices = 8; in drm_parse_dsc_info()
6057 hdmi_dsc->clk_per_slice = 400; in drm_parse_dsc_info()
6060 hdmi_dsc->max_slices = 12; in drm_parse_dsc_info()
6061 hdmi_dsc->clk_per_slice = 400; in drm_parse_dsc_info()
6064 hdmi_dsc->max_slices = 16; in drm_parse_dsc_info()
6065 hdmi_dsc->clk_per_slice = 400; in drm_parse_dsc_info()
6069 hdmi_dsc->max_slices = 0; in drm_parse_dsc_info()
6070 hdmi_dsc->clk_per_slice = 0; in drm_parse_dsc_info()
6075 hdmi_dsc->total_chunk_kbytes = hf_scds[13] & DRM_EDID_DSC_TOTAL_CHUNK_KBYTES; in drm_parse_dsc_info()
6082 struct drm_display_info *info = &connector->display_info; in drm_parse_hdmi_forum_scds()
6083 struct drm_hdmi_info *hdmi = &info->hdmi; in drm_parse_hdmi_forum_scds()
6084 struct drm_hdmi_dsc_cap *hdmi_dsc = &hdmi->dsc_cap; in drm_parse_hdmi_forum_scds()
6089 info->has_hdmi_infoframe = true; in drm_parse_hdmi_forum_scds()
6092 hdmi->scdc.supported = true; in drm_parse_hdmi_forum_scds()
6094 hdmi->scdc.read_request = true; in drm_parse_hdmi_forum_scds()
6100 * * Availability of a HF-VSDB block in EDID (check) in drm_parse_hdmi_forum_scds()
6101 * * Non zero Max_TMDS_Char_Rate filed in HF-VSDB (let's check) in drm_parse_hdmi_forum_scds()
6107 struct drm_scdc *scdc = &hdmi->scdc; in drm_parse_hdmi_forum_scds()
6113 info->max_tmds_clock = max_tmds_clock; in drm_parse_hdmi_forum_scds()
6116 if (scdc->supported) { in drm_parse_hdmi_forum_scds()
6117 scdc->scrambling.supported = true; in drm_parse_hdmi_forum_scds()
6119 /* Few sinks support scrambling for clocks < 340M */ in drm_parse_hdmi_forum_scds()
6121 scdc->scrambling.low_rates = true; in drm_parse_hdmi_forum_scds()
6127 drm_get_max_frl_rate(max_frl_rate, &hdmi->max_lanes, in drm_parse_hdmi_forum_scds()
6128 &hdmi->max_frl_rate_per_lane); in drm_parse_hdmi_forum_scds()
6138 drm_dbg_kms(connector->dev, in drm_parse_hdmi_forum_scds()
6139 … "[CONNECTOR:%d:%s] HF-VSDB: max TMDS clock: %d KHz, HDMI 2.1 support: %s, DSC 1.2 support: %s\n", in drm_parse_hdmi_forum_scds()
6140 connector->base.id, connector->name, in drm_parse_hdmi_forum_scds()
6147 struct drm_display_info *info = &connector->display_info; in drm_parse_hdmi_deep_color_info()
6151 info->bpc = 8; in drm_parse_hdmi_deep_color_info()
6158 info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_30; in drm_parse_hdmi_deep_color_info()
6159 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n", in drm_parse_hdmi_deep_color_info()
6160 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6165 info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_36; in drm_parse_hdmi_deep_color_info()
6166 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n", in drm_parse_hdmi_deep_color_info()
6167 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6172 info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_48; in drm_parse_hdmi_deep_color_info()
6173 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n", in drm_parse_hdmi_deep_color_info()
6174 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6178 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] No deep color support on this HDMI sink.\n", in drm_parse_hdmi_deep_color_info()
6179 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6183 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Assigning HDMI sink color depth as %d bpc.\n", in drm_parse_hdmi_deep_color_info()
6184 connector->base.id, connector->name, dc_bpc); in drm_parse_hdmi_deep_color_info()
6185 info->bpc = dc_bpc; in drm_parse_hdmi_deep_color_info()
6189 info->edid_hdmi_ycbcr444_dc_modes = info->edid_hdmi_rgb444_dc_modes; in drm_parse_hdmi_deep_color_info()
6190 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n", in drm_parse_hdmi_deep_color_info()
6191 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6199 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink should do DC_36, but does not!\n", in drm_parse_hdmi_deep_color_info()
6200 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6204 /* HDMI Vendor-Specific Data Block (HDMI VSDB, H14b-VSDB) */
6208 struct drm_display_info *info = &connector->display_info; in drm_parse_hdmi_vsdb_video()
6211 info->is_hdmi = true; in drm_parse_hdmi_vsdb_video()
6214 info->dvi_dual = db[6] & 1; in drm_parse_hdmi_vsdb_video()
6216 info->max_tmds_clock = db[7] * 5000; in drm_parse_hdmi_vsdb_video()
6225 info->has_hdmi_infoframe = true; in drm_parse_hdmi_vsdb_video()
6227 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n", in drm_parse_hdmi_vsdb_video()
6228 connector->base.id, connector->name, in drm_parse_hdmi_vsdb_video()
6229 info->dvi_dual, info->max_tmds_clock); in drm_parse_hdmi_vsdb_video()
6235 * See EDID extension for head-mounted and specialized monitors, specified at:
6236 …* https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-exte…
6241 struct drm_display_info *info = &connector->display_info; in drm_parse_microsoft_vsdb()
6247 info->non_desktop = true; in drm_parse_microsoft_vsdb()
6249 drm_dbg_kms(connector->dev, in drm_parse_microsoft_vsdb()
6251 connector->base.id, connector->name, version, db[5]); in drm_parse_microsoft_vsdb()
6257 struct drm_display_info *info = &connector->display_info; in drm_parse_cea_ext()
6269 if (!info->cea_rev) in drm_parse_cea_ext()
6270 info->cea_rev = edid_ext[1]; in drm_parse_cea_ext()
6272 if (info->cea_rev != edid_ext[1]) in drm_parse_cea_ext()
6273 drm_dbg_kms(connector->dev, in drm_parse_cea_ext()
6275 connector->base.id, connector->name, in drm_parse_cea_ext()
6276 info->cea_rev, edid_ext[1]); in drm_parse_cea_ext()
6279 info->color_formats = DRM_COLOR_FORMAT_RGB444; in drm_parse_cea_ext()
6281 info->color_formats |= DRM_COLOR_FORMAT_YCBCR444; in drm_parse_cea_ext()
6283 info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; in drm_parse_cea_ext()
6285 info->has_audio = true; in drm_parse_cea_ext()
6313 info->has_audio = true; in drm_parse_cea_ext()
6325 struct drm_display_info *info = &closure->connector->display_info; in get_monitor_range()
6326 struct drm_monitor_range_info *monitor_range = &info->monitor_range; in get_monitor_range()
6327 const struct detailed_non_pixel *data = &timing->data.other_data; in get_monitor_range()
6328 const struct detailed_data_monitor_range *range = &data->data.range; in get_monitor_range()
6329 const struct edid *edid = closure->drm_edid->edid; in get_monitor_range()
6343 if (range->flags != DRM_EDID_RANGE_LIMITS_ONLY_FLAG) in get_monitor_range()
6346 monitor_range->min_vfreq = range->min_vfreq; in get_monitor_range()
6347 monitor_range->max_vfreq = range->max_vfreq; in get_monitor_range()
6349 if (edid->revision >= 4) { in get_monitor_range()
6350 if (data->pad2 & DRM_EDID_RANGE_OFFSET_MIN_VFREQ) in get_monitor_range()
6351 monitor_range->min_vfreq += 255; in get_monitor_range()
6352 if (data->pad2 & DRM_EDID_RANGE_OFFSET_MAX_VFREQ) in get_monitor_range()
6353 monitor_range->max_vfreq += 255; in get_monitor_range()
6360 const struct drm_display_info *info = &connector->display_info; in drm_get_monitor_range()
6366 if (drm_edid->edid->revision < 4) in drm_get_monitor_range()
6369 if (!(drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)) in drm_get_monitor_range()
6374 drm_dbg_kms(connector->dev, in drm_get_monitor_range()
6375 "[CONNECTOR:%d:%s] Supported Monitor Refresh rate range is %d Hz - %d Hz\n", in drm_get_monitor_range()
6376 connector->base.id, connector->name, in drm_get_monitor_range()
6377 info->monitor_range.min_vfreq, info->monitor_range.max_vfreq); in drm_get_monitor_range()
6385 struct drm_display_info *info = &connector->display_info; in drm_parse_vesa_mso_data()
6387 if (block->num_bytes < 3) { in drm_parse_vesa_mso_data()
6388 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6390 connector->base.id, connector->name, block->num_bytes); in drm_parse_vesa_mso_data()
6394 if (oui(vesa->oui[0], vesa->oui[1], vesa->oui[2]) != VESA_IEEE_OUI) in drm_parse_vesa_mso_data()
6397 if (sizeof(*vesa) != sizeof(*block) + block->num_bytes) { in drm_parse_vesa_mso_data()
6398 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6400 connector->base.id, connector->name); in drm_parse_vesa_mso_data()
6404 switch (FIELD_GET(DISPLAYID_VESA_MSO_MODE, vesa->mso)) { in drm_parse_vesa_mso_data()
6406 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Reserved MSO mode value\n", in drm_parse_vesa_mso_data()
6407 connector->base.id, connector->name); in drm_parse_vesa_mso_data()
6410 info->mso_stream_count = 0; in drm_parse_vesa_mso_data()
6413 info->mso_stream_count = 2; /* 2 or 4 links */ in drm_parse_vesa_mso_data()
6416 info->mso_stream_count = 4; /* 4 links */ in drm_parse_vesa_mso_data()
6420 if (!info->mso_stream_count) { in drm_parse_vesa_mso_data()
6421 info->mso_pixel_overlap = 0; in drm_parse_vesa_mso_data()
6425 info->mso_pixel_overlap = FIELD_GET(DISPLAYID_VESA_MSO_OVERLAP, vesa->mso); in drm_parse_vesa_mso_data()
6426 if (info->mso_pixel_overlap > 8) { in drm_parse_vesa_mso_data()
6427 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6429 connector->base.id, connector->name, in drm_parse_vesa_mso_data()
6430 info->mso_pixel_overlap); in drm_parse_vesa_mso_data()
6431 info->mso_pixel_overlap = 8; in drm_parse_vesa_mso_data()
6434 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6436 connector->base.id, connector->name, in drm_parse_vesa_mso_data()
6437 info->mso_stream_count, info->mso_pixel_overlap); in drm_parse_vesa_mso_data()
6448 if (block->tag == DATA_BLOCK_2_VENDOR_SPECIFIC) in drm_update_mso()
6459 struct drm_display_info *info = &connector->display_info; in drm_reset_display_info()
6461 info->width_mm = 0; in drm_reset_display_info()
6462 info->height_mm = 0; in drm_reset_display_info()
6464 info->bpc = 0; in drm_reset_display_info()
6465 info->color_formats = 0; in drm_reset_display_info()
6466 info->cea_rev = 0; in drm_reset_display_info()
6467 info->max_tmds_clock = 0; in drm_reset_display_info()
6468 info->dvi_dual = false; in drm_reset_display_info()
6469 info->is_hdmi = false; in drm_reset_display_info()
6470 info->has_audio = false; in drm_reset_display_info()
6471 info->has_hdmi_infoframe = false; in drm_reset_display_info()
6472 info->rgb_quant_range_selectable = false; in drm_reset_display_info()
6473 memset(&info->hdmi, 0, sizeof(info->hdmi)); in drm_reset_display_info()
6475 info->edid_hdmi_rgb444_dc_modes = 0; in drm_reset_display_info()
6476 info->edid_hdmi_ycbcr444_dc_modes = 0; in drm_reset_display_info()
6478 info->non_desktop = 0; in drm_reset_display_info()
6479 memset(&info->monitor_range, 0, sizeof(info->monitor_range)); in drm_reset_display_info()
6480 memset(&info->luminance_range, 0, sizeof(info->luminance_range)); in drm_reset_display_info()
6482 info->mso_stream_count = 0; in drm_reset_display_info()
6483 info->mso_pixel_overlap = 0; in drm_reset_display_info()
6484 info->max_dsc_bpp = 0; in drm_reset_display_info()
6486 kfree(info->vics); in drm_reset_display_info()
6487 info->vics = NULL; in drm_reset_display_info()
6488 info->vics_len = 0; in drm_reset_display_info()
6490 info->quirks = 0; in drm_reset_display_info()
6496 struct drm_display_info *info = &connector->display_info; in update_displayid_info()
6505 info->non_desktop = true; in update_displayid_info()
6519 struct drm_display_info *info = &connector->display_info; in update_display_info()
6528 edid = drm_edid->edid; in update_display_info()
6530 info->quirks = edid_get_quirks(drm_edid); in update_display_info()
6532 info->width_mm = edid->width_cm * 10; in update_display_info()
6533 info->height_mm = edid->height_cm * 10; in update_display_info()
6537 if (edid->revision < 3) in update_display_info()
6540 if (!(edid->input & DRM_EDID_INPUT_DIGITAL)) in update_display_info()
6543 info->color_formats |= DRM_COLOR_FORMAT_RGB444; in update_display_info()
6555 if (info->bpc == 0 && edid->revision == 3 && in update_display_info()
6556 edid->input & DRM_EDID_DIGITAL_DFP_1_X) { in update_display_info()
6557 info->bpc = 8; in update_display_info()
6558 drm_dbg_kms(connector->dev, in update_display_info()
6560 connector->base.id, connector->name, info->bpc); in update_display_info()
6564 if (edid->revision < 4) in update_display_info()
6567 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) { in update_display_info()
6569 info->bpc = 6; in update_display_info()
6572 info->bpc = 8; in update_display_info()
6575 info->bpc = 10; in update_display_info()
6578 info->bpc = 12; in update_display_info()
6581 info->bpc = 14; in update_display_info()
6584 info->bpc = 16; in update_display_info()
6588 info->bpc = 0; in update_display_info()
6592 drm_dbg_kms(connector->dev, in update_display_info()
6593 "[CONNECTOR:%d:%s] Assigning EDID-1.4 digital sink color depth as %d bpc.\n", in update_display_info()
6594 connector->base.id, connector->name, info->bpc); in update_display_info()
6596 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) in update_display_info()
6597 info->color_formats |= DRM_COLOR_FORMAT_YCBCR444; in update_display_info()
6598 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) in update_display_info()
6599 info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; in update_display_info()
6604 if (info->quirks & EDID_QUIRK_NON_DESKTOP) { in update_display_info()
6605 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Non-desktop display%s\n", in update_display_info()
6606 connector->base.id, connector->name, in update_display_info()
6607 info->non_desktop ? " (redundant quirk)" : ""); in update_display_info()
6608 info->non_desktop = true; in update_display_info()
6611 if (info->quirks & EDID_QUIRK_CAP_DSC_15BPP) in update_display_info()
6612 info->max_dsc_bpp = 15; in update_display_info()
6614 if (info->quirks & EDID_QUIRK_FORCE_6BPC) in update_display_info()
6615 info->bpc = 6; in update_display_info()
6617 if (info->quirks & EDID_QUIRK_FORCE_8BPC) in update_display_info()
6618 info->bpc = 8; in update_display_info()
6620 if (info->quirks & EDID_QUIRK_FORCE_10BPC) in update_display_info()
6621 info->bpc = 10; in update_display_info()
6623 if (info->quirks & EDID_QUIRK_FORCE_12BPC) in update_display_info()
6624 info->bpc = 12; in update_display_info()
6626 /* Depends on info->cea_rev set by drm_parse_cea_ext() above */ in update_display_info()
6635 unsigned pixel_clock = (timings->pixel_clock[0] | in drm_mode_displayid_detailed()
6636 (timings->pixel_clock[1] << 8) | in drm_mode_displayid_detailed()
6637 (timings->pixel_clock[2] << 16)) + 1; in drm_mode_displayid_detailed()
6638 unsigned hactive = (timings->hactive[0] | timings->hactive[1] << 8) + 1; in drm_mode_displayid_detailed()
6639 unsigned hblank = (timings->hblank[0] | timings->hblank[1] << 8) + 1; in drm_mode_displayid_detailed()
6640 unsigned hsync = (timings->hsync[0] | (timings->hsync[1] & 0x7f) << 8) + 1; in drm_mode_displayid_detailed()
6641 unsigned hsync_width = (timings->hsw[0] | timings->hsw[1] << 8) + 1; in drm_mode_displayid_detailed()
6642 unsigned vactive = (timings->vactive[0] | timings->vactive[1] << 8) + 1; in drm_mode_displayid_detailed()
6643 unsigned vblank = (timings->vblank[0] | timings->vblank[1] << 8) + 1; in drm_mode_displayid_detailed()
6644 unsigned vsync = (timings->vsync[0] | (timings->vsync[1] & 0x7f) << 8) + 1; in drm_mode_displayid_detailed()
6645 unsigned vsync_width = (timings->vsw[0] | timings->vsw[1] << 8) + 1; in drm_mode_displayid_detailed()
6646 bool hsync_positive = (timings->hsync[1] >> 7) & 0x1; in drm_mode_displayid_detailed()
6647 bool vsync_positive = (timings->vsync[1] >> 7) & 0x1; in drm_mode_displayid_detailed()
6654 mode->clock = type_7 ? pixel_clock : pixel_clock * 10; in drm_mode_displayid_detailed()
6655 mode->hdisplay = hactive; in drm_mode_displayid_detailed()
6656 mode->hsync_start = mode->hdisplay + hsync; in drm_mode_displayid_detailed()
6657 mode->hsync_end = mode->hsync_start + hsync_width; in drm_mode_displayid_detailed()
6658 mode->htotal = mode->hdisplay + hblank; in drm_mode_displayid_detailed()
6660 mode->vdisplay = vactive; in drm_mode_displayid_detailed()
6661 mode->vsync_start = mode->vdisplay + vsync; in drm_mode_displayid_detailed()
6662 mode->vsync_end = mode->vsync_start + vsync_width; in drm_mode_displayid_detailed()
6663 mode->vtotal = mode->vdisplay + vblank; in drm_mode_displayid_detailed()
6665 mode->flags = 0; in drm_mode_displayid_detailed()
6666 mode->flags |= hsync_positive ? DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC; in drm_mode_displayid_detailed()
6667 mode->flags |= vsync_positive ? DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC; in drm_mode_displayid_detailed()
6668 mode->type = DRM_MODE_TYPE_DRIVER; in drm_mode_displayid_detailed()
6670 if (timings->flags & 0x80) in drm_mode_displayid_detailed()
6671 mode->type |= DRM_MODE_TYPE_PREFERRED; in drm_mode_displayid_detailed()
6685 bool type_7 = block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING; in add_displayid_detailed_1_modes()
6687 if (block->num_bytes % 20) in add_displayid_detailed_1_modes()
6690 num_timings = block->num_bytes / 20; in add_displayid_detailed_1_modes()
6692 struct displayid_detailed_timings_1 *timings = &det->timings[i]; in add_displayid_detailed_1_modes()
6694 newmode = drm_mode_displayid_detailed(connector->dev, timings, type_7); in add_displayid_detailed_1_modes()
6713 if (block->tag == DATA_BLOCK_TYPE_1_DETAILED_TIMING || in add_displayid_detailed_modes()
6714 block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING) in add_displayid_detailed_modes()
6725 const struct drm_display_info *info = &connector->display_info; in _drm_edid_connector_add_modes()
6733 * - preferred detailed mode in _drm_edid_connector_add_modes()
6734 * - other detailed modes from base block in _drm_edid_connector_add_modes()
6735 * - detailed modes from extension blocks in _drm_edid_connector_add_modes()
6736 * - CVT 3-byte code modes in _drm_edid_connector_add_modes()
6737 * - standard timing codes in _drm_edid_connector_add_modes()
6738 * - established timing codes in _drm_edid_connector_add_modes()
6739 * - modes inferred from GTF or CVT range information in _drm_edid_connector_add_modes()
6752 if (drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) in _drm_edid_connector_add_modes()
6755 if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75)) in _drm_edid_connector_add_modes()
6767 struct drm_device *dev = connector->dev; in _drm_edid_connector_property_update()
6770 if (connector->edid_blob_ptr) { in _drm_edid_connector_property_update()
6771 const struct edid *old_edid = connector->edid_blob_ptr->data; in _drm_edid_connector_property_update()
6774 if (!drm_edid_are_equal(drm_edid ? drm_edid->edid : NULL, old_edid)) { in _drm_edid_connector_property_update()
6775 connector->epoch_counter++; in _drm_edid_connector_property_update()
6777 connector->base.id, connector->name, in _drm_edid_connector_property_update()
6778 connector->epoch_counter); in _drm_edid_connector_property_update()
6784 &connector->edid_blob_ptr, in _drm_edid_connector_property_update()
6785 drm_edid ? drm_edid->size : 0, in _drm_edid_connector_property_update()
6786 drm_edid ? drm_edid->edid : NULL, in _drm_edid_connector_property_update()
6787 &connector->base, in _drm_edid_connector_property_update()
6788 dev->mode_config.edid_property); in _drm_edid_connector_property_update()
6791 connector->base.id, connector->name, ret); in _drm_edid_connector_property_update()
6795 ret = drm_object_property_set_value(&connector->base, in _drm_edid_connector_property_update()
6796 dev->mode_config.non_desktop_property, in _drm_edid_connector_property_update()
6797 connector->display_info.non_desktop); in _drm_edid_connector_property_update()
6799 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Non-desktop property update failed (%d)\n", in _drm_edid_connector_property_update()
6800 connector->base.id, connector->name, ret); in _drm_edid_connector_property_update()
6807 connector->base.id, connector->name, ret); in _drm_edid_connector_property_update()
6816 * drm_edid_connector_update - Update connector information from EDID
6841 * drm_edid_connector_add_modes - Update probed modes from the EDID property
6857 if (connector->edid_blob_ptr) in drm_edid_connector_add_modes()
6858 drm_edid = drm_edid_alloc(connector->edid_blob_ptr->data, in drm_edid_connector_add_modes()
6859 connector->edid_blob_ptr->length); in drm_edid_connector_add_modes()
6870 * drm_connector_update_edid_property - update the edid property of a connector
6895 * drm_add_edid_modes - add modes from EDID data, if available
6913 drm_warn(connector->dev, "[CONNECTOR:%d:%s] EDID invalid.\n", in drm_add_edid_modes()
6914 connector->base.id, connector->name); in drm_add_edid_modes()
6927 * drm_add_modes_noedid - add modes for the connectors without EDID
6942 struct drm_device *dev = connector->dev; in drm_add_modes_noedid()
6959 if (ptr->hdisplay > hdisplay || in drm_add_modes_noedid()
6960 ptr->vdisplay > vdisplay) in drm_add_modes_noedid()
6976 * drm_set_preferred_mode - Sets the preferred mode of a connector
6989 list_for_each_entry(mode, &connector->probed_modes, head) { in drm_set_preferred_mode()
6990 if (mode->hdisplay == hpref && in drm_set_preferred_mode()
6991 mode->vdisplay == vpref) in drm_set_preferred_mode()
6992 mode->type |= DRM_MODE_TYPE_PREFERRED; in drm_set_preferred_mode()
7000 * FIXME: sil-sii8620 doesn't have a connector around when in is_hdmi2_sink()
7006 return connector->display_info.hdmi.scdc.supported || in is_hdmi2_sink()
7007 connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; in is_hdmi2_sink()
7014 connector->display_info.has_hdmi_infoframe : false; in drm_mode_hdmi_vic()
7020 if (mode->flags & DRM_MODE_FLAG_3D_MASK) in drm_mode_hdmi_vic()
7042 * Avoid sending VICs defined in HDMI 2.0 in AVI infoframes to sinks that
7045 * HDMI 1.4 (CTA-861-D) VIC range: [1..64]
7046 * HDMI 2.0 (CTA-861-F) VIC range: [1..107]
7061 * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
7078 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7082 if (mode->flags & DRM_MODE_FLAG_DBLCLK) in drm_hdmi_avi_infoframe_from_display_mode()
7083 frame->pixel_repeat = 1; in drm_hdmi_avi_infoframe_from_display_mode()
7088 frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; in drm_hdmi_avi_infoframe_from_display_mode()
7095 frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; in drm_hdmi_avi_infoframe_from_display_mode()
7096 frame->itc = 0; in drm_hdmi_avi_infoframe_from_display_mode()
7102 picture_aspect = mode->picture_aspect_ratio; in drm_hdmi_avi_infoframe_from_display_mode()
7118 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7121 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7123 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7129 frame->video_code = vic_for_avi_infoframe(connector, vic); in drm_hdmi_avi_infoframe_from_display_mode()
7130 frame->picture_aspect = picture_aspect; in drm_hdmi_avi_infoframe_from_display_mode()
7131 frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; in drm_hdmi_avi_infoframe_from_display_mode()
7132 frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN; in drm_hdmi_avi_infoframe_from_display_mode()
7139 * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
7152 const struct drm_display_info *info = &connector->display_info; in drm_hdmi_avi_infoframe_quant_range()
7155 * CEA-861: in drm_hdmi_avi_infoframe_quant_range()
7156 * "A Source shall not send a non-zero Q value that does not correspond in drm_hdmi_avi_infoframe_quant_range()
7161 * HDMI 2.0 recommends sending non-zero Q when it does match the in drm_hdmi_avi_infoframe_quant_range()
7164 if (info->rgb_quant_range_selectable || in drm_hdmi_avi_infoframe_quant_range()
7166 frame->quantization_range = rgb_quant_range; in drm_hdmi_avi_infoframe_quant_range()
7168 frame->quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; in drm_hdmi_avi_infoframe_quant_range()
7171 * CEA-861-F: in drm_hdmi_avi_infoframe_quant_range()
7173 * YQ-field to match the RGB Quantization Range being transmitted in drm_hdmi_avi_infoframe_quant_range()
7175 * set YQ=1) and the Sink shall ignore the YQ-field." in drm_hdmi_avi_infoframe_quant_range()
7177 * Unfortunate certain sinks (eg. VIZ Model 67/E261VA) get confused in drm_hdmi_avi_infoframe_quant_range()
7178 * by non-zero YQ when receiving RGB. There doesn't seem to be any in drm_hdmi_avi_infoframe_quant_range()
7179 * good way to tell which version of CEA-861 the sink supports, so in drm_hdmi_avi_infoframe_quant_range()
7180 * we limit non-zero YQ to HDMI 2.0 sinks only as HDMI 2.0 is based in drm_hdmi_avi_infoframe_quant_range()
7181 * on CEA-861-F. in drm_hdmi_avi_infoframe_quant_range()
7185 frame->ycc_quantization_range = in drm_hdmi_avi_infoframe_quant_range()
7188 frame->ycc_quantization_range = in drm_hdmi_avi_infoframe_quant_range()
7196 u32 layout = mode->flags & DRM_MODE_FLAG_3D_MASK; in s3d_structure_from_display_mode()
7221 * drm_hdmi_vendor_infoframe_from_display_mode() - fill an HDMI infoframe with
7229 * function will return -EINVAL, error that can be safely ignored.
7239 * FIXME: sil-sii8620 doesn't have a connector around when in drm_hdmi_vendor_infoframe_from_display_mode()
7243 connector->display_info.has_hdmi_infoframe : false; in drm_hdmi_vendor_infoframe_from_display_mode()
7247 return -EINVAL; in drm_hdmi_vendor_infoframe_from_display_mode()
7250 return -EINVAL; in drm_hdmi_vendor_infoframe_from_display_mode()
7260 * suggestion in HDMI 2.0 Appendix F. Apparently some sinks in drm_hdmi_vendor_infoframe_from_display_mode()
7265 frame->vic = drm_mode_hdmi_vic(connector, mode); in drm_hdmi_vendor_infoframe_from_display_mode()
7266 frame->s3d_struct = s3d_structure_from_display_mode(mode); in drm_hdmi_vendor_infoframe_from_display_mode()
7281 w = tile->tile_size[0] | tile->tile_size[1] << 8; in drm_parse_tiled_block()
7282 h = tile->tile_size[2] | tile->tile_size[3] << 8; in drm_parse_tiled_block()
7284 num_v_tile = (tile->topo[0] & 0xf) | (tile->topo[2] & 0x30); in drm_parse_tiled_block()
7285 num_h_tile = (tile->topo[0] >> 4) | ((tile->topo[2] >> 2) & 0x30); in drm_parse_tiled_block()
7286 tile_v_loc = (tile->topo[1] & 0xf) | ((tile->topo[2] & 0x3) << 4); in drm_parse_tiled_block()
7287 tile_h_loc = (tile->topo[1] >> 4) | (((tile->topo[2] >> 2) & 0x3) << 4); in drm_parse_tiled_block()
7289 connector->has_tile = true; in drm_parse_tiled_block()
7290 if (tile->tile_cap & 0x80) in drm_parse_tiled_block()
7291 connector->tile_is_single_monitor = true; in drm_parse_tiled_block()
7293 connector->num_h_tile = num_h_tile + 1; in drm_parse_tiled_block()
7294 connector->num_v_tile = num_v_tile + 1; in drm_parse_tiled_block()
7295 connector->tile_h_loc = tile_h_loc; in drm_parse_tiled_block()
7296 connector->tile_v_loc = tile_v_loc; in drm_parse_tiled_block()
7297 connector->tile_h_size = w + 1; in drm_parse_tiled_block()
7298 connector->tile_v_size = h + 1; in drm_parse_tiled_block()
7300 drm_dbg_kms(connector->dev, in drm_parse_tiled_block()
7301 "[CONNECTOR:%d:%s] tile cap 0x%x, size %dx%d, num tiles %dx%d, location %dx%d, vend %c%c%c", in drm_parse_tiled_block()
7302 connector->base.id, connector->name, in drm_parse_tiled_block()
7303 tile->tile_cap, in drm_parse_tiled_block()
7304 connector->tile_h_size, connector->tile_v_size, in drm_parse_tiled_block()
7305 connector->num_h_tile, connector->num_v_tile, in drm_parse_tiled_block()
7306 connector->tile_h_loc, connector->tile_v_loc, in drm_parse_tiled_block()
7307 tile->topology_id[0], tile->topology_id[1], tile->topology_id[2]); in drm_parse_tiled_block()
7309 tg = drm_mode_get_tile_group(connector->dev, tile->topology_id); in drm_parse_tiled_block()
7311 tg = drm_mode_create_tile_group(connector->dev, tile->topology_id); in drm_parse_tiled_block()
7315 if (connector->tile_group != tg) { in drm_parse_tiled_block()
7318 if (connector->tile_group) in drm_parse_tiled_block()
7319 drm_mode_put_tile_group(connector->dev, connector->tile_group); in drm_parse_tiled_block()
7320 connector->tile_group = tg; in drm_parse_tiled_block()
7323 drm_mode_put_tile_group(connector->dev, tg); in drm_parse_tiled_block()
7331 block->tag == DATA_BLOCK_TILED_DISPLAY) || in displayid_is_tiled_block()
7333 block->tag == DATA_BLOCK_2_TILED_DISPLAY_TOPOLOGY); in displayid_is_tiled_block()
7342 connector->has_tile = false; in _drm_update_tile_info()
7351 if (!connector->has_tile && connector->tile_group) { in _drm_update_tile_info()
7352 drm_mode_put_tile_group(connector->dev, connector->tile_group); in _drm_update_tile_info()
7353 connector->tile_group = NULL; in _drm_update_tile_info()