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
83 /* Force reduced-blanking timings for detailed modes */
141 /* BOE model on HP Pavilion 15-n233sl reports 8 bpc, but is a 6 bpc panel */
147 /* SDC panel of Lenovo B50-80 reports 8 bpc, but is a 6 bpc panel */
157 /* Envision Peripherals, Inc. EN-7100e */
175 /* LG Philips LCD LP154W01-A5 */
181 /* Samsung SyncMaster 22[5-6]BW */
185 /* Sony PVM-2541A does up to 12 bpc, but only reports max 8 bpc */
197 /* Panel in Samsung NP700G7A-S01PL notebook reports 6bpc */
200 /* Rotel RSX-1058 forwards sink's EDID but only does HDMI 1.1*/
256 /* 0x01 - 640x350@85Hz */
260 /* 0x02 - 640x400@85Hz */
264 /* 0x03 - 720x400@85Hz */
268 /* 0x04 - 640x480@60Hz */
272 /* 0x05 - 640x480@72Hz */
276 /* 0x06 - 640x480@75Hz */
280 /* 0x07 - 640x480@85Hz */
284 /* 0x08 - 800x600@56Hz */
288 /* 0x09 - 800x600@60Hz */
292 /* 0x0a - 800x600@72Hz */
296 /* 0x0b - 800x600@75Hz */
300 /* 0x0c - 800x600@85Hz */
304 /* 0x0d - 800x600@120Hz RB */
308 /* 0x0e - 848x480@60Hz */
312 /* 0x0f - 1024x768@43Hz, interlace */
317 /* 0x10 - 1024x768@60Hz */
321 /* 0x11 - 1024x768@70Hz */
325 /* 0x12 - 1024x768@75Hz */
329 /* 0x13 - 1024x768@85Hz */
333 /* 0x14 - 1024x768@120Hz RB */
337 /* 0x15 - 1152x864@75Hz */
341 /* 0x55 - 1280x720@60Hz */
345 /* 0x16 - 1280x768@60Hz RB */
349 /* 0x17 - 1280x768@60Hz */
353 /* 0x18 - 1280x768@75Hz */
357 /* 0x19 - 1280x768@85Hz */
361 /* 0x1a - 1280x768@120Hz RB */
365 /* 0x1b - 1280x800@60Hz RB */
369 /* 0x1c - 1280x800@60Hz */
373 /* 0x1d - 1280x800@75Hz */
377 /* 0x1e - 1280x800@85Hz */
381 /* 0x1f - 1280x800@120Hz RB */
385 /* 0x20 - 1280x960@60Hz */
389 /* 0x21 - 1280x960@85Hz */
393 /* 0x22 - 1280x960@120Hz RB */
397 /* 0x23 - 1280x1024@60Hz */
401 /* 0x24 - 1280x1024@75Hz */
405 /* 0x25 - 1280x1024@85Hz */
409 /* 0x26 - 1280x1024@120Hz RB */
413 /* 0x27 - 1360x768@60Hz */
417 /* 0x28 - 1360x768@120Hz RB */
421 /* 0x51 - 1366x768@60Hz */
425 /* 0x56 - 1366x768@60Hz */
429 /* 0x29 - 1400x1050@60Hz RB */
433 /* 0x2a - 1400x1050@60Hz */
437 /* 0x2b - 1400x1050@75Hz */
441 /* 0x2c - 1400x1050@85Hz */
445 /* 0x2d - 1400x1050@120Hz RB */
449 /* 0x2e - 1440x900@60Hz RB */
453 /* 0x2f - 1440x900@60Hz */
457 /* 0x30 - 1440x900@75Hz */
461 /* 0x31 - 1440x900@85Hz */
465 /* 0x32 - 1440x900@120Hz RB */
469 /* 0x53 - 1600x900@60Hz */
473 /* 0x33 - 1600x1200@60Hz */
477 /* 0x34 - 1600x1200@65Hz */
481 /* 0x35 - 1600x1200@70Hz */
485 /* 0x36 - 1600x1200@75Hz */
489 /* 0x37 - 1600x1200@85Hz */
493 /* 0x38 - 1600x1200@120Hz RB */
497 /* 0x39 - 1680x1050@60Hz RB */
501 /* 0x3a - 1680x1050@60Hz */
505 /* 0x3b - 1680x1050@75Hz */
509 /* 0x3c - 1680x1050@85Hz */
513 /* 0x3d - 1680x1050@120Hz RB */
517 /* 0x3e - 1792x1344@60Hz */
521 /* 0x3f - 1792x1344@75Hz */
525 /* 0x40 - 1792x1344@120Hz RB */
529 /* 0x41 - 1856x1392@60Hz */
533 /* 0x42 - 1856x1392@75Hz */
537 /* 0x43 - 1856x1392@120Hz RB */
541 /* 0x52 - 1920x1080@60Hz */
545 /* 0x44 - 1920x1200@60Hz RB */
549 /* 0x45 - 1920x1200@60Hz */
553 /* 0x46 - 1920x1200@75Hz */
557 /* 0x47 - 1920x1200@85Hz */
561 /* 0x48 - 1920x1200@120Hz RB */
565 /* 0x49 - 1920x1440@60Hz */
569 /* 0x4a - 1920x1440@75Hz */
573 /* 0x4b - 1920x1440@120Hz RB */
577 /* 0x54 - 2048x1152@60Hz */
581 /* 0x4c - 2560x1600@60Hz RB */
585 /* 0x4d - 2560x1600@60Hz */
589 /* 0x4e - 2560x1600@75Hz */
593 /* 0x4f - 2560x1600@85Hz */
597 /* 0x50 - 2560x1600@120Hz RB */
601 /* 0x57 - 4096x2160@60Hz RB */
605 /* 0x58 - 4096x2160@59.94Hz RB */
614 * modes are old-school Mac modes. The EDID spec says the 1152x864@75 mode
618 * The DMT modes have been fact-checked; the rest are mild guesses.
745 * From CEA/CTA-861 spec.
750 /* 1 - 640x480@60Hz 4:3 */
755 /* 2 - 720x480@60Hz 4:3 */
760 /* 3 - 720x480@60Hz 16:9 */
765 /* 4 - 1280x720@60Hz 16:9 */
770 /* 5 - 1920x1080i@60Hz 16:9 */
776 /* 6 - 720(1440)x480i@60Hz 4:3 */
782 /* 7 - 720(1440)x480i@60Hz 16:9 */
788 /* 8 - 720(1440)x240@60Hz 4:3 */
794 /* 9 - 720(1440)x240@60Hz 16:9 */
800 /* 10 - 2880x480i@60Hz 4:3 */
806 /* 11 - 2880x480i@60Hz 16:9 */
812 /* 12 - 2880x240@60Hz 4:3 */
817 /* 13 - 2880x240@60Hz 16:9 */
822 /* 14 - 1440x480@60Hz 4:3 */
827 /* 15 - 1440x480@60Hz 16:9 */
832 /* 16 - 1920x1080@60Hz 16:9 */
837 /* 17 - 720x576@50Hz 4:3 */
842 /* 18 - 720x576@50Hz 16:9 */
847 /* 19 - 1280x720@50Hz 16:9 */
852 /* 20 - 1920x1080i@50Hz 16:9 */
858 /* 21 - 720(1440)x576i@50Hz 4:3 */
864 /* 22 - 720(1440)x576i@50Hz 16:9 */
870 /* 23 - 720(1440)x288@50Hz 4:3 */
876 /* 24 - 720(1440)x288@50Hz 16:9 */
882 /* 25 - 2880x576i@50Hz 4:3 */
888 /* 26 - 2880x576i@50Hz 16:9 */
894 /* 27 - 2880x288@50Hz 4:3 */
899 /* 28 - 2880x288@50Hz 16:9 */
904 /* 29 - 1440x576@50Hz 4:3 */
909 /* 30 - 1440x576@50Hz 16:9 */
914 /* 31 - 1920x1080@50Hz 16:9 */
919 /* 32 - 1920x1080@24Hz 16:9 */
924 /* 33 - 1920x1080@25Hz 16:9 */
929 /* 34 - 1920x1080@30Hz 16:9 */
934 /* 35 - 2880x480@60Hz 4:3 */
939 /* 36 - 2880x480@60Hz 16:9 */
944 /* 37 - 2880x576@50Hz 4:3 */
949 /* 38 - 2880x576@50Hz 16:9 */
954 /* 39 - 1920x1080i@50Hz 16:9 */
960 /* 40 - 1920x1080i@100Hz 16:9 */
966 /* 41 - 1280x720@100Hz 16:9 */
971 /* 42 - 720x576@100Hz 4:3 */
976 /* 43 - 720x576@100Hz 16:9 */
981 /* 44 - 720(1440)x576i@100Hz 4:3 */
987 /* 45 - 720(1440)x576i@100Hz 16:9 */
993 /* 46 - 1920x1080i@120Hz 16:9 */
999 /* 47 - 1280x720@120Hz 16:9 */
1004 /* 48 - 720x480@120Hz 4:3 */
1009 /* 49 - 720x480@120Hz 16:9 */
1014 /* 50 - 720(1440)x480i@120Hz 4:3 */
1020 /* 51 - 720(1440)x480i@120Hz 16:9 */
1026 /* 52 - 720x576@200Hz 4:3 */
1031 /* 53 - 720x576@200Hz 16:9 */
1036 /* 54 - 720(1440)x576i@200Hz 4:3 */
1042 /* 55 - 720(1440)x576i@200Hz 16:9 */
1048 /* 56 - 720x480@240Hz 4:3 */
1053 /* 57 - 720x480@240Hz 16:9 */
1058 /* 58 - 720(1440)x480i@240Hz 4:3 */
1064 /* 59 - 720(1440)x480i@240Hz 16:9 */
1070 /* 60 - 1280x720@24Hz 16:9 */
1075 /* 61 - 1280x720@25Hz 16:9 */
1080 /* 62 - 1280x720@30Hz 16:9 */
1085 /* 63 - 1920x1080@120Hz 16:9 */
1090 /* 64 - 1920x1080@100Hz 16:9 */
1095 /* 65 - 1280x720@24Hz 64:27 */
1100 /* 66 - 1280x720@25Hz 64:27 */
1105 /* 67 - 1280x720@30Hz 64:27 */
1110 /* 68 - 1280x720@50Hz 64:27 */
1115 /* 69 - 1280x720@60Hz 64:27 */
1120 /* 70 - 1280x720@100Hz 64:27 */
1125 /* 71 - 1280x720@120Hz 64:27 */
1130 /* 72 - 1920x1080@24Hz 64:27 */
1135 /* 73 - 1920x1080@25Hz 64:27 */
1140 /* 74 - 1920x1080@30Hz 64:27 */
1145 /* 75 - 1920x1080@50Hz 64:27 */
1150 /* 76 - 1920x1080@60Hz 64:27 */
1155 /* 77 - 1920x1080@100Hz 64:27 */
1160 /* 78 - 1920x1080@120Hz 64:27 */
1165 /* 79 - 1680x720@24Hz 64:27 */
1170 /* 80 - 1680x720@25Hz 64:27 */
1175 /* 81 - 1680x720@30Hz 64:27 */
1180 /* 82 - 1680x720@50Hz 64:27 */
1185 /* 83 - 1680x720@60Hz 64:27 */
1190 /* 84 - 1680x720@100Hz 64:27 */
1195 /* 85 - 1680x720@120Hz 64:27 */
1200 /* 86 - 2560x1080@24Hz 64:27 */
1205 /* 87 - 2560x1080@25Hz 64:27 */
1210 /* 88 - 2560x1080@30Hz 64:27 */
1215 /* 89 - 2560x1080@50Hz 64:27 */
1220 /* 90 - 2560x1080@60Hz 64:27 */
1225 /* 91 - 2560x1080@100Hz 64:27 */
1230 /* 92 - 2560x1080@120Hz 64:27 */
1235 /* 93 - 3840x2160@24Hz 16:9 */
1240 /* 94 - 3840x2160@25Hz 16:9 */
1245 /* 95 - 3840x2160@30Hz 16:9 */
1250 /* 96 - 3840x2160@50Hz 16:9 */
1255 /* 97 - 3840x2160@60Hz 16:9 */
1260 /* 98 - 4096x2160@24Hz 256:135 */
1265 /* 99 - 4096x2160@25Hz 256:135 */
1270 /* 100 - 4096x2160@30Hz 256:135 */
1275 /* 101 - 4096x2160@50Hz 256:135 */
1280 /* 102 - 4096x2160@60Hz 256:135 */
1285 /* 103 - 3840x2160@24Hz 64:27 */
1290 /* 104 - 3840x2160@25Hz 64:27 */
1295 /* 105 - 3840x2160@30Hz 64:27 */
1300 /* 106 - 3840x2160@50Hz 64:27 */
1305 /* 107 - 3840x2160@60Hz 64:27 */
1310 /* 108 - 1280x720@48Hz 16:9 */
1315 /* 109 - 1280x720@48Hz 64:27 */
1320 /* 110 - 1680x720@48Hz 64:27 */
1325 /* 111 - 1920x1080@48Hz 16:9 */
1330 /* 112 - 1920x1080@48Hz 64:27 */
1335 /* 113 - 2560x1080@48Hz 64:27 */
1340 /* 114 - 3840x2160@48Hz 16:9 */
1345 /* 115 - 4096x2160@48Hz 256:135 */
1350 /* 116 - 3840x2160@48Hz 64:27 */
1355 /* 117 - 3840x2160@100Hz 16:9 */
1360 /* 118 - 3840x2160@120Hz 16:9 */
1365 /* 119 - 3840x2160@100Hz 64:27 */
1370 /* 120 - 3840x2160@120Hz 64:27 */
1375 /* 121 - 5120x2160@24Hz 64:27 */
1380 /* 122 - 5120x2160@25Hz 64:27 */
1385 /* 123 - 5120x2160@30Hz 64:27 */
1390 /* 124 - 5120x2160@48Hz 64:27 */
1395 /* 125 - 5120x2160@50Hz 64:27 */
1400 /* 126 - 5120x2160@60Hz 64:27 */
1405 /* 127 - 5120x2160@100Hz 64:27 */
1413 * From CEA/CTA-861 spec.
1418 /* 193 - 5120x2160@120Hz 64:27 */
1423 /* 194 - 7680x4320@24Hz 16:9 */
1428 /* 195 - 7680x4320@25Hz 16:9 */
1433 /* 196 - 7680x4320@30Hz 16:9 */
1438 /* 197 - 7680x4320@48Hz 16:9 */
1443 /* 198 - 7680x4320@50Hz 16:9 */
1448 /* 199 - 7680x4320@60Hz 16:9 */
1453 /* 200 - 7680x4320@100Hz 16:9 */
1458 /* 201 - 7680x4320@120Hz 16:9 */
1463 /* 202 - 7680x4320@24Hz 64:27 */
1468 /* 203 - 7680x4320@25Hz 64:27 */
1473 /* 204 - 7680x4320@30Hz 64:27 */
1478 /* 205 - 7680x4320@48Hz 64:27 */
1483 /* 206 - 7680x4320@50Hz 64:27 */
1488 /* 207 - 7680x4320@60Hz 64:27 */
1493 /* 208 - 7680x4320@100Hz 64:27 */
1498 /* 209 - 7680x4320@120Hz 64:27 */
1503 /* 210 - 10240x4320@24Hz 64:27 */
1508 /* 211 - 10240x4320@25Hz 64:27 */
1513 /* 212 - 10240x4320@30Hz 64:27 */
1518 /* 213 - 10240x4320@48Hz 64:27 */
1523 /* 214 - 10240x4320@50Hz 64:27 */
1528 /* 215 - 10240x4320@60Hz 64:27 */
1533 /* 216 - 10240x4320@100Hz 64:27 */
1538 /* 217 - 10240x4320@120Hz 64:27 */
1543 /* 218 - 4096x2160@100Hz 256:135 */
1548 /* 219 - 4096x2160@120Hz 256:135 */
1559 /* 0 - dummy, VICs start at 1 */
1561 /* 1 - 3840x2160@30Hz */
1567 /* 2 - 3840x2160@25Hz */
1573 /* 3 - 3840x2160@24Hz */
1579 /* 4 - 4096x2160@24Hz (SMPTE) */
1609 return edid->extensions; in edid_extension_block_count()
1645 num_blocks = edid_block_count(drm_edid->edid); in __drm_edid_block_count()
1647 /* HF-EEODB override */ in __drm_edid_block_count()
1648 if (drm_edid->size >= edid_size_by_blocks(2)) { in __drm_edid_block_count()
1652 * Note: HF-EEODB may specify a smaller extension count than the in __drm_edid_block_count()
1655 eeodb = edid_hfeeodb_block_count(drm_edid->edid); in __drm_edid_block_count()
1668 (int)drm_edid->size / EDID_LENGTH); in drm_edid_block_count()
1674 return drm_edid_block_count(drm_edid) - 1; in drm_edid_extension_block_count()
1679 return edid_block_data(drm_edid->edid, index); in drm_edid_block_data()
1685 return edid_extension_block_data(drm_edid->edid, index); in drm_edid_extension_block_data()
1700 drm_edid->edid = edid; in drm_edid_legacy_init()
1701 drm_edid->size = edid_size(edid); in drm_edid_legacy_init()
1721 /* Current block index. */
1730 iter->drm_edid = drm_edid; in drm_edid_iter_begin()
1737 if (!iter->drm_edid) in __drm_edid_iter_next()
1740 if (iter->index < drm_edid_block_count(iter->drm_edid)) in __drm_edid_iter_next()
1741 block = drm_edid_block_data(iter->drm_edid, iter->index++); in __drm_edid_iter_next()
1764 * drm_edid_header_is_valid - sanity check the header of the base EDID block
1777 if (edid->header[i] == edid_header[i]) in drm_edid_header_is_valid()
1788 "Minimum number of valid EDID header bytes (0-8, default 6)");
1796 for (i = 0; i < EDID_LENGTH - 1; i++) in edid_block_compute_checksum()
1799 crc = 0x100 - csum; in edid_block_compute_checksum()
1808 return block->checksum; in edid_block_get_checksum()
1826 bool edid1_present = drm_edid && drm_edid->edid && drm_edid->size; in drm_edid_eq()
1833 if (drm_edid->size != raw_edid_size) in drm_edid_eq()
1836 if (memcmp(drm_edid->edid, raw_edid, drm_edid->size)) in drm_edid_eq()
1885 if (block->version != 1) in edid_block_check()
1943 block->version); in edid_block_status_print()
2021 * drm_edid_is_valid - sanity check EDID data
2024 * Sanity-check an entire EDID record (including extensions)
2047 * drm_edid_valid - sanity check EDID data
2062 if (edid_size_by_blocks(__drm_edid_block_count(drm_edid)) != drm_edid->size) in drm_edid_valid()
2083 * Note: If the EDID uses HF-EEODB, but has invalid blocks, we'll revert in edid_filter_invalid_blocks()
2085 * modifying the HF-EEODB extension too. in edid_filter_invalid_blocks()
2104 edid->extensions = valid_blocks - 1; in edid_filter_invalid_blocks()
2105 edid->checksum = edid_block_compute_checksum(edid); in edid_filter_invalid_blocks()
2118 * drm_do_probe_ddc_edid() - get EDID information via I2C
2126 * Return: 0 on success or -1 on failure.
2139 * adapter reports EAGAIN. However, we find that bit-banging transfers in drm_do_probe_ddc_edid()
2165 * Avoid sending the segment addr to not upset non-compliant in drm_do_probe_ddc_edid()
2168 ret = i2c_transfer(adapter, &msgs[3 - xfers], xfers); in drm_do_probe_ddc_edid()
2170 if (ret == -ENXIO) { in drm_do_probe_ddc_edid()
2171 DRM_DEBUG_KMS("drm: skipping non-existent adapter %s\n", in drm_do_probe_ddc_edid()
2172 adapter->name); in drm_do_probe_ddc_edid()
2175 } while (ret != xfers && --retries); in drm_do_probe_ddc_edid()
2177 return ret == xfers ? 0 : -1; in drm_do_probe_ddc_edid()
2192 last_block = edid->extensions; in connector_bad_edid()
2196 connector->real_edid_checksum = in connector_bad_edid()
2199 if (connector->bad_edid_counter++ && !drm_debug_enabled(DRM_UT_KMS)) in connector_bad_edid()
2202 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID is invalid:\n", in connector_bad_edid()
2203 connector->base.id, connector->name); in connector_bad_edid()
2213 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_get()
2215 if (connector->edid_override) in drm_edid_override_get()
2216 override = drm_edid_dup(connector->edid_override); in drm_edid_override_get()
2218 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_get()
2231 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_show()
2233 drm_edid = connector->edid_override; in drm_edid_override_show()
2235 seq_write(m, drm_edid->edid, drm_edid->size); in drm_edid_override_show()
2237 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_show()
2250 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override invalid\n", in drm_edid_override_set()
2251 connector->base.id, connector->name); in drm_edid_override_set()
2253 return -EINVAL; in drm_edid_override_set()
2256 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override set\n", in drm_edid_override_set()
2257 connector->base.id, connector->name); in drm_edid_override_set()
2259 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_set()
2261 drm_edid_free(connector->edid_override); in drm_edid_override_set()
2262 connector->edid_override = drm_edid; in drm_edid_override_set()
2264 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_set()
2272 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] EDID override reset\n", in drm_edid_override_reset()
2273 connector->base.id, connector->name); in drm_edid_override_reset()
2275 mutex_lock(&connector->edid_override_mutex); in drm_edid_override_reset()
2277 drm_edid_free(connector->edid_override); in drm_edid_override_reset()
2278 connector->edid_override = NULL; in drm_edid_override_reset()
2280 mutex_unlock(&connector->edid_override_mutex); in drm_edid_override_reset()
2286 * drm_edid_override_connector_update - add modes from override/firmware EDID
2308 drm_dbg_kms(connector->dev, in drm_edid_override_connector_update()
2310 connector->base.id, connector->name, num_modes); in drm_edid_override_connector_update()
2364 alloc_size = override->size; in _drm_do_get_edid()
2365 edid = kmemdup(override->edid, alloc_size, GFP_KERNEL); in _drm_do_get_edid()
2385 connector->edid_corrupt = false; in _drm_do_get_edid()
2387 connector->edid_corrupt = true; in _drm_do_get_edid()
2391 connector->null_edid_counter++; in _drm_do_get_edid()
2421 * the first Data Block is HF-EEODB, override the in _drm_do_get_edid()
2424 * Note: HF-EEODB could specify a smaller extension in _drm_do_get_edid()
2459 * drm_edid_raw - Get a pointer to the raw EDID data.
2470 if (!drm_edid || !drm_edid->size) in drm_edid_raw()
2477 if (WARN_ON(edid_size(drm_edid->edid) > drm_edid->size)) in drm_edid_raw()
2480 return drm_edid->edid; in drm_edid_raw()
2494 drm_edid->edid = edid; in _drm_edid_alloc()
2495 drm_edid->size = size; in _drm_edid_alloc()
2502 * drm_edid_alloc - Allocate a new drm_edid container
2535 * drm_edid_dup - Duplicate a drm_edid container
2547 return drm_edid_alloc(drm_edid->edid, drm_edid->size); in drm_edid_dup()
2552 * drm_edid_free - Free the drm_edid container
2560 kfree(drm_edid->edid); in drm_edid_free()
2566 * drm_probe_ddc() - probe DDC presence
2581 * drm_get_edid - get EDID data, if available
2595 if (connector->force == DRM_FORCE_OFF) in drm_get_edid()
2598 if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter)) in drm_get_edid()
2608 * drm_edid_read_custom - Read EDID data using given EDID block read function
2643 drm_WARN_ON(connector->dev, !size); in drm_edid_read_custom()
2654 * drm_edid_read_ddc - Read EDID data using given I2C adapter
2664 * Prefer initializing connector->ddc with drm_connector_init_with_ddc() and
2676 if (connector->force == DRM_FORCE_OFF) in drm_edid_read_ddc()
2679 if (connector->force == DRM_FORCE_UNSPECIFIED && !drm_probe_ddc(adapter)) in drm_edid_read_ddc()
2691 * drm_edid_read - Read EDID data using connector's I2C adapter
2706 if (drm_WARN_ON(connector->dev, !connector->ddc)) in drm_edid_read()
2709 return drm_edid_read_ddc(connector, connector->ddc); in drm_edid_read()
2714 * drm_edid_get_product_id - Get the vendor and product identification
2721 if (drm_edid && drm_edid->edid && drm_edid->size >= EDID_LENGTH) in drm_edid_get_product_id()
2722 memcpy(id, &drm_edid->edid->product_id, sizeof(*id)); in drm_edid_get_product_id()
2730 int week = id->week_of_manufacture; in decode_date()
2731 int year = id->year_of_manufacture + 1990; in decode_date()
2742 * drm_edid_print_product_id - Print decoded product id to printer
2747 * See VESA E-EDID 1.4 section 3.4.
2755 drm_edid_decode_mfg_id(be16_to_cpu(id->manufacturer_name), vend); in drm_edid_print_product_id()
2760 vend, le16_to_cpu(id->product_code), in drm_edid_print_product_id()
2761 le32_to_cpu(id->serial_number), seq_buf_str(&date)); in drm_edid_print_product_id()
2771 * drm_edid_get_panel_id - Get a panel's ID from EDID
2775 * that the EDID is valid) extracts the ID out of it. The ID is a 32-bit value
2776 * (16 bits of manufacturer ID and 16 bits of per-manufacturer ID) that's
2779 * Return: A 32-bit ID that should be different for each make/model of panel.
2786 const struct edid *edid = drm_edid->edid; in drm_edid_get_panel_id()
2788 if (drm_edid->size < EDID_LENGTH) in drm_edid_get_panel_id()
2792 * We represent the ID as a 32-bit number so it can easily be compared in drm_edid_get_panel_id()
2804 return (u32)edid->mfg_id[0] << 24 | in drm_edid_get_panel_id()
2805 (u32)edid->mfg_id[1] << 16 | in drm_edid_get_panel_id()
2811 * drm_edid_read_base_block - Get a panel's EDID base block
2858 * drm_get_edid_switcheroo - get EDID data for a vga_switcheroo output
2871 struct drm_device *dev = connector->dev; in drm_get_edid_switcheroo()
2872 struct pci_dev *pdev = to_pci_dev(dev->dev); in drm_get_edid_switcheroo()
2875 if (drm_WARN_ON_ONCE(dev, !dev_is_pci(dev->dev))) in drm_get_edid_switcheroo()
2887 * drm_edid_read_switcheroo - get EDID data for a vga_switcheroo output
2900 struct drm_device *dev = connector->dev; in drm_edid_read_switcheroo()
2901 struct pci_dev *pdev = to_pci_dev(dev->dev); in drm_edid_read_switcheroo()
2904 if (drm_WARN_ON_ONCE(dev, !dev_is_pci(dev->dev))) in drm_edid_read_switcheroo()
2916 * drm_edid_duplicate - duplicate an EDID and the extensions
2933 * edid_get_quirks - return quirk flags for a given EDID
2947 if (drm_edid_match(drm_edid, &quirk->ident)) in edid_get_quirks()
2948 return quirk->quirks; in edid_get_quirks()
2954 #define MODE_SIZE(m) ((m)->hdisplay * (m)->vdisplay)
2955 #define MODE_REFRESH_DIFF(c,t) (abs((c) - (t)))
2963 const struct drm_display_info *info = &connector->display_info; in edid_fixup_preferred()
2968 if (list_empty(&connector->probed_modes)) in edid_fixup_preferred()
2971 if (info->quirks & EDID_QUIRK_PREFER_LARGE_60) in edid_fixup_preferred()
2973 if (info->quirks & EDID_QUIRK_PREFER_LARGE_75) in edid_fixup_preferred()
2976 preferred_mode = list_first_entry(&connector->probed_modes, in edid_fixup_preferred()
2979 list_for_each_entry_safe(cur_mode, t, &connector->probed_modes, head) { in edid_fixup_preferred()
2980 cur_mode->type &= ~DRM_MODE_TYPE_PREFERRED; in edid_fixup_preferred()
2999 preferred_mode->type |= DRM_MODE_TYPE_PREFERRED; in edid_fixup_preferred()
3005 return (mode->htotal - mode->hdisplay == 160) && in mode_is_rb()
3006 (mode->hsync_end - mode->hdisplay == 80) && in mode_is_rb()
3007 (mode->hsync_end - mode->hsync_start == 32) && in mode_is_rb()
3008 (mode->vsync_start - mode->vdisplay == 3); in mode_is_rb()
3012 * drm_mode_find_dmt - Create a copy of a mode if present in DMT
3017 * @rb: Mode reduced-blanking-ness
3032 if (hsize != ptr->hdisplay) in drm_mode_find_dmt()
3034 if (vsize != ptr->vdisplay) in drm_mode_find_dmt()
3054 return descriptor->pixel_clock == 0 && in is_display_descriptor()
3055 descriptor->data.other_data.pad1 == 0 && in is_display_descriptor()
3056 descriptor->data.other_data.type == type; in is_display_descriptor()
3063 return descriptor->pixel_clock != 0; in is_detailed_timing_descriptor()
3078 n = (127 - d) / 18; in cea_for_each_detailed_block()
3107 cb(&drm_edid->edid->detailed_timings[i], closure); in drm_for_each_detailed_block()
3136 if (descriptor->data.other_data.data.range.flags == DRM_EDID_CVT_SUPPORT_FLAG && in is_rb()
3137 descriptor->data.other_data.data.range.formula.cvt.flags & DRM_EDID_CVT_FLAGS_REDUCED_BLANKING) in is_rb()
3145 if (drm_edid->edid->revision >= 4) { in drm_monitor_supports_rb()
3165 if (descriptor->data.other_data.data.range.flags == DRM_EDID_SECONDARY_GTF_SUPPORT_FLAG) in find_gtf2()
3179 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.hfreq_start_khz * 2 : 0; in drm_gtf2_hbreak()
3191 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.c : 0; in drm_gtf2_2c()
3203 return descriptor ? le16_to_cpu(descriptor->data.other_data.data.range.formula.gtf2.m) : 0; in drm_gtf2_m()
3215 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.k : 0; in drm_gtf2_k()
3227 return descriptor ? descriptor->data.other_data.data.range.formula.gtf2.j : 0; in drm_gtf2_2j()
3240 switch (descriptor->data.other_data.data.range.flags) { in get_timing_level()
3258 const struct edid *edid = drm_edid->edid; in standard_timing_level()
3260 if (edid->revision >= 4) { in standard_timing_level()
3270 } else if (edid->revision >= 3 && drm_gtf2_hbreak(drm_edid)) { in standard_timing_level()
3272 } else if (edid->revision >= 2) { in standard_timing_level()
3293 if (mode->htotal <= 0) in drm_mode_hsync()
3296 return DIV_ROUND_CLOSEST(mode->clock, mode->htotal); in drm_mode_hsync()
3336 struct drm_device *dev = connector->dev; in drm_mode_std()
3340 unsigned aspect_ratio = (t->vfreq_aspect & EDID_TIMING_ASPECT_MASK) in drm_mode_std()
3342 unsigned vfreq = (t->vfreq_aspect & EDID_TIMING_VFREQ_MASK) in drm_mode_std()
3346 if (bad_std_timing(t->hsize, t->vfreq_aspect)) in drm_mode_std()
3350 hsize = t->hsize * 8 + 248; in drm_mode_std()
3355 if (drm_edid->edid->revision < 3) in drm_mode_std()
3380 list_for_each_entry(m, &connector->probed_modes, head) in drm_mode_std()
3381 if (m->hdisplay == hsize && m->vdisplay == vsize && in drm_mode_std()
3391 mode->hdisplay = 1366; in drm_mode_std()
3392 mode->hsync_start = mode->hsync_start - 1; in drm_mode_std()
3393 mode->hsync_end = mode->hsync_end - 1; in drm_mode_std()
3451 if (!(pt->misc & DRM_EDID_PT_INTERLACED)) in drm_mode_do_interlace_quirk()
3455 if ((mode->hdisplay == cea_interlaced[i].w) && in drm_mode_do_interlace_quirk()
3456 (mode->vdisplay == cea_interlaced[i].h / 2)) { in drm_mode_do_interlace_quirk()
3457 mode->vdisplay *= 2; in drm_mode_do_interlace_quirk()
3458 mode->vsync_start *= 2; in drm_mode_do_interlace_quirk()
3459 mode->vsync_end *= 2; in drm_mode_do_interlace_quirk()
3460 mode->vtotal *= 2; in drm_mode_do_interlace_quirk()
3461 mode->vtotal |= 1; in drm_mode_do_interlace_quirk()
3465 mode->flags |= DRM_MODE_FLAG_INTERLACE; in drm_mode_do_interlace_quirk()
3477 const struct drm_display_info *info = &connector->display_info; in drm_mode_detailed()
3478 struct drm_device *dev = connector->dev; in drm_mode_detailed()
3480 const struct detailed_pixel_timing *pt = &timing->data.pixel_data; in drm_mode_detailed()
3481 unsigned hactive = (pt->hactive_hblank_hi & 0xf0) << 4 | pt->hactive_lo; in drm_mode_detailed()
3482 unsigned vactive = (pt->vactive_vblank_hi & 0xf0) << 4 | pt->vactive_lo; in drm_mode_detailed()
3483 unsigned hblank = (pt->hactive_hblank_hi & 0xf) << 8 | pt->hblank_lo; in drm_mode_detailed()
3484 unsigned vblank = (pt->vactive_vblank_hi & 0xf) << 8 | pt->vblank_lo; in drm_mode_detailed()
3485 unsigned hsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc0) << 2 | pt->hsync_offset_lo; in drm_mode_detailed()
3486 …unsigned hsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x30) << 4 | pt->hsync_pulse… in drm_mode_detailed()
3487 …unsigned vsync_offset = (pt->hsync_vsync_offset_pulse_width_hi & 0xc) << 2 | pt->vsync_offset_puls… in drm_mode_detailed()
3488 …unsigned vsync_pulse_width = (pt->hsync_vsync_offset_pulse_width_hi & 0x3) << 4 | (pt->vsync_offse… in drm_mode_detailed()
3494 if (pt->misc & DRM_EDID_PT_STEREO) { in drm_mode_detailed()
3496 connector->base.id, connector->name); in drm_mode_detailed()
3499 if (!(pt->misc & DRM_EDID_PT_SEPARATE_SYNC)) { in drm_mode_detailed()
3501 connector->base.id, connector->name); in drm_mode_detailed()
3507 connector->base.id, connector->name); in drm_mode_detailed()
3511 if (info->quirks & EDID_QUIRK_FORCE_REDUCED_BLANKING) { in drm_mode_detailed()
3523 if (info->quirks & EDID_QUIRK_135_CLOCK_TOO_HIGH) in drm_mode_detailed()
3524 mode->clock = 1088 * 10; in drm_mode_detailed()
3526 mode->clock = le16_to_cpu(timing->pixel_clock) * 10; in drm_mode_detailed()
3528 mode->hdisplay = hactive; in drm_mode_detailed()
3529 mode->hsync_start = mode->hdisplay + hsync_offset; in drm_mode_detailed()
3530 mode->hsync_end = mode->hsync_start + hsync_pulse_width; in drm_mode_detailed()
3531 mode->htotal = mode->hdisplay + hblank; in drm_mode_detailed()
3533 mode->vdisplay = vactive; in drm_mode_detailed()
3534 mode->vsync_start = mode->vdisplay + vsync_offset; in drm_mode_detailed()
3535 mode->vsync_end = mode->vsync_start + vsync_pulse_width; in drm_mode_detailed()
3536 mode->vtotal = mode->vdisplay + vblank; in drm_mode_detailed()
3539 if (mode->hsync_end > mode->htotal) { in drm_mode_detailed()
3540 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing hsync_end %d->%d\n", in drm_mode_detailed()
3541 connector->base.id, connector->name, in drm_mode_detailed()
3542 mode->hsync_end, mode->htotal); in drm_mode_detailed()
3543 mode->hsync_end = mode->htotal; in drm_mode_detailed()
3545 if (mode->vsync_end > mode->vtotal) { in drm_mode_detailed()
3546 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] reducing vsync_end %d->%d\n", in drm_mode_detailed()
3547 connector->base.id, connector->name, in drm_mode_detailed()
3548 mode->vsync_end, mode->vtotal); in drm_mode_detailed()
3549 mode->vsync_end = mode->vtotal; in drm_mode_detailed()
3554 if (info->quirks & EDID_QUIRK_DETAILED_SYNC_PP) { in drm_mode_detailed()
3555 mode->flags |= DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC; in drm_mode_detailed()
3557 mode->flags |= (pt->misc & DRM_EDID_PT_HSYNC_POSITIVE) ? in drm_mode_detailed()
3559 mode->flags |= (pt->misc & DRM_EDID_PT_VSYNC_POSITIVE) ? in drm_mode_detailed()
3564 mode->width_mm = pt->width_mm_lo | (pt->width_height_mm_hi & 0xf0) << 4; in drm_mode_detailed()
3565 mode->height_mm = pt->height_mm_lo | (pt->width_height_mm_hi & 0xf) << 8; in drm_mode_detailed()
3567 if (info->quirks & EDID_QUIRK_DETAILED_IN_CM) { in drm_mode_detailed()
3568 mode->width_mm *= 10; in drm_mode_detailed()
3569 mode->height_mm *= 10; in drm_mode_detailed()
3572 if (info->quirks & EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE) { in drm_mode_detailed()
3573 mode->width_mm = drm_edid->edid->width_cm * 10; in drm_mode_detailed()
3574 mode->height_mm = drm_edid->edid->height_cm * 10; in drm_mode_detailed()
3577 mode->type = DRM_MODE_TYPE_DRIVER; in drm_mode_detailed()
3590 if (edid->revision >= 4) in mode_in_hsync_range()
3593 if (edid->revision >= 4) in mode_in_hsync_range()
3607 if (edid->revision >= 4) in mode_in_vsync_range()
3610 if (edid->revision >= 4) in mode_in_vsync_range()
3625 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in range_pixel_clock()
3626 return (t[9] * 10000) - ((t[12] >> 2) * 250); in range_pixel_clock()
3636 const struct edid *edid = drm_edid->edid; in mode_in_range()
3648 if (mode->clock > max_clock) in mode_in_range()
3652 if (edid->revision >= 4 && t[10] == DRM_EDID_CVT_SUPPORT_FLAG) in mode_in_range()
3653 if (t[13] && mode->hdisplay > 8 * (t[13] + (256 * (t[12]&0x3)))) in mode_in_range()
3668 list_for_each_entry(m, &connector->probed_modes, head) { in valid_inferred_mode()
3669 if (mode->hdisplay == m->hdisplay && in valid_inferred_mode()
3670 mode->vdisplay == m->vdisplay && in valid_inferred_mode()
3673 if (mode->hdisplay <= m->hdisplay && in valid_inferred_mode()
3674 mode->vdisplay <= m->vdisplay) in valid_inferred_mode()
3686 struct drm_device *dev = connector->dev; in drm_dmt_modes_for_range()
3707 if (mode->hdisplay == 1368 && mode->vdisplay == 768) { in drm_mode_fixup_1366x768()
3708 mode->hdisplay = 1366; in drm_mode_fixup_1366x768()
3709 mode->hsync_start--; in drm_mode_fixup_1366x768()
3710 mode->hsync_end--; in drm_mode_fixup_1366x768()
3721 struct drm_device *dev = connector->dev; in drm_gtf_modes_for_range()
3726 newmode = drm_gtf_mode(dev, m->w, m->h, m->r, 0, 0); in drm_gtf_modes_for_range()
3750 struct drm_device *dev = connector->dev; in drm_gtf2_modes_for_range()
3755 newmode = drm_gtf2_mode(dev, drm_edid, m->w, m->h, m->r); in drm_gtf2_modes_for_range()
3779 struct drm_device *dev = connector->dev; in drm_cvt_modes_for_range()
3785 newmode = drm_cvt_mode(dev, m->w, m->h, m->r, rb, 0, 0); in drm_cvt_modes_for_range()
3807 const struct detailed_non_pixel *data = &timing->data.other_data; in do_inferred_modes()
3808 const struct detailed_data_monitor_range *range = &data->data.range; in do_inferred_modes()
3813 closure->modes += drm_dmt_modes_for_range(closure->connector, in do_inferred_modes()
3814 closure->drm_edid, in do_inferred_modes()
3817 if (closure->drm_edid->edid->revision < 2) in do_inferred_modes()
3820 switch (range->flags) { in do_inferred_modes()
3822 closure->modes += drm_gtf2_modes_for_range(closure->connector, in do_inferred_modes()
3823 closure->drm_edid, in do_inferred_modes()
3827 closure->modes += drm_gtf_modes_for_range(closure->connector, in do_inferred_modes()
3828 closure->drm_edid, in do_inferred_modes()
3832 if (closure->drm_edid->edid->revision < 4) in do_inferred_modes()
3835 closure->modes += drm_cvt_modes_for_range(closure->connector, in do_inferred_modes()
3836 closure->drm_edid, in do_inferred_modes()
3853 if (drm_edid->edid->revision >= 1) in add_inferred_modes()
3867 for (j = 7; j >= 0; j--) { in drm_est3_modes()
3868 m = (i * 8) + (7 - j); in drm_est3_modes()
3872 mode = drm_mode_find_dmt(connector->dev, in drm_est3_modes()
3896 closure->modes += drm_est3_modes(closure->connector, timing); in do_established_modes()
3907 struct drm_device *dev = connector->dev; in add_established_modes()
3908 const struct edid *edid = drm_edid->edid; in add_established_modes()
3909 unsigned long est_bits = edid->established_timings.t1 | in add_established_modes()
3910 (edid->established_timings.t2 << 8) | in add_established_modes()
3911 ((edid->established_timings.mfg_rsvd & 0x80) << 9); in add_established_modes()
3930 if (edid->revision >= 1) in add_established_modes()
3941 const struct detailed_non_pixel *data = &timing->data.other_data; in do_standard_modes()
3942 struct drm_connector *connector = closure->connector; in do_standard_modes()
3949 const struct std_timing *std = &data->data.timings[i]; in do_standard_modes()
3952 newmode = drm_mode_std(connector, closure->drm_edid, std); in do_standard_modes()
3955 closure->modes++; in do_standard_modes()
3978 &drm_edid->edid->standard_timings[i]); in add_standard_modes()
3985 if (drm_edid->edid->revision >= 1) in add_standard_modes()
3999 struct drm_device *dev = connector->dev; in drm_cvt_modes()
4007 cvt = &(timing->data.other_data.data.cvt[i]); in drm_cvt_modes()
4009 if (!memcmp(cvt->code, empty, 3)) in drm_cvt_modes()
4012 height = (cvt->code[0] + ((cvt->code[1] & 0xf0) << 4) + 1) * 2; in drm_cvt_modes()
4013 switch (cvt->code[1] & 0x0c) { in drm_cvt_modes()
4014 /* default - because compiler doesn't see that we've enumerated all cases */ in drm_cvt_modes()
4031 if (cvt->code[2] & (1 << j)) { in drm_cvt_modes()
4054 closure->modes += drm_cvt_modes(closure->connector, timing); in do_cvt_mode()
4065 if (drm_edid->edid->revision >= 3) in add_cvt_modes()
4085 newmode = drm_mode_detailed(closure->connector, in do_detailed_mode()
4086 closure->drm_edid, timing); in do_detailed_mode()
4090 if (closure->preferred) in do_detailed_mode()
4091 newmode->type |= DRM_MODE_TYPE_PREFERRED; in do_detailed_mode()
4098 fixup_detailed_cea_mode_clock(closure->connector, newmode); in do_detailed_mode()
4100 drm_mode_probed_add(closure->connector, newmode); in do_detailed_mode()
4101 closure->modes++; in do_detailed_mode()
4102 closure->preferred = false; in do_detailed_mode()
4106 * add_detailed_modes - Add modes from detailed timings
4118 if (drm_edid->edid->revision >= 4) in add_detailed_modes()
4122 drm_edid->edid->features & DRM_EDID_FEATURE_PREFERRED_TIMING; in add_detailed_modes()
4129 /* CTA-861-H Table 60 - CTA Tag Codes */
4136 /* CTA-861-H Table 62 - CTA Extended Tag Codes */
4205 if (block->tag == DATA_BLOCK_CTA) { in drm_edid_has_cta_extension()
4217 BUILD_BUG_ON(1 + ARRAY_SIZE(edid_cea_modes_1) - 1 != 127); in cea_mode_for_vic()
4218 BUILD_BUG_ON(193 + ARRAY_SIZE(edid_cea_modes_193) - 1 != 219); in cea_mode_for_vic()
4221 return &edid_cea_modes_1[vic - 1]; in cea_mode_for_vic()
4223 return &edid_cea_modes_193[vic - 193]; in cea_mode_for_vic()
4246 unsigned int clock = cea_mode->clock; in cea_mode_alternate_clock()
4256 if (cea_mode->vdisplay == 240 || cea_mode->vdisplay == 480) in cea_mode_alternate_clock()
4276 BUILD_BUG_ON(cea_mode_for_vic(8)->vtotal != 262 || in cea_mode_alternate_timings()
4277 cea_mode_for_vic(9)->vtotal != 262 || in cea_mode_alternate_timings()
4278 cea_mode_for_vic(12)->vtotal != 262 || in cea_mode_alternate_timings()
4279 cea_mode_for_vic(13)->vtotal != 262 || in cea_mode_alternate_timings()
4280 cea_mode_for_vic(23)->vtotal != 312 || in cea_mode_alternate_timings()
4281 cea_mode_for_vic(24)->vtotal != 312 || in cea_mode_alternate_timings()
4282 cea_mode_for_vic(27)->vtotal != 312 || in cea_mode_alternate_timings()
4283 cea_mode_for_vic(28)->vtotal != 312); in cea_mode_alternate_timings()
4286 vic == 12 || vic == 13) && mode->vtotal < 263) || in cea_mode_alternate_timings()
4288 vic == 27 || vic == 28) && mode->vtotal < 314)) { in cea_mode_alternate_timings()
4289 mode->vsync_start++; in cea_mode_alternate_timings()
4290 mode->vsync_end++; in cea_mode_alternate_timings()
4291 mode->vtotal++; in cea_mode_alternate_timings()
4305 if (!to_match->clock) in drm_match_cea_mode_clock_tolerance()
4308 if (to_match->picture_aspect_ratio) in drm_match_cea_mode_clock_tolerance()
4321 if (abs(to_match->clock - clock1) > clock_tolerance && in drm_match_cea_mode_clock_tolerance()
4322 abs(to_match->clock - clock2) > clock_tolerance) in drm_match_cea_mode_clock_tolerance()
4335 * drm_match_cea_mode - look for a CEA mode matching given mode
4338 * Return: The CEA Video ID (VIC) of the mode or 0 if it isn't a CEA-861
4346 if (!to_match->clock) in drm_match_cea_mode()
4349 if (to_match->picture_aspect_ratio) in drm_match_cea_mode()
4362 if (KHZ2PICOS(to_match->clock) != KHZ2PICOS(clock1) && in drm_match_cea_mode()
4363 KHZ2PICOS(to_match->clock) != KHZ2PICOS(clock2)) in drm_match_cea_mode()
4386 return mode->picture_aspect_ratio; in drm_get_cea_aspect_ratio()
4412 if (!to_match->clock) in drm_match_hdmi_mode_clock_tolerance()
4415 if (to_match->picture_aspect_ratio) in drm_match_hdmi_mode_clock_tolerance()
4423 clock1 = hdmi_mode->clock; in drm_match_hdmi_mode_clock_tolerance()
4426 if (abs(to_match->clock - clock1) > clock_tolerance && in drm_match_hdmi_mode_clock_tolerance()
4427 abs(to_match->clock - clock2) > clock_tolerance) in drm_match_hdmi_mode_clock_tolerance()
4438 * drm_match_hdmi_mode - look for a HDMI mode matching given mode
4450 if (!to_match->clock) in drm_match_hdmi_mode()
4453 if (to_match->picture_aspect_ratio) in drm_match_hdmi_mode()
4461 clock1 = hdmi_mode->clock; in drm_match_hdmi_mode()
4464 if ((KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock1) || in drm_match_hdmi_mode()
4465 KHZ2PICOS(to_match->clock) == KHZ2PICOS(clock2)) && in drm_match_hdmi_mode()
4480 struct drm_device *dev = connector->dev; in add_alternate_cea_modes()
4493 list_for_each_entry(mode, &connector->probed_modes, head) { in add_alternate_cea_modes()
4513 clock1 = cea_mode->clock; in add_alternate_cea_modes()
4518 if (mode->clock != clock1 && mode->clock != clock2) in add_alternate_cea_modes()
4526 newmode->flags |= mode->flags & DRM_MODE_FLAG_3D_MASK; in add_alternate_cea_modes()
4529 * The current mode could be either variant. Make in add_alternate_cea_modes()
4532 if (mode->clock != clock1) in add_alternate_cea_modes()
4533 newmode->clock = clock1; in add_alternate_cea_modes()
4535 newmode->clock = clock2; in add_alternate_cea_modes()
4537 list_add_tail(&newmode->head, &list); in add_alternate_cea_modes()
4541 list_del(&mode->head); in add_alternate_cea_modes()
4551 /* 0-6 bit vic, 7th bit native mode indicator */ in svd_to_vic()
4559 * Return a display mode for the 0-based vic_index'th VIC across all CTA VDBs in
4565 const struct drm_display_info *info = &connector->display_info; in drm_display_mode_from_vic_index()
4566 struct drm_device *dev = connector->dev; in drm_display_mode_from_vic_index()
4568 if (!info->vics || vic_index >= info->vics_len || !info->vics[vic_index]) in drm_display_mode_from_vic_index()
4571 return drm_display_mode_from_cea_vic(dev, info->vics[vic_index]); in drm_display_mode_from_vic_index()
4575 * do_y420vdb_modes - Parse YCBCR 420 only modes
4580 * Parse the CEA-861-F YCBCR 420 Video Data Block (Y420VDB)
4587 struct drm_device *dev = connector->dev; in do_y420vdb_modes()
4608 * drm_display_mode_from_cea_vic() - return a mode for CEA VIC
4638 const struct drm_display_info *info = &connector->display_info; in add_cta_vdb_modes()
4641 if (!info->vics) in add_cta_vdb_modes()
4644 for (i = 0; i < info->vics_len; i++) { in add_cta_vdb_modes()
4679 unsigned int interlaced = mode->flags & DRM_MODE_FLAG_INTERLACE; in stereo_match_mandatory()
4681 return mode->hdisplay == stereo_mode->width && in stereo_match_mandatory()
4682 mode->vdisplay == stereo_mode->height && in stereo_match_mandatory()
4683 interlaced == (stereo_mode->flags & DRM_MODE_FLAG_INTERLACE) && in stereo_match_mandatory()
4684 drm_mode_vrefresh(mode) == stereo_mode->vrefresh; in stereo_match_mandatory()
4689 struct drm_device *dev = connector->dev; in add_hdmi_mandatory_stereo_modes()
4696 list_for_each_entry(mode, &connector->probed_modes, head) { in add_hdmi_mandatory_stereo_modes()
4710 new_mode->flags |= mandatory->flags; in add_hdmi_mandatory_stereo_modes()
4711 list_add_tail(&new_mode->head, &stereo_modes); in add_hdmi_mandatory_stereo_modes()
4716 list_splice_tail(&stereo_modes, &connector->probed_modes); in add_hdmi_mandatory_stereo_modes()
4723 struct drm_device *dev = connector->dev; in add_hdmi_mode()
4727 drm_err(connector->dev, "[CONNECTOR:%d:%s] Unknown HDMI VIC: %d\n", in add_hdmi_mode()
4728 connector->base.id, connector->name, vic); in add_hdmi_mode()
4750 newmode->flags |= DRM_MODE_FLAG_3D_FRAME_PACKING; in add_3d_struct_modes()
4758 newmode->flags |= DRM_MODE_FLAG_3D_TOP_AND_BOTTOM; in add_3d_struct_modes()
4766 newmode->flags |= DRM_MODE_FLAG_3D_SIDE_BY_SIDE_HALF; in add_3d_struct_modes()
4796 * do_hdmi_vsdb_modes - Parse the HDMI Vendor Specific data block
4854 if (len < (8 + offset + hdmi_3d_len - 1)) in do_hdmi_vsdb_modes()
4879 for (i = 0; i < (hdmi_3d_len - multi_len); i++) { in do_hdmi_vsdb_modes()
4887 if (detail_present && (i + 1 == hdmi_3d_len - multi_len)) in do_hdmi_vsdb_modes()
4913 newmode->flags |= newflag; in do_hdmi_vsdb_modes()
4959 /* Current Data Block Collection. */
4962 /* Current Data Block index in current collection. */
4965 /* End index in current collection. */
4969 /* CTA-861-H section 7.4 CTA Data BLock Collection */
4977 return db->tag_length >> 5; in cea_db_tag()
4985 return db->tag_length & 0x1f; in cea_db_payload_len()
4990 return db->data; in cea_db_data()
4997 db->data[0] == tag; in cea_db_is_extended_tag()
5014 drm_edid_iter_begin(drm_edid, &iter->edid_iter); in cea_db_iter_edid_begin()
5015 displayid_iter_edid_begin(drm_edid, &iter->displayid_iter); in cea_db_iter_edid_begin()
5023 if (!iter->collection) in __cea_db_iter_current_block()
5026 db = (const struct cea_db *)&iter->collection[iter->index]; in __cea_db_iter_current_block()
5028 if (iter->index + sizeof(*db) <= iter->end && in __cea_db_iter_current_block()
5029 iter->index + sizeof(*db) + cea_db_payload_len(db) <= iter->end) in __cea_db_iter_current_block()
5037 * - CTA-861-H section 7.3.3 CTA Extension Version 3
5046 return d - 4; in cea_db_collection_size()
5051 * - VESA E-EDID v1.4
5052 * - CTA-861-H section 7.3.3 CTA Extension Version 3
5058 drm_edid_iter_for_each(ext, &iter->edid_iter) { in __cea_db_iter_edid_next()
5069 iter->index = 4; in __cea_db_iter_edid_next()
5070 iter->end = iter->index + size; in __cea_db_iter_edid_next()
5080 * - DisplayID v1.3 Appendix C: CEA Data Block within a DisplayID Data Block
5081 * - DisplayID v2.0 section 4.10 CTA DisplayID Data Block
5090 displayid_iter_for_each(block, &iter->displayid_iter) { in __cea_db_iter_displayid_next()
5091 if (block->tag != DATA_BLOCK_CTA) in __cea_db_iter_displayid_next()
5098 iter->index = sizeof(*block); in __cea_db_iter_displayid_next()
5099 iter->end = iter->index + block->num_bytes; in __cea_db_iter_displayid_next()
5111 if (iter->collection) { in __cea_db_iter_next()
5112 /* Current collection should always be valid. */ in __cea_db_iter_next()
5115 iter->collection = NULL; in __cea_db_iter_next()
5120 iter->index += sizeof(*db) + cea_db_payload_len(db); in __cea_db_iter_next()
5136 iter->collection = __cea_db_iter_edid_next(iter); in __cea_db_iter_next()
5137 if (!iter->collection) in __cea_db_iter_next()
5138 iter->collection = __cea_db_iter_displayid_next(iter); in __cea_db_iter_next()
5140 if (!iter->collection) in __cea_db_iter_next()
5154 displayid_iter_end(&iter->displayid_iter); in cea_db_iter_end()
5155 drm_edid_iter_end(&iter->edid_iter); in cea_db_iter_end()
5213 * Get the HF-EEODB override extension block count from EDID.
5223 * - HDMI 2.1 section 10.3.6 HDMI Forum EDID Extension Override Data Block
5229 /* No extensions according to base block, no HF-EEODB. */ in edid_hfeeodb_extension_block_count()
5233 /* HF-EEODB is always in the first EDID extension block only */ in edid_hfeeodb_extension_block_count()
5243 * Sinks that include the HF-EEODB in their E-EDID shall include one and in edid_hfeeodb_extension_block_count()
5244 * only one instance of the HF-EEODB in the E-EDID, occupying bytes 4 in edid_hfeeodb_extension_block_count()
5245 * through 6 of Block 1 of the E-EDID. in edid_hfeeodb_extension_block_count()
5254 * CTA-861 YCbCr 4:2:0 Capability Map Data Block (CTA Y420CMDB)
5264 struct drm_display_info *info = &connector->display_info; in parse_cta_y420cmdb()
5265 int i, map_len = cea_db_payload_len(db) - 1; in parse_cta_y420cmdb()
5295 info->color_formats |= DRM_COLOR_FORMAT_YCBCR420; in parse_cta_y420cmdb()
5320 cea_db_payload_len(db) - 1); in add_cea_modes()
5344 clock1 = cea_mode->clock; in fixup_detailed_cea_mode_clock()
5351 clock1 = cea_mode->clock; in fixup_detailed_cea_mode_clock()
5359 if (abs(mode->clock - clock1) < abs(mode->clock - clock2)) in fixup_detailed_cea_mode_clock()
5364 if (mode->clock == clock) in fixup_detailed_cea_mode_clock()
5367 drm_dbg_kms(connector->dev, in fixup_detailed_cea_mode_clock()
5368 "[CONNECTOR:%d:%s] detailed mode matches %s VIC %d, adjusting clock %d -> %d\n", in fixup_detailed_cea_mode_clock()
5369 connector->base.id, connector->name, in fixup_detailed_cea_mode_clock()
5370 type, vic, mode->clock, clock); in fixup_detailed_cea_mode_clock()
5371 mode->clock = clock; in fixup_detailed_cea_mode_clock()
5376 struct hdr_static_metadata *hdr_metadata = &connector->hdr_sink_metadata.hdmi_type1; in drm_calculate_luminance_range()
5378 &connector->display_info.luminance_range; in drm_calculate_luminance_range()
5385 if (!(hdr_metadata->metadata_type & BIT(HDMI_STATIC_METADATA_TYPE1))) in drm_calculate_luminance_range()
5388 max_avg = hdr_metadata->max_fall; in drm_calculate_luminance_range()
5389 min_cll = hdr_metadata->min_cll; in drm_calculate_luminance_range()
5392 * From the specification (CTA-861-G), for calculating the maximum in drm_calculate_luminance_range()
5395 * Where CV is a one-byte value. in drm_calculate_luminance_range()
5401 * need to pre-compute the value of r/32. For pre-computing the values in drm_calculate_luminance_range()
5415 luminance_range->min_luminance = min; in drm_calculate_luminance_range()
5416 luminance_range->max_luminance = max; in drm_calculate_luminance_range()
5441 connector->hdr_sink_metadata.hdmi_type1.eotf = in drm_parse_hdr_metadata_block()
5443 connector->hdr_sink_metadata.hdmi_type1.metadata_type = in drm_parse_hdr_metadata_block()
5447 connector->hdr_sink_metadata.hdmi_type1.max_cll = db[4]; in drm_parse_hdr_metadata_block()
5449 connector->hdr_sink_metadata.hdmi_type1.max_fall = db[5]; in drm_parse_hdr_metadata_block()
5451 connector->hdr_sink_metadata.hdmi_type1.min_cll = db[6]; in drm_parse_hdr_metadata_block()
5458 /* HDMI Vendor-Specific Data Block (HDMI VSDB, H14b-VSDB) */
5465 connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE] |= DRM_ELD_SUPPORTS_AI; in drm_parse_hdmi_vsdb_audio()
5468 connector->latency_present[0] = true; in drm_parse_hdmi_vsdb_audio()
5469 connector->video_latency[0] = db[9]; in drm_parse_hdmi_vsdb_audio()
5470 connector->audio_latency[0] = db[10]; in drm_parse_hdmi_vsdb_audio()
5474 connector->latency_present[1] = true; in drm_parse_hdmi_vsdb_audio()
5475 connector->video_latency[1] = db[11]; in drm_parse_hdmi_vsdb_audio()
5476 connector->audio_latency[1] = db[12]; in drm_parse_hdmi_vsdb_audio()
5479 drm_dbg_kms(connector->dev, in drm_parse_hdmi_vsdb_audio()
5481 connector->base.id, connector->name, in drm_parse_hdmi_vsdb_audio()
5482 connector->latency_present[0], connector->latency_present[1], in drm_parse_hdmi_vsdb_audio()
5483 connector->video_latency[0], connector->video_latency[1], in drm_parse_hdmi_vsdb_audio()
5484 connector->audio_latency[0], connector->audio_latency[1]); in drm_parse_hdmi_vsdb_audio()
5492 const char *name = closure->ident->name; in match_identity()
5494 const char *desc = timing->data.other_data.data.str.str; in match_identity()
5495 unsigned int desc_len = ARRAY_SIZE(timing->data.other_data.data.str.str); in match_identity()
5513 closure->matched = true; in match_identity()
5517 * drm_edid_match - match drm_edid with given identity
5528 if (!drm_edid || drm_edid_get_panel_id(drm_edid) != ident->panel_id) in drm_edid_match()
5532 if (ident->name) { in drm_edid_match()
5555 *res = timing->data.other_data.data.str.str; in monitor_name()
5578 * drm_edid_get_monitor_name - fetch the monitor name from the edid
5598 name_length = min(get_monitor_name(&drm_edid, buf), bufsize - 1); in drm_edid_get_monitor_name()
5608 memset(connector->eld, 0, sizeof(connector->eld)); in clear_eld()
5610 connector->latency_present[0] = false; in clear_eld()
5611 connector->latency_present[1] = false; in clear_eld()
5612 connector->video_latency[0] = 0; in clear_eld()
5613 connector->audio_latency[0] = 0; in clear_eld()
5614 connector->video_latency[1] = 0; in clear_eld()
5615 connector->audio_latency[1] = 0; in clear_eld()
5619 * Get 3-byte SAD buffer from struct cea_sad.
5623 sad[0] = cta_sad->format << 3 | cta_sad->channels; in drm_edid_cta_sad_get()
5624 sad[1] = cta_sad->freq; in drm_edid_cta_sad_get()
5625 sad[2] = cta_sad->byte2; in drm_edid_cta_sad_get()
5629 * Set struct cea_sad from 3-byte SAD buffer.
5633 cta_sad->format = (sad[0] & 0x78) >> 3; in drm_edid_cta_sad_set()
5634 cta_sad->channels = sad[0] & 0x07; in drm_edid_cta_sad_set()
5635 cta_sad->freq = sad[1] & 0x7f; in drm_edid_cta_sad_set()
5636 cta_sad->byte2 = sad[2]; in drm_edid_cta_sad_set()
5640 * drm_edid_to_eld - build ELD from EDID
5644 * Fill the ELD (EDID-Like Data) buffer for passing to the audio driver. The
5650 const struct drm_display_info *info = &connector->display_info; in drm_edid_to_eld()
5653 uint8_t *eld = connector->eld; in drm_edid_to_eld()
5661 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD monitor %s\n", in drm_edid_to_eld()
5662 connector->base.id, connector->name, in drm_edid_to_eld()
5665 eld[DRM_ELD_CEA_EDID_VER_MNL] = info->cea_rev << DRM_ELD_CEA_EDID_VER_SHIFT; in drm_edid_to_eld()
5670 eld[DRM_ELD_MANUFACTURER_NAME0] = drm_edid->edid->mfg_id[0]; in drm_edid_to_eld()
5671 eld[DRM_ELD_MANUFACTURER_NAME1] = drm_edid->edid->mfg_id[1]; in drm_edid_to_eld()
5672 eld[DRM_ELD_PRODUCT_CODE0] = drm_edid->edid->prod_code[0]; in drm_edid_to_eld()
5673 eld[DRM_ELD_PRODUCT_CODE1] = drm_edid->edid->prod_code[1]; in drm_edid_to_eld()
5684 sad_count = min(len / 3, 15 - total_sad_count); in drm_edid_to_eld()
5696 /* HDMI Vendor-Specific Data Block */ in drm_edid_to_eld()
5708 if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || in drm_edid_to_eld()
5709 connector->connector_type == DRM_MODE_CONNECTOR_eDP) in drm_edid_to_eld()
5717 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] ELD size %d, SAD count %d\n", in drm_edid_to_eld()
5718 connector->base.id, connector->name, in drm_edid_to_eld()
5739 return -ENOMEM; in _drm_edid_to_sad()
5741 drm_edid_cta_sad_set(&sads[i], &db->data[i * 3]); in _drm_edid_to_sad()
5753 * drm_edid_to_sad - extracts SADs from EDID
5782 *sadb = kmemdup(db->data, cea_db_payload_len(db), in _drm_edid_to_speaker_allocation()
5785 return -ENOMEM; in _drm_edid_to_speaker_allocation()
5798 * drm_edid_to_speaker_allocation - extracts Speaker Allocation Data Blocks from EDID
5819 * drm_av_sync_delay - compute the HDMI/DP sink audio-video sync delay
5823 * Return: The HDMI/DP sink's audio-video sync delay in milliseconds or 0 if
5829 int i = !!(mode->flags & DRM_MODE_FLAG_INTERLACE); in drm_av_sync_delay()
5832 if (!connector->latency_present[0]) in drm_av_sync_delay()
5834 if (!connector->latency_present[1]) in drm_av_sync_delay()
5837 a = connector->audio_latency[i]; in drm_av_sync_delay()
5838 v = connector->video_latency[i]; in drm_av_sync_delay()
5851 a = min(2 * (a - 1), 500); in drm_av_sync_delay()
5853 v = min(2 * (v - 1), 500); in drm_av_sync_delay()
5855 return max(v - a, 0); in drm_av_sync_delay()
5882 * drm_detect_hdmi_monitor - detect whether monitor is HDMI
5885 * Parse the CEA extension according to CEA-861-B.
5943 * drm_detect_monitor_audio - check monitor audio capability
5964 * drm_default_rgb_quant_range - default RGB quantization range
5968 * as specified in CEA-861.
5982 /* CTA-861 Video Data Block (CTA VDB) */
5985 struct drm_display_info *info = &connector->display_info; in parse_cta_vdb()
5994 vics = krealloc(info->vics, info->vics_len + len, GFP_KERNEL); in parse_cta_vdb()
5998 vic_index = info->vics_len; in parse_cta_vdb()
5999 info->vics_len += len; in parse_cta_vdb()
6000 info->vics = vics; in parse_cta_vdb()
6008 info->vics[vic_index++] = vic; in parse_cta_vdb()
6020 struct drm_display_info *info = &connector->display_info; in update_cta_y420cmdb()
6021 struct drm_hdmi_info *hdmi = &info->hdmi; in update_cta_y420cmdb()
6022 int i, len = min_t(int, info->vics_len, BITS_PER_TYPE(y420cmdb_map)); in update_cta_y420cmdb()
6025 u8 vic = info->vics[i]; in update_cta_y420cmdb()
6028 bitmap_set(hdmi->y420_cmdb_modes, vic, 1); in update_cta_y420cmdb()
6034 const struct drm_display_info *info = &connector->display_info; in cta_vdb_has_vic()
6037 if (!vic || !info->vics) in cta_vdb_has_vic()
6040 for (i = 0; i < info->vics_len; i++) { in cta_vdb_has_vic()
6041 if (info->vics[i] == vic) in cta_vdb_has_vic()
6048 /* CTA-861-H YCbCr 4:2:0 Video Data Block (CTA Y420VDB) */
6052 struct drm_display_info *info = &connector->display_info; in parse_cta_y420vdb()
6053 struct drm_hdmi_info *hdmi = &info->hdmi; in parse_cta_y420vdb()
6057 for (i = 0; i < cea_db_payload_len(db) - 1; i++) { in parse_cta_y420vdb()
6063 bitmap_set(hdmi->y420_vdb_modes, vic, 1); in parse_cta_y420vdb()
6064 info->color_formats |= DRM_COLOR_FORMAT_YCBCR420; in parse_cta_y420vdb()
6070 struct drm_display_info *info = &connector->display_info; in drm_parse_vcdb()
6072 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] CEA VCDB 0x%02x\n", in drm_parse_vcdb()
6073 connector->base.id, connector->name, db[2]); in drm_parse_vcdb()
6076 info->rgb_quant_range_selectable = true; in drm_parse_vcdb()
6118 struct drm_hdmi_info *hdmi = &connector->display_info.hdmi; in drm_parse_ycbcr420_deep_color_info()
6121 hdmi->y420_dc_modes = dc_mask; in drm_parse_ycbcr420_deep_color_info()
6127 hdmi_dsc->v_1p2 = hf_scds[11] & DRM_EDID_DSC_1P2; in drm_parse_dsc_info()
6129 if (!hdmi_dsc->v_1p2) in drm_parse_dsc_info()
6132 hdmi_dsc->native_420 = hf_scds[11] & DRM_EDID_DSC_NATIVE_420; in drm_parse_dsc_info()
6133 hdmi_dsc->all_bpp = hf_scds[11] & DRM_EDID_DSC_ALL_BPP; in drm_parse_dsc_info()
6136 hdmi_dsc->bpc_supported = 16; in drm_parse_dsc_info()
6138 hdmi_dsc->bpc_supported = 12; in drm_parse_dsc_info()
6140 hdmi_dsc->bpc_supported = 10; in drm_parse_dsc_info()
6143 hdmi_dsc->bpc_supported = 8; in drm_parse_dsc_info()
6150 drm_get_max_frl_rate(dsc_max_frl_rate, &hdmi_dsc->max_lanes, in drm_parse_dsc_info()
6151 &hdmi_dsc->max_frl_rate_per_lane); in drm_parse_dsc_info()
6157 hdmi_dsc->max_slices = 1; in drm_parse_dsc_info()
6158 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6161 hdmi_dsc->max_slices = 2; in drm_parse_dsc_info()
6162 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6165 hdmi_dsc->max_slices = 4; in drm_parse_dsc_info()
6166 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6169 hdmi_dsc->max_slices = 8; in drm_parse_dsc_info()
6170 hdmi_dsc->clk_per_slice = 340; in drm_parse_dsc_info()
6173 hdmi_dsc->max_slices = 8; in drm_parse_dsc_info()
6174 hdmi_dsc->clk_per_slice = 400; in drm_parse_dsc_info()
6177 hdmi_dsc->max_slices = 12; in drm_parse_dsc_info()
6178 hdmi_dsc->clk_per_slice = 400; in drm_parse_dsc_info()
6181 hdmi_dsc->max_slices = 16; in drm_parse_dsc_info()
6182 hdmi_dsc->clk_per_slice = 400; in drm_parse_dsc_info()
6186 hdmi_dsc->max_slices = 0; in drm_parse_dsc_info()
6187 hdmi_dsc->clk_per_slice = 0; in drm_parse_dsc_info()
6192 hdmi_dsc->total_chunk_kbytes = hf_scds[13] & DRM_EDID_DSC_TOTAL_CHUNK_KBYTES; in drm_parse_dsc_info()
6199 struct drm_display_info *info = &connector->display_info; in drm_parse_hdmi_forum_scds()
6200 struct drm_hdmi_info *hdmi = &info->hdmi; in drm_parse_hdmi_forum_scds()
6201 struct drm_hdmi_dsc_cap *hdmi_dsc = &hdmi->dsc_cap; in drm_parse_hdmi_forum_scds()
6206 info->has_hdmi_infoframe = true; in drm_parse_hdmi_forum_scds()
6209 hdmi->scdc.supported = true; in drm_parse_hdmi_forum_scds()
6211 hdmi->scdc.read_request = true; in drm_parse_hdmi_forum_scds()
6217 * * Availability of a HF-VSDB block in EDID (check) in drm_parse_hdmi_forum_scds()
6218 * * Non zero Max_TMDS_Char_Rate filed in HF-VSDB (let's check) in drm_parse_hdmi_forum_scds()
6224 struct drm_scdc *scdc = &hdmi->scdc; in drm_parse_hdmi_forum_scds()
6230 info->max_tmds_clock = max_tmds_clock; in drm_parse_hdmi_forum_scds()
6233 if (scdc->supported) { in drm_parse_hdmi_forum_scds()
6234 scdc->scrambling.supported = true; in drm_parse_hdmi_forum_scds()
6236 /* Few sinks support scrambling for clocks < 340M */ in drm_parse_hdmi_forum_scds()
6238 scdc->scrambling.low_rates = true; in drm_parse_hdmi_forum_scds()
6244 drm_get_max_frl_rate(max_frl_rate, &hdmi->max_lanes, in drm_parse_hdmi_forum_scds()
6245 &hdmi->max_frl_rate_per_lane); in drm_parse_hdmi_forum_scds()
6255 drm_dbg_kms(connector->dev, in drm_parse_hdmi_forum_scds()
6256 … "[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()
6257 connector->base.id, connector->name, in drm_parse_hdmi_forum_scds()
6264 struct drm_display_info *info = &connector->display_info; in drm_parse_hdmi_deep_color_info()
6268 info->bpc = 8; in drm_parse_hdmi_deep_color_info()
6275 info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_30; in drm_parse_hdmi_deep_color_info()
6276 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 30.\n", in drm_parse_hdmi_deep_color_info()
6277 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6282 info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_36; in drm_parse_hdmi_deep_color_info()
6283 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 36.\n", in drm_parse_hdmi_deep_color_info()
6284 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6289 info->edid_hdmi_rgb444_dc_modes |= DRM_EDID_HDMI_DC_48; in drm_parse_hdmi_deep_color_info()
6290 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does deep color 48.\n", in drm_parse_hdmi_deep_color_info()
6291 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6295 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] No deep color support on this HDMI sink.\n", in drm_parse_hdmi_deep_color_info()
6296 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6300 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Assigning HDMI sink color depth as %d bpc.\n", in drm_parse_hdmi_deep_color_info()
6301 connector->base.id, connector->name, dc_bpc); in drm_parse_hdmi_deep_color_info()
6302 info->bpc = dc_bpc; in drm_parse_hdmi_deep_color_info()
6306 info->edid_hdmi_ycbcr444_dc_modes = info->edid_hdmi_rgb444_dc_modes; in drm_parse_hdmi_deep_color_info()
6307 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI sink does YCRCB444 in deep color.\n", in drm_parse_hdmi_deep_color_info()
6308 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6316 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()
6317 connector->base.id, connector->name); in drm_parse_hdmi_deep_color_info()
6321 /* HDMI Vendor-Specific Data Block (HDMI VSDB, H14b-VSDB) */
6325 struct drm_display_info *info = &connector->display_info; in drm_parse_hdmi_vsdb_video()
6328 info->is_hdmi = true; in drm_parse_hdmi_vsdb_video()
6330 info->source_physical_address = (db[4] << 8) | db[5]; in drm_parse_hdmi_vsdb_video()
6333 info->dvi_dual = db[6] & 1; in drm_parse_hdmi_vsdb_video()
6335 info->max_tmds_clock = db[7] * 5000; in drm_parse_hdmi_vsdb_video()
6344 info->has_hdmi_infoframe = true; in drm_parse_hdmi_vsdb_video()
6346 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] HDMI: DVI dual %d, max TMDS clock %d kHz\n", in drm_parse_hdmi_vsdb_video()
6347 connector->base.id, connector->name, in drm_parse_hdmi_vsdb_video()
6348 info->dvi_dual, info->max_tmds_clock); in drm_parse_hdmi_vsdb_video()
6354 * See EDID extension for head-mounted and specialized monitors, specified at:
6355 …* https://docs.microsoft.com/en-us/windows-hardware/drivers/display/specialized-monitors-edid-exte…
6360 struct drm_display_info *info = &connector->display_info; in drm_parse_microsoft_vsdb()
6366 info->non_desktop = true; in drm_parse_microsoft_vsdb()
6368 drm_dbg_kms(connector->dev, in drm_parse_microsoft_vsdb()
6370 connector->base.id, connector->name, version, db[5]); in drm_parse_microsoft_vsdb()
6376 struct drm_display_info *info = &connector->display_info; in drm_parse_cea_ext()
6388 if (!info->cea_rev) in drm_parse_cea_ext()
6389 info->cea_rev = edid_ext[1]; in drm_parse_cea_ext()
6391 if (info->cea_rev != edid_ext[1]) in drm_parse_cea_ext()
6392 drm_dbg_kms(connector->dev, in drm_parse_cea_ext()
6394 connector->base.id, connector->name, in drm_parse_cea_ext()
6395 info->cea_rev, edid_ext[1]); in drm_parse_cea_ext()
6398 info->color_formats = DRM_COLOR_FORMAT_RGB444; in drm_parse_cea_ext()
6400 info->color_formats |= DRM_COLOR_FORMAT_YCBCR444; in drm_parse_cea_ext()
6402 info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; in drm_parse_cea_ext()
6404 info->has_audio = true; in drm_parse_cea_ext()
6432 info->has_audio = true; in drm_parse_cea_ext()
6444 struct drm_display_info *info = &closure->connector->display_info; in get_monitor_range()
6445 struct drm_monitor_range_info *monitor_range = &info->monitor_range; in get_monitor_range()
6446 const struct detailed_non_pixel *data = &timing->data.other_data; in get_monitor_range()
6447 const struct detailed_data_monitor_range *range = &data->data.range; in get_monitor_range()
6448 const struct edid *edid = closure->drm_edid->edid; in get_monitor_range()
6462 if (range->flags != DRM_EDID_RANGE_LIMITS_ONLY_FLAG) in get_monitor_range()
6465 monitor_range->min_vfreq = range->min_vfreq; in get_monitor_range()
6466 monitor_range->max_vfreq = range->max_vfreq; in get_monitor_range()
6468 if (edid->revision >= 4) { in get_monitor_range()
6469 if (data->pad2 & DRM_EDID_RANGE_OFFSET_MIN_VFREQ) in get_monitor_range()
6470 monitor_range->min_vfreq += 255; in get_monitor_range()
6471 if (data->pad2 & DRM_EDID_RANGE_OFFSET_MAX_VFREQ) in get_monitor_range()
6472 monitor_range->max_vfreq += 255; in get_monitor_range()
6479 const struct drm_display_info *info = &connector->display_info; in drm_get_monitor_range()
6485 if (drm_edid->edid->revision < 4) in drm_get_monitor_range()
6488 if (!(drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)) in drm_get_monitor_range()
6493 drm_dbg_kms(connector->dev, in drm_get_monitor_range()
6494 "[CONNECTOR:%d:%s] Supported Monitor Refresh rate range is %d Hz - %d Hz\n", in drm_get_monitor_range()
6495 connector->base.id, connector->name, in drm_get_monitor_range()
6496 info->monitor_range.min_vfreq, info->monitor_range.max_vfreq); in drm_get_monitor_range()
6504 struct drm_display_info *info = &connector->display_info; in drm_parse_vesa_mso_data()
6506 if (block->num_bytes < 3) { in drm_parse_vesa_mso_data()
6507 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6509 connector->base.id, connector->name, block->num_bytes); in drm_parse_vesa_mso_data()
6513 if (oui(vesa->oui[0], vesa->oui[1], vesa->oui[2]) != VESA_IEEE_OUI) in drm_parse_vesa_mso_data()
6516 if (sizeof(*vesa) != sizeof(*block) + block->num_bytes) { in drm_parse_vesa_mso_data()
6517 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6519 connector->base.id, connector->name); in drm_parse_vesa_mso_data()
6523 switch (FIELD_GET(DISPLAYID_VESA_MSO_MODE, vesa->mso)) { in drm_parse_vesa_mso_data()
6525 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Reserved MSO mode value\n", in drm_parse_vesa_mso_data()
6526 connector->base.id, connector->name); in drm_parse_vesa_mso_data()
6529 info->mso_stream_count = 0; in drm_parse_vesa_mso_data()
6532 info->mso_stream_count = 2; /* 2 or 4 links */ in drm_parse_vesa_mso_data()
6535 info->mso_stream_count = 4; /* 4 links */ in drm_parse_vesa_mso_data()
6539 if (!info->mso_stream_count) { in drm_parse_vesa_mso_data()
6540 info->mso_pixel_overlap = 0; in drm_parse_vesa_mso_data()
6544 info->mso_pixel_overlap = FIELD_GET(DISPLAYID_VESA_MSO_OVERLAP, vesa->mso); in drm_parse_vesa_mso_data()
6545 if (info->mso_pixel_overlap > 8) { in drm_parse_vesa_mso_data()
6546 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6548 connector->base.id, connector->name, in drm_parse_vesa_mso_data()
6549 info->mso_pixel_overlap); in drm_parse_vesa_mso_data()
6550 info->mso_pixel_overlap = 8; in drm_parse_vesa_mso_data()
6553 drm_dbg_kms(connector->dev, in drm_parse_vesa_mso_data()
6555 connector->base.id, connector->name, in drm_parse_vesa_mso_data()
6556 info->mso_stream_count, info->mso_pixel_overlap); in drm_parse_vesa_mso_data()
6567 if (block->tag == DATA_BLOCK_2_VENDOR_SPECIFIC) in drm_update_mso()
6578 struct drm_display_info *info = &connector->display_info; in drm_reset_display_info()
6580 info->width_mm = 0; in drm_reset_display_info()
6581 info->height_mm = 0; in drm_reset_display_info()
6583 info->bpc = 0; in drm_reset_display_info()
6584 info->color_formats = 0; in drm_reset_display_info()
6585 info->cea_rev = 0; in drm_reset_display_info()
6586 info->max_tmds_clock = 0; in drm_reset_display_info()
6587 info->dvi_dual = false; in drm_reset_display_info()
6588 info->is_hdmi = false; in drm_reset_display_info()
6589 info->has_audio = false; in drm_reset_display_info()
6590 info->has_hdmi_infoframe = false; in drm_reset_display_info()
6591 info->rgb_quant_range_selectable = false; in drm_reset_display_info()
6592 memset(&info->hdmi, 0, sizeof(info->hdmi)); in drm_reset_display_info()
6594 info->edid_hdmi_rgb444_dc_modes = 0; in drm_reset_display_info()
6595 info->edid_hdmi_ycbcr444_dc_modes = 0; in drm_reset_display_info()
6597 info->non_desktop = 0; in drm_reset_display_info()
6598 memset(&info->monitor_range, 0, sizeof(info->monitor_range)); in drm_reset_display_info()
6599 memset(&info->luminance_range, 0, sizeof(info->luminance_range)); in drm_reset_display_info()
6601 info->mso_stream_count = 0; in drm_reset_display_info()
6602 info->mso_pixel_overlap = 0; in drm_reset_display_info()
6603 info->max_dsc_bpp = 0; in drm_reset_display_info()
6605 kfree(info->vics); in drm_reset_display_info()
6606 info->vics = NULL; in drm_reset_display_info()
6607 info->vics_len = 0; in drm_reset_display_info()
6609 info->quirks = 0; in drm_reset_display_info()
6611 info->source_physical_address = CEC_PHYS_ADDR_INVALID; in drm_reset_display_info()
6617 struct drm_display_info *info = &connector->display_info; in update_displayid_info()
6623 drm_dbg_kms(connector->dev, in update_displayid_info()
6625 connector->base.id, connector->name, in update_displayid_info()
6631 info->non_desktop = true; in update_displayid_info()
6645 struct drm_display_info *info = &connector->display_info; in update_display_info()
6654 edid = drm_edid->edid; in update_display_info()
6656 info->quirks = edid_get_quirks(drm_edid); in update_display_info()
6658 info->width_mm = edid->width_cm * 10; in update_display_info()
6659 info->height_mm = edid->height_cm * 10; in update_display_info()
6663 if (edid->revision < 3) in update_display_info()
6669 info->color_formats |= DRM_COLOR_FORMAT_RGB444; in update_display_info()
6681 if (info->bpc == 0 && edid->revision == 3 && in update_display_info()
6682 edid->input & DRM_EDID_DIGITAL_DFP_1_X) { in update_display_info()
6683 info->bpc = 8; in update_display_info()
6684 drm_dbg_kms(connector->dev, in update_display_info()
6686 connector->base.id, connector->name, info->bpc); in update_display_info()
6690 if (edid->revision < 4) in update_display_info()
6693 switch (edid->input & DRM_EDID_DIGITAL_DEPTH_MASK) { in update_display_info()
6695 info->bpc = 6; in update_display_info()
6698 info->bpc = 8; in update_display_info()
6701 info->bpc = 10; in update_display_info()
6704 info->bpc = 12; in update_display_info()
6707 info->bpc = 14; in update_display_info()
6710 info->bpc = 16; in update_display_info()
6714 info->bpc = 0; in update_display_info()
6718 drm_dbg_kms(connector->dev, in update_display_info()
6719 "[CONNECTOR:%d:%s] Assigning EDID-1.4 digital sink color depth as %d bpc.\n", in update_display_info()
6720 connector->base.id, connector->name, info->bpc); in update_display_info()
6722 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB444) in update_display_info()
6723 info->color_formats |= DRM_COLOR_FORMAT_YCBCR444; in update_display_info()
6724 if (edid->features & DRM_EDID_FEATURE_RGB_YCRCB422) in update_display_info()
6725 info->color_formats |= DRM_COLOR_FORMAT_YCBCR422; in update_display_info()
6730 if (info->quirks & EDID_QUIRK_NON_DESKTOP) { in update_display_info()
6731 drm_dbg_kms(connector->dev, "[CONNECTOR:%d:%s] Non-desktop display%s\n", in update_display_info()
6732 connector->base.id, connector->name, in update_display_info()
6733 info->non_desktop ? " (redundant quirk)" : ""); in update_display_info()
6734 info->non_desktop = true; in update_display_info()
6737 if (info->quirks & EDID_QUIRK_CAP_DSC_15BPP) in update_display_info()
6738 info->max_dsc_bpp = 15; in update_display_info()
6740 if (info->quirks & EDID_QUIRK_FORCE_6BPC) in update_display_info()
6741 info->bpc = 6; in update_display_info()
6743 if (info->quirks & EDID_QUIRK_FORCE_8BPC) in update_display_info()
6744 info->bpc = 8; in update_display_info()
6746 if (info->quirks & EDID_QUIRK_FORCE_10BPC) in update_display_info()
6747 info->bpc = 10; in update_display_info()
6749 if (info->quirks & EDID_QUIRK_FORCE_12BPC) in update_display_info()
6750 info->bpc = 12; in update_display_info()
6752 /* Depends on info->cea_rev set by drm_parse_cea_ext() above */ in update_display_info()
6761 unsigned pixel_clock = (timings->pixel_clock[0] | in drm_mode_displayid_detailed()
6762 (timings->pixel_clock[1] << 8) | in drm_mode_displayid_detailed()
6763 (timings->pixel_clock[2] << 16)) + 1; in drm_mode_displayid_detailed()
6764 unsigned hactive = (timings->hactive[0] | timings->hactive[1] << 8) + 1; in drm_mode_displayid_detailed()
6765 unsigned hblank = (timings->hblank[0] | timings->hblank[1] << 8) + 1; in drm_mode_displayid_detailed()
6766 unsigned hsync = (timings->hsync[0] | (timings->hsync[1] & 0x7f) << 8) + 1; in drm_mode_displayid_detailed()
6767 unsigned hsync_width = (timings->hsw[0] | timings->hsw[1] << 8) + 1; in drm_mode_displayid_detailed()
6768 unsigned vactive = (timings->vactive[0] | timings->vactive[1] << 8) + 1; in drm_mode_displayid_detailed()
6769 unsigned vblank = (timings->vblank[0] | timings->vblank[1] << 8) + 1; in drm_mode_displayid_detailed()
6770 unsigned vsync = (timings->vsync[0] | (timings->vsync[1] & 0x7f) << 8) + 1; in drm_mode_displayid_detailed()
6771 unsigned vsync_width = (timings->vsw[0] | timings->vsw[1] << 8) + 1; in drm_mode_displayid_detailed()
6772 bool hsync_positive = (timings->hsync[1] >> 7) & 0x1; in drm_mode_displayid_detailed()
6773 bool vsync_positive = (timings->vsync[1] >> 7) & 0x1; in drm_mode_displayid_detailed()
6780 mode->clock = type_7 ? pixel_clock : pixel_clock * 10; in drm_mode_displayid_detailed()
6781 mode->hdisplay = hactive; in drm_mode_displayid_detailed()
6782 mode->hsync_start = mode->hdisplay + hsync; in drm_mode_displayid_detailed()
6783 mode->hsync_end = mode->hsync_start + hsync_width; in drm_mode_displayid_detailed()
6784 mode->htotal = mode->hdisplay + hblank; in drm_mode_displayid_detailed()
6786 mode->vdisplay = vactive; in drm_mode_displayid_detailed()
6787 mode->vsync_start = mode->vdisplay + vsync; in drm_mode_displayid_detailed()
6788 mode->vsync_end = mode->vsync_start + vsync_width; in drm_mode_displayid_detailed()
6789 mode->vtotal = mode->vdisplay + vblank; in drm_mode_displayid_detailed()
6791 mode->flags = 0; in drm_mode_displayid_detailed()
6792 mode->flags |= hsync_positive ? DRM_MODE_FLAG_PHSYNC : DRM_MODE_FLAG_NHSYNC; in drm_mode_displayid_detailed()
6793 mode->flags |= vsync_positive ? DRM_MODE_FLAG_PVSYNC : DRM_MODE_FLAG_NVSYNC; in drm_mode_displayid_detailed()
6794 mode->type = DRM_MODE_TYPE_DRIVER; in drm_mode_displayid_detailed()
6796 if (timings->flags & 0x80) in drm_mode_displayid_detailed()
6797 mode->type |= DRM_MODE_TYPE_PREFERRED; in drm_mode_displayid_detailed()
6811 bool type_7 = block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING; in add_displayid_detailed_1_modes()
6813 if (block->num_bytes % 20) in add_displayid_detailed_1_modes()
6816 num_timings = block->num_bytes / 20; in add_displayid_detailed_1_modes()
6818 struct displayid_detailed_timings_1 *timings = &det->timings[i]; in add_displayid_detailed_1_modes()
6820 newmode = drm_mode_displayid_detailed(connector->dev, timings, type_7); in add_displayid_detailed_1_modes()
6839 if (block->tag == DATA_BLOCK_TYPE_1_DETAILED_TIMING || in add_displayid_detailed_modes()
6840 block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING) in add_displayid_detailed_modes()
6851 const struct drm_display_info *info = &connector->display_info; in _drm_edid_connector_add_modes()
6859 * - preferred detailed mode in _drm_edid_connector_add_modes()
6860 * - other detailed modes from base block in _drm_edid_connector_add_modes()
6861 * - detailed modes from extension blocks in _drm_edid_connector_add_modes()
6862 * - CVT 3-byte code modes in _drm_edid_connector_add_modes()
6863 * - standard timing codes in _drm_edid_connector_add_modes()
6864 * - established timing codes in _drm_edid_connector_add_modes()
6865 * - modes inferred from GTF or CVT range information in _drm_edid_connector_add_modes()
6878 if (drm_edid->edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) in _drm_edid_connector_add_modes()
6881 if (info->quirks & (EDID_QUIRK_PREFER_LARGE_60 | EDID_QUIRK_PREFER_LARGE_75)) in _drm_edid_connector_add_modes()
6893 struct drm_device *dev = connector->dev; in _drm_edid_connector_property_update()
6896 if (connector->edid_blob_ptr) { in _drm_edid_connector_property_update()
6897 const void *old_edid = connector->edid_blob_ptr->data; in _drm_edid_connector_property_update()
6898 size_t old_edid_size = connector->edid_blob_ptr->length; in _drm_edid_connector_property_update()
6901 connector->epoch_counter++; in _drm_edid_connector_property_update()
6903 connector->base.id, connector->name, in _drm_edid_connector_property_update()
6904 connector->epoch_counter); in _drm_edid_connector_property_update()
6909 &connector->edid_blob_ptr, in _drm_edid_connector_property_update()
6910 drm_edid ? drm_edid->size : 0, in _drm_edid_connector_property_update()
6911 drm_edid ? drm_edid->edid : NULL, in _drm_edid_connector_property_update()
6912 &connector->base, in _drm_edid_connector_property_update()
6913 dev->mode_config.edid_property); in _drm_edid_connector_property_update()
6916 connector->base.id, connector->name, ret); in _drm_edid_connector_property_update()
6920 ret = drm_object_property_set_value(&connector->base, in _drm_edid_connector_property_update()
6921 dev->mode_config.non_desktop_property, in _drm_edid_connector_property_update()
6922 connector->display_info.non_desktop); in _drm_edid_connector_property_update()
6924 drm_dbg_kms(dev, "[CONNECTOR:%d:%s] Non-desktop property update failed (%d)\n", in _drm_edid_connector_property_update()
6925 connector->base.id, connector->name, ret); in _drm_edid_connector_property_update()
6932 connector->base.id, connector->name, ret); in _drm_edid_connector_property_update()
6948 mutex_lock(&connector->dev->mode_config.mutex); in drm_edid_connector_property_show()
6950 if (!connector->edid_blob_ptr) in drm_edid_connector_property_show()
6953 edid = connector->edid_blob_ptr->data; in drm_edid_connector_property_show()
6954 size = connector->edid_blob_ptr->length; in drm_edid_connector_property_show()
6962 count = size - off; in drm_edid_connector_property_show()
6968 mutex_unlock(&connector->dev->mode_config.mutex); in drm_edid_connector_property_show()
6974 * drm_edid_connector_update - Update connector information from EDID
6999 * drm_edid_connector_add_modes - Update probed modes from the EDID property
7015 if (connector->edid_blob_ptr) in drm_edid_connector_add_modes()
7016 drm_edid = drm_edid_alloc(connector->edid_blob_ptr->data, in drm_edid_connector_add_modes()
7017 connector->edid_blob_ptr->length); in drm_edid_connector_add_modes()
7028 * drm_connector_update_edid_property - update the edid property of a connector
7053 * drm_add_edid_modes - add modes from EDID data, if available
7071 drm_warn(connector->dev, "[CONNECTOR:%d:%s] EDID invalid.\n", in drm_add_edid_modes()
7072 connector->base.id, connector->name); in drm_add_edid_modes()
7085 * drm_add_modes_noedid - add modes for the connectors without EDID
7100 struct drm_device *dev = connector->dev; in drm_add_modes_noedid()
7117 if (ptr->hdisplay > hdisplay || in drm_add_modes_noedid()
7118 ptr->vdisplay > vdisplay) in drm_add_modes_noedid()
7136 * FIXME: sil-sii8620 doesn't have a connector around when in is_hdmi2_sink()
7142 return connector->display_info.hdmi.scdc.supported || in is_hdmi2_sink()
7143 connector->display_info.color_formats & DRM_COLOR_FORMAT_YCBCR420; in is_hdmi2_sink()
7150 connector->display_info.has_hdmi_infoframe : false; in drm_mode_hdmi_vic()
7156 if (mode->flags & DRM_MODE_FLAG_3D_MASK) in drm_mode_hdmi_vic()
7178 * Avoid sending VICs defined in HDMI 2.0 in AVI infoframes to sinks that
7181 * HDMI 1.4 (CTA-861-D) VIC range: [1..64]
7182 * HDMI 2.0 (CTA-861-F) VIC range: [1..107]
7197 * drm_hdmi_avi_infoframe_from_display_mode() - fill an HDMI AVI infoframe with
7214 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7218 if (mode->flags & DRM_MODE_FLAG_DBLCLK) in drm_hdmi_avi_infoframe_from_display_mode()
7219 frame->pixel_repeat = 1; in drm_hdmi_avi_infoframe_from_display_mode()
7224 frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE; in drm_hdmi_avi_infoframe_from_display_mode()
7231 frame->content_type = HDMI_CONTENT_TYPE_GRAPHICS; in drm_hdmi_avi_infoframe_from_display_mode()
7232 frame->itc = 0; in drm_hdmi_avi_infoframe_from_display_mode()
7238 picture_aspect = mode->picture_aspect_ratio; in drm_hdmi_avi_infoframe_from_display_mode()
7254 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7257 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7259 return -EINVAL; in drm_hdmi_avi_infoframe_from_display_mode()
7265 frame->video_code = vic_for_avi_infoframe(connector, vic); in drm_hdmi_avi_infoframe_from_display_mode()
7266 frame->picture_aspect = picture_aspect; in drm_hdmi_avi_infoframe_from_display_mode()
7267 frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE; in drm_hdmi_avi_infoframe_from_display_mode()
7268 frame->scan_mode = HDMI_SCAN_MODE_UNDERSCAN; in drm_hdmi_avi_infoframe_from_display_mode()
7275 * drm_hdmi_avi_infoframe_quant_range() - fill the HDMI AVI infoframe
7288 const struct drm_display_info *info = &connector->display_info; in drm_hdmi_avi_infoframe_quant_range()
7291 * CEA-861: in drm_hdmi_avi_infoframe_quant_range()
7292 * "A Source shall not send a non-zero Q value that does not correspond in drm_hdmi_avi_infoframe_quant_range()
7297 * HDMI 2.0 recommends sending non-zero Q when it does match the in drm_hdmi_avi_infoframe_quant_range()
7300 if (info->rgb_quant_range_selectable || in drm_hdmi_avi_infoframe_quant_range()
7302 frame->quantization_range = rgb_quant_range; in drm_hdmi_avi_infoframe_quant_range()
7304 frame->quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT; in drm_hdmi_avi_infoframe_quant_range()
7307 * CEA-861-F: in drm_hdmi_avi_infoframe_quant_range()
7309 * YQ-field to match the RGB Quantization Range being transmitted in drm_hdmi_avi_infoframe_quant_range()
7311 * set YQ=1) and the Sink shall ignore the YQ-field." in drm_hdmi_avi_infoframe_quant_range()
7313 * Unfortunate certain sinks (eg. VIZ Model 67/E261VA) get confused in drm_hdmi_avi_infoframe_quant_range()
7314 * by non-zero YQ when receiving RGB. There doesn't seem to be any in drm_hdmi_avi_infoframe_quant_range()
7315 * good way to tell which version of CEA-861 the sink supports, so in drm_hdmi_avi_infoframe_quant_range()
7316 * we limit non-zero YQ to HDMI 2.0 sinks only as HDMI 2.0 is based in drm_hdmi_avi_infoframe_quant_range()
7317 * on CEA-861-F. in drm_hdmi_avi_infoframe_quant_range()
7321 frame->ycc_quantization_range = in drm_hdmi_avi_infoframe_quant_range()
7324 frame->ycc_quantization_range = in drm_hdmi_avi_infoframe_quant_range()
7332 u32 layout = mode->flags & DRM_MODE_FLAG_3D_MASK; in s3d_structure_from_display_mode()
7357 * drm_hdmi_vendor_infoframe_from_display_mode() - fill an HDMI infoframe with
7365 * function will return -EINVAL, error that can be safely ignored.
7375 * FIXME: sil-sii8620 doesn't have a connector around when in drm_hdmi_vendor_infoframe_from_display_mode()
7379 connector->display_info.has_hdmi_infoframe : false; in drm_hdmi_vendor_infoframe_from_display_mode()
7383 return -EINVAL; in drm_hdmi_vendor_infoframe_from_display_mode()
7386 return -EINVAL; in drm_hdmi_vendor_infoframe_from_display_mode()
7396 * suggestion in HDMI 2.0 Appendix F. Apparently some sinks in drm_hdmi_vendor_infoframe_from_display_mode()
7401 frame->vic = drm_mode_hdmi_vic(connector, mode); in drm_hdmi_vendor_infoframe_from_display_mode()
7402 frame->s3d_struct = s3d_structure_from_display_mode(mode); in drm_hdmi_vendor_infoframe_from_display_mode()
7417 w = tile->tile_size[0] | tile->tile_size[1] << 8; in drm_parse_tiled_block()
7418 h = tile->tile_size[2] | tile->tile_size[3] << 8; in drm_parse_tiled_block()
7420 num_v_tile = (tile->topo[0] & 0xf) | (tile->topo[2] & 0x30); in drm_parse_tiled_block()
7421 num_h_tile = (tile->topo[0] >> 4) | ((tile->topo[2] >> 2) & 0x30); in drm_parse_tiled_block()
7422 tile_v_loc = (tile->topo[1] & 0xf) | ((tile->topo[2] & 0x3) << 4); in drm_parse_tiled_block()
7423 tile_h_loc = (tile->topo[1] >> 4) | (((tile->topo[2] >> 2) & 0x3) << 4); in drm_parse_tiled_block()
7425 connector->has_tile = true; in drm_parse_tiled_block()
7426 if (tile->tile_cap & 0x80) in drm_parse_tiled_block()
7427 connector->tile_is_single_monitor = true; in drm_parse_tiled_block()
7429 connector->num_h_tile = num_h_tile + 1; in drm_parse_tiled_block()
7430 connector->num_v_tile = num_v_tile + 1; in drm_parse_tiled_block()
7431 connector->tile_h_loc = tile_h_loc; in drm_parse_tiled_block()
7432 connector->tile_v_loc = tile_v_loc; in drm_parse_tiled_block()
7433 connector->tile_h_size = w + 1; in drm_parse_tiled_block()
7434 connector->tile_v_size = h + 1; in drm_parse_tiled_block()
7436 drm_dbg_kms(connector->dev, in drm_parse_tiled_block()
7437 "[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()
7438 connector->base.id, connector->name, in drm_parse_tiled_block()
7439 tile->tile_cap, in drm_parse_tiled_block()
7440 connector->tile_h_size, connector->tile_v_size, in drm_parse_tiled_block()
7441 connector->num_h_tile, connector->num_v_tile, in drm_parse_tiled_block()
7442 connector->tile_h_loc, connector->tile_v_loc, in drm_parse_tiled_block()
7443 tile->topology_id[0], tile->topology_id[1], tile->topology_id[2]); in drm_parse_tiled_block()
7445 tg = drm_mode_get_tile_group(connector->dev, tile->topology_id); in drm_parse_tiled_block()
7447 tg = drm_mode_create_tile_group(connector->dev, tile->topology_id); in drm_parse_tiled_block()
7451 if (connector->tile_group != tg) { in drm_parse_tiled_block()
7454 if (connector->tile_group) in drm_parse_tiled_block()
7455 drm_mode_put_tile_group(connector->dev, connector->tile_group); in drm_parse_tiled_block()
7456 connector->tile_group = tg; in drm_parse_tiled_block()
7459 drm_mode_put_tile_group(connector->dev, tg); in drm_parse_tiled_block()
7467 block->tag == DATA_BLOCK_TILED_DISPLAY) || in displayid_is_tiled_block()
7469 block->tag == DATA_BLOCK_2_TILED_DISPLAY_TOPOLOGY); in displayid_is_tiled_block()
7478 connector->has_tile = false; in _drm_update_tile_info()
7487 if (!connector->has_tile && connector->tile_group) { in _drm_update_tile_info()
7488 drm_mode_put_tile_group(connector->dev, connector->tile_group); in _drm_update_tile_info()
7489 connector->tile_group = NULL; in _drm_update_tile_info()
7494 * drm_edid_is_digital - is digital?
7501 return drm_edid && drm_edid->edid && in drm_edid_is_digital()
7502 drm_edid->edid->input & DRM_EDID_INPUT_DIGITAL; in drm_edid_is_digital()