Lines Matching refs:block
96 static int edid_is_serial_block(unsigned char *block) in edid_is_serial_block() argument
98 if ((block[0] == 0x00) && (block[1] == 0x00) && in edid_is_serial_block()
99 (block[2] == 0x00) && (block[3] == 0xff) && in edid_is_serial_block()
100 (block[4] == 0x00)) in edid_is_serial_block()
106 static int edid_is_ascii_block(unsigned char *block) in edid_is_ascii_block() argument
108 if ((block[0] == 0x00) && (block[1] == 0x00) && in edid_is_ascii_block()
109 (block[2] == 0x00) && (block[3] == 0xfe) && in edid_is_ascii_block()
110 (block[4] == 0x00)) in edid_is_ascii_block()
116 static int edid_is_limits_block(unsigned char *block) in edid_is_limits_block() argument
118 if ((block[0] == 0x00) && (block[1] == 0x00) && in edid_is_limits_block()
119 (block[2] == 0x00) && (block[3] == 0xfd) && in edid_is_limits_block()
120 (block[4] == 0x00)) in edid_is_limits_block()
126 static int edid_is_monitor_block(unsigned char *block) in edid_is_monitor_block() argument
128 if ((block[0] == 0x00) && (block[1] == 0x00) && in edid_is_monitor_block()
129 (block[2] == 0x00) && (block[3] == 0xfc) && in edid_is_monitor_block()
130 (block[4] == 0x00)) in edid_is_monitor_block()
136 static int edid_is_timing_block(unsigned char *block) in edid_is_timing_block() argument
138 if ((block[0] != 0x00) || (block[1] != 0x00) || in edid_is_timing_block()
139 (block[2] != 0x00) || (block[4] != 0x00)) in edid_is_timing_block()
147 unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4]; in check_edid() local
152 manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; in check_edid()
153 manufacturer[1] = ((block[0] & 0x03) << 3) + in check_edid()
154 ((block[1] & 0xe0) >> 5) + '@'; in check_edid()
155 manufacturer[2] = (block[1] & 0x1f) + '@'; in check_edid()
157 model = block[2] + (block[3] << 8); in check_edid()
292 static void parse_vendor_block(unsigned char *block, struct fb_monspecs *specs) in parse_vendor_block() argument
294 specs->manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; in parse_vendor_block()
295 specs->manufacturer[1] = ((block[0] & 0x03) << 3) + in parse_vendor_block()
296 ((block[1] & 0xe0) >> 5) + '@'; in parse_vendor_block()
297 specs->manufacturer[2] = (block[1] & 0x1f) + '@'; in parse_vendor_block()
299 specs->model = block[2] + (block[3] << 8); in parse_vendor_block()
300 specs->serial = block[4] + (block[5] << 8) + in parse_vendor_block()
301 (block[6] << 16) + (block[7] << 24); in parse_vendor_block()
302 specs->year = block[9] + 1990; in parse_vendor_block()
303 specs->week = block[8]; in parse_vendor_block()
326 static void get_chroma(unsigned char *block, struct fb_monspecs *specs) in get_chroma() argument
332 tmp = ((block[5] & (3 << 6)) >> 6) | (block[0x7] << 2); in get_chroma()
338 tmp = ((block[5] & (3 << 4)) >> 4) | (block[0x8] << 2); in get_chroma()
344 tmp = ((block[5] & (3 << 2)) >> 2) | (block[0x9] << 2); in get_chroma()
350 tmp = (block[5] & 3) | (block[0xa] << 2); in get_chroma()
356 tmp = ((block[6] & (3 << 6)) >> 6) | (block[0xb] << 2); in get_chroma()
362 tmp = ((block[6] & (3 << 4)) >> 4) | (block[0xc] << 2); in get_chroma()
368 tmp = ((block[6] & (3 << 2)) >> 2) | (block[0xd] << 2); in get_chroma()
374 tmp = (block[6] & 3) | (block[0xe] << 2); in get_chroma()
409 static int get_est_timing(unsigned char *block, struct fb_videomode *mode) in get_est_timing() argument
414 c = block[0]; in get_est_timing()
451 c = block[1]; in get_est_timing()
485 c = block[2]; in get_est_timing()
494 static int get_std_timing(unsigned char *block, struct fb_videomode *mode, in get_std_timing() argument
500 u32 std_2byte_code = block[0] << 8 | block[1]; in get_std_timing()
514 xres = (block[0] + 31) * 8; in get_std_timing()
518 ratio = (block[1] & 0xc0) >> 6; in get_std_timing()
537 refresh = (block[1] & 0x3f) + 60; in get_std_timing()
553 static int get_dst_timing(unsigned char *block, struct fb_videomode *mode, in get_dst_timing() argument
558 for (j = 0; j < 6; j++, block += STD_TIMING_DESCRIPTION_SIZE) in get_dst_timing()
559 num += get_std_timing(block, &mode[num], ver, rev, specs); in get_dst_timing()
564 static void get_detailed_timing(unsigned char *block, in get_detailed_timing() argument
620 unsigned char *block; in fb_create_modedb() local
640 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_create_modedb()
641 for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) { in fb_create_modedb()
642 if (!(block[0] == 0x00 && block[1] == 0x00)) { in fb_create_modedb()
643 get_detailed_timing(block, &mode[num]); in fb_create_modedb()
653 block = edid + ESTABLISHED_TIMING_1; in fb_create_modedb()
654 num += get_est_timing(block, &mode[num]); in fb_create_modedb()
657 block = edid + STD_TIMING_DESCRIPTIONS_START; in fb_create_modedb()
658 for (i = 0; i < STD_TIMING; i++, block += STD_TIMING_DESCRIPTION_SIZE) in fb_create_modedb()
659 num += get_std_timing(block, &mode[num], ver, rev, specs); in fb_create_modedb()
661 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_create_modedb()
662 for (i = 0; i < 4; i++, block+= DETAILED_TIMING_DESCRIPTION_SIZE) { in fb_create_modedb()
663 if (block[0] == 0x00 && block[1] == 0x00 && block[3] == 0xfa) in fb_create_modedb()
664 num += get_dst_timing(block + 5, &mode[num], in fb_create_modedb()
698 unsigned char *block; in fb_get_monitor_limits() local
700 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_get_monitor_limits()
704 for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { in fb_get_monitor_limits()
705 if (edid_is_limits_block(block)) { in fb_get_monitor_limits()
778 unsigned char c, *block; in get_monspecs() local
780 block = edid + EDID_STRUCT_DISPLAY; in get_monspecs()
784 c = block[0] & 0x80; in get_monspecs()
791 switch ((block[0] & 0x60) >> 5) { in get_monspecs()
811 c = block[0] & 0x10; in get_monspecs()
814 c = block[0] & 0x0f; in get_monspecs()
837 specs->max_x = block[1]; in get_monspecs()
838 specs->max_y = block[2]; in get_monspecs()
850 c = block[3]; in get_monspecs()
855 get_dpms_capabilities(block[4], specs); in get_monspecs()
857 switch ((block[4] & 0x18) >> 3) { in get_monspecs()
876 get_chroma(block, specs); in get_monspecs()
879 c = block[4] & 0x7; in get_monspecs()
897 unsigned char *block; in fb_parse_edid() local
908 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_parse_edid()
910 for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { in fb_parse_edid()
911 if (edid_is_timing_block(block)) { in fb_parse_edid()
939 unsigned char *block; in fb_edid_to_monspecs() local
964 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_edid_to_monspecs()
965 for (i = 0; i < 4; i++, block += DETAILED_TIMING_DESCRIPTION_SIZE) { in fb_edid_to_monspecs()
966 if (edid_is_serial_block(block)) { in fb_edid_to_monspecs()
967 copy_string(block, specs->serial_no); in fb_edid_to_monspecs()
969 } else if (edid_is_ascii_block(block)) { in fb_edid_to_monspecs()
970 copy_string(block, specs->ascii); in fb_edid_to_monspecs()
972 } else if (edid_is_monitor_block(block)) { in fb_edid_to_monspecs()
973 copy_string(block, specs->monitor); in fb_edid_to_monspecs()