Lines Matching refs:edid

147 static int check_edid(unsigned char *edid)  in check_edid()  argument
149 unsigned char *block = edid + ID_MANUFACTURER_NAME, manufacturer[4]; in check_edid()
172 if (edid[i] != edid_v1_header[i]) { in check_edid()
179 b = edid + EDID_STRUCT_DISPLAY; in check_edid()
186 b = edid + DETAILED_TIMING_DESCRIPTIONS_START; in check_edid()
209 static void fix_edid(unsigned char *edid, int fix) in fix_edid() argument
217 memcpy(edid, edid_v1_header, 8); in fix_edid()
221 b = edid + EDID_STRUCT_DISPLAY; in fix_edid()
223 edid[127] += 0x80; in fix_edid()
227 b = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fix_edid()
251 csum += edid[i]; in fix_edid()
253 edid[127] = 256 - csum; in fix_edid()
258 static int edid_checksum(unsigned char *edid) in edid_checksum() argument
261 int i, err = 0, fix = check_edid(edid); in edid_checksum()
264 fix_edid(edid, fix); in edid_checksum()
267 csum += edid[i]; in edid_checksum()
268 all_null |= edid[i]; in edid_checksum()
279 static int edid_check_header(unsigned char *edid) in edid_check_header() argument
281 int i, err = 1, fix = check_edid(edid); in edid_check_header()
284 fix_edid(edid, fix); in edid_check_header()
287 if (edid[i] != edid_v1_header[i]) in edid_check_header()
597 static struct fb_videomode *fb_create_modedb(unsigned char *edid, int *dbsize) in fb_create_modedb() argument
607 if (edid == NULL || !edid_checksum(edid) || in fb_create_modedb()
608 !edid_check_header(edid)) { in fb_create_modedb()
616 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_create_modedb()
629 block = edid + ESTABLISHED_TIMING_1; in fb_create_modedb()
633 block = edid + STD_TIMING_DESCRIPTIONS_START; in fb_create_modedb()
637 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_create_modedb()
670 static int fb_get_monitor_limits(unsigned char *edid, struct fb_monspecs *specs) in fb_get_monitor_limits() argument
675 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_get_monitor_limits()
699 modes = fb_create_modedb(edid, &num_modes); in fb_get_monitor_limits()
751 static void get_monspecs(unsigned char *edid, struct fb_monspecs *specs) in get_monspecs() argument
755 block = edid + EDID_STRUCT_DISPLAY; in get_monspecs()
757 fb_get_monitor_limits(edid, specs); in get_monspecs()
869 int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var) in fb_parse_edid() argument
874 if (edid == NULL || var == NULL) in fb_parse_edid()
877 if (!(edid_checksum(edid))) in fb_parse_edid()
880 if (!(edid_check_header(edid))) in fb_parse_edid()
883 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_parse_edid()
912 void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs) in fb_edid_to_monspecs() argument
917 if (edid == NULL) in fb_edid_to_monspecs()
920 if (!(edid_checksum(edid))) in fb_edid_to_monspecs()
923 if (!(edid_check_header(edid))) in fb_edid_to_monspecs()
928 specs->version = edid[EDID_STRUCT_VERSION]; in fb_edid_to_monspecs()
929 specs->revision = edid[EDID_STRUCT_REVISION]; in fb_edid_to_monspecs()
937 parse_vendor_block(edid + ID_MANUFACTURER_NAME, specs); in fb_edid_to_monspecs()
939 block = edid + DETAILED_TIMING_DESCRIPTIONS_START; in fb_edid_to_monspecs()
954 get_monspecs(edid, specs); in fb_edid_to_monspecs()
956 specs->modedb = fb_create_modedb(edid, &specs->modedb_len); in fb_edid_to_monspecs()
981 void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs) in fb_edid_add_monspecs() argument
989 if (!edid) in fb_edid_add_monspecs()
992 if (!edid_checksum(edid)) in fb_edid_add_monspecs()
995 if (edid[0] != 0x2 || in fb_edid_add_monspecs()
996 edid[2] < 4 || edid[2] > 128 - DETAILED_TIMING_DESCRIPTION_SIZE) in fb_edid_add_monspecs()
1001 while (pos < edid[2]) { in fb_edid_add_monspecs()
1002 u8 len = edid[pos] & 0x1f, type = (edid[pos] >> 5) & 7; in fb_edid_add_monspecs()
1006 u8 idx = edid[pos + i] & 0x7f; in fb_edid_add_monspecs()
1009 edid[pos + i] & 0x80 ? "" : "on-n", idx); in fb_edid_add_monspecs()
1014 block = edid + edid[2]; in fb_edid_add_monspecs()
1018 for (i = 0; i < (128 - edid[2]) / DETAILED_TIMING_DESCRIPTION_SIZE; in fb_edid_add_monspecs()
1021 edt[num++] = block - edid; in fb_edid_add_monspecs()
1036 get_detailed_timing(edid + edt[i - specs->modedb_len], &m[i]); in fb_edid_add_monspecs()
1368 int fb_parse_edid(unsigned char *edid, struct fb_var_screeninfo *var) in fb_parse_edid() argument
1372 void fb_edid_to_monspecs(unsigned char *edid, struct fb_monspecs *specs) in fb_edid_to_monspecs() argument
1376 void fb_edid_add_monspecs(unsigned char *edid, struct fb_monspecs *specs) in fb_edid_add_monspecs() argument
1463 unsigned char *edid = NULL; in fb_firmware_edid() local
1472 edid = edid_info.dummy; in fb_firmware_edid()
1474 return edid; in fb_firmware_edid()