Lines Matching refs:block

1587 /*** DDC fetch and block validation ***/
1639 /* EDID block count indicated in EDID, may exceed allocated size */
1663 /* EDID block count, limited by allocated size */
1671 /* EDID extension block count, limited by allocated size */
1707 * EDID base and extension block iterator.
1710 * const u8 *block;
1713 * drm_edid_iter_for_each(block, &iter) {
1714 * // do stuff with block
1721 /* Current block index. */
1735 const void *block = NULL;
1741 block = drm_edid_block_data(iter->drm_edid, iter->index++);
1743 return block;
1764 * drm_edid_header_is_valid - sanity check the header of the base EDID block
1765 * @_edid: pointer to raw base EDID block
1767 * Sanity check the header of the base EDID block.
1792 const u8 *block = _block;
1797 csum += block[i];
1806 const struct edid *block = _block;
1808 return block->checksum;
1813 const u8 *block = _block;
1815 return block[0];
1858 const struct edid *block = _block;
1860 if (!block)
1864 int score = drm_edid_header_is_valid(block);
1867 if (edid_block_is_zero(block))
1877 if (edid_block_compute_checksum(block) != edid_block_get_checksum(block)) {
1878 if (edid_block_is_zero(block))
1885 if (block->version != 1)
1899 static bool edid_block_valid(const void *block, bool base)
1901 return edid_block_status_valid(edid_block_check(block, base),
1902 edid_block_tag(block));
1906 const struct edid *block,
1913 pr_debug("EDID block %d read failed\n", block_num);
1916 pr_debug("EDID block %d pointer is NULL\n", block_num);
1919 pr_notice("EDID block %d is all zeroes\n", block_num);
1931 if (edid_block_status_valid(status, edid_block_tag(block))) {
1932 pr_debug("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d, ignoring\n",
1933 block_num, edid_block_tag(block),
1934 edid_block_compute_checksum(block));
1936 pr_notice("EDID block %d (tag 0x%02x) checksum is invalid, remainder is %d\n",
1937 block_num, edid_block_tag(block),
1938 edid_block_compute_checksum(block));
1943 block->version);
1946 WARN(1, "EDID block %d unknown edid block status code %d\n",
1952 static void edid_block_dump(const char *level, const void *block, int block_num)
1957 status = edid_block_check(block, block_num == 0);
1960 else if (!edid_block_status_valid(status, edid_block_tag(block)))
1966 block, EDID_LENGTH, false);
1970 * drm_edid_block_valid - Sanity check the EDID block (base or extension)
1971 * @_block: pointer to raw EDID block
1972 * @block_num: type of block to validate (0 for base, extension otherwise)
1976 * Validate a base or extension EDID block and optionally dump bad blocks to
1979 * Return: True if the block is valid, false otherwise.
1984 struct edid *block = (struct edid *)_block;
1989 if (WARN_ON(!block))
1992 status = edid_block_check(block, is_base_block);
1995 edid_header_fix(block);
1998 status = edid_block_check(block, is_base_block);
2006 * the base block can reset edid_corrupt to false.
2015 edid_block_status_print(status, block, block_num);
2017 /* Determine whether we can use this block with this status. */
2018 valid = edid_block_status_valid(status, edid_block_tag(block));
2022 edid_block_dump(KERN_NOTICE, block, block_num);
2045 void *block = (void *)edid_block_data(edid, i);
2047 if (!drm_edid_block_valid(block, i, true, NULL))
2059 * Sanity check an EDID. Cross check block count against allocated size and
2075 const void *block = drm_edid_block_data(drm_edid, i);
2077 if (!edid_block_valid(block, i == 0))
2107 /* We already trusted the base block to be valid here... */
2130 * @block: 128 byte EDID block to start fetching from
2138 drm_do_probe_ddc_edid(void *data, u8 *buf, unsigned int block, size_t len)
2141 unsigned char start = block * EDID_LENGTH;
2142 unsigned char segment = block >> 1;
2151 * of the individual block a few times seems to overcome this.
2197 * is 1 (base block) + num_ext_blocks big. That means we can think
2198 * of 0x7e in the EDID of the _index_ of the last block in the
2203 /* Calculate real checksum for the last edid extension block data */
2326 typedef int read_block_fn(void *context, u8 *buf, unsigned int block, size_t len);
2328 static enum edid_block_status edid_block_read(void *block, unsigned int block_num,
2337 if (read_block(context, block, block_num, EDID_LENGTH))
2340 status = edid_block_check(block, is_base_block);
2342 edid_header_fix(block);
2345 status = edid_block_check(block, is_base_block);
2350 if (edid_block_status_valid(status, edid_block_tag(block)))
2353 /* Fail early for unrepairable base block all zeros. */
2417 void *block = (void *)edid_block_data(edid, i);
2419 status = edid_block_read(block, i, read_block, context);
2421 edid_block_status_print(status, block, i);
2423 if (!edid_block_status_valid(status, edid_block_tag(block))) {
2431 * extension block count.
2468 * drm_do_get_edid - get EDID data using a custom EDID block read function
2470 * @read_block: EDID block read function
2471 * @context: private data passed to the block read function
2475 * to get EDID data using a custom block read function.
2545 * of the raw EDID data against the size, but at least the EDID base block must
2645 * drm_edid_read_custom - Read EDID data using given EDID block read function
2647 * @read_block: EDID block read function
2648 * @context: Private data passed to the block read function
2652 * to get EDID data using a custom block read function.
2811 * This function uses the first block of the EDID of a panel and (assuming
2819 * ID. Return 0 if the EDID size is less than a base block.
2848 * drm_edid_read_base_block - Get a panel's EDID base block
2851 * This function returns the drm_edid containing the first block of the EDID of
2857 * block is concerned (in other words, we don't process any overrides here).
2863 * reading the first block, hopefully this extra overhead won't be too big.
2869 * Return: Pointer to allocated EDID base block, or NULL on any failure.
3507 * timing block contains enough info for us to create and return a new struct
3937 * Get established modes from EDID and add them. Each EDID block contains a
4145 * @drm_edid: EDID block to scan
4188 * Search EDID for CEA extension block.
4217 /* Return true if the EDID has a CTA extension or a DisplayID CTA data block */
4220 const struct displayid_block *block;
4226 /* Look for a top level CEA extension block */
4239 /* CEA blocks can also be found embedded in a DisplayID block */
4241 displayid_iter_for_each(block, &iter) {
4242 if (block->tag == DATA_BLOCK_CTA) {
4435 * specific block).
4478 * An HDMI mode is one defined in the HDMI vendor specific block.
4522 /* Don't add CTA modes if the CTA extension block is missing */
4614 * @svds: start of the data block of CEA YCBCR 420 VDB
4833 * do_hdmi_vsdb_modes - Parse the HDMI Vendor Specific data block
4835 * @db: start of the CEA vendor specific block
4836 * @len: length of the CEA block payload, ie. one can access up to db[len]
4971 * the DispID CEA data block. And the only value
5125 const struct displayid_block *block;
5127 displayid_iter_for_each(block, &iter->displayid_iter) {
5128 if (block->tag != DATA_BLOCK_CTA)
5132 * The displayid iterator has already verified the block bounds
5135 iter->index = sizeof(*block);
5136 iter->end = iter->index + block->num_bytes;
5138 return block;
5156 /* Next block in CTA Data Block Collection */
5250 * Get the HF-EEODB override extension block count from EDID.
5253 * blocks (base block and one extension block) if EDID extension count is > 0.
5266 /* No extensions according to base block, no HF-EEODB. */
5270 /* HF-EEODB is always in the first EDID extension block only */
5275 /* Need to have the data block collection, and at least 3 bytes. */
5313 * This map indicates which of the existing CEA block modes
5317 * to avoid going through the same block again and again.
5319 * Spec is not clear about max possible size of this block.
5320 * Clamping max bitmap block size at 8 bytes. Every byte can
5344 /* CTA VDB block VICs parsed earlier */
5794 * Looks for CEA EDID block and extracts SADs (Short Audio Descriptors) from it.
5837 * @sadb: pointer to the speaker block
5839 * Looks for CEA EDID block and extracts the Speaker Allocation Data Block from it.
5981 * @edid: EDID block to scan
5983 * Monitor should have CEA extension block.
5985 * audio' only. If there is any audio extension block and supported
6254 * * Availability of a HF-VSDB block in EDID (check)
6263 /* max clock is 5000 KHz times block value */
6537 const struct displayid_block *block)
6540 (struct displayid_vesa_vendor_specific_block *)block;
6543 if (block->num_bytes < 3) {
6545 "[CONNECTOR:%d:%s] Unexpected vendor block size %u\n",
6546 connector->base.id, connector->name, block->num_bytes);
6553 if (sizeof(*vesa) != sizeof(*block) + block->num_bytes) {
6555 "[CONNECTOR:%d:%s] Unexpected VESA vendor block size\n",
6599 const struct displayid_block *block;
6603 displayid_iter_for_each(block, &iter) {
6604 if (block->tag == DATA_BLOCK_2_VENDOR_SPECIFIC)
6605 drm_parse_vesa_mso_data(connector, block);
6655 const struct displayid_block *block;
6659 displayid_iter_for_each(block, &iter) {
6836 const struct displayid_block *block)
6838 struct displayid_detailed_timing_block *det = (struct displayid_detailed_timing_block *)block;
6843 bool type_7 = block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING;
6845 if (block->num_bytes % 20)
6848 num_timings = block->num_bytes / 20;
6865 const struct displayid_block *block;
6870 displayid_iter_for_each(block, &iter) {
6871 if (block->tag == DATA_BLOCK_TYPE_1_DETAILED_TIMING ||
6872 block->tag == DATA_BLOCK_2_TYPE_7_DETAILED_TIMING)
6873 num_modes += add_displayid_detailed_1_modes(connector, block);
6892 * - other detailed modes from base block
7033 * Since we also parse tile information from EDID's displayID block, we also
7408 const struct displayid_block *block)
7410 const struct displayid_tiled_block *tile = (struct displayid_tiled_block *)block;
7463 const struct displayid_block *block)
7466 block->tag == DATA_BLOCK_TILED_DISPLAY) ||
7468 block->tag == DATA_BLOCK_2_TILED_DISPLAY_TOPOLOGY);
7474 const struct displayid_block *block;
7480 displayid_iter_for_each(block, &iter) {
7481 if (displayid_is_tiled_block(&iter, block))
7482 drm_parse_tiled_block(connector, block);