Lines Matching +full:display +full:- +full:timings

11  *      Copyright (C) 1991-2002 SciTech Software, Inc. All rights reserved.
14 * Copyright 1998 by Egbert Eich <Egbert.Eich@Physik.TU-Darmstadt.DE>
62 /* DEC FR-PCXAV-YZ */
93 while (i-- && (*--s == 0x20)) *s = 0; in copy_string()
178 /* Only if display is GTF capable will in check_edid()
224 printk("fbmon: trying to fix monitor timings\n"); in fix_edid()
240 b[9] = 17; /* pixclock - 170 MHz*/ in fix_edid()
248 for (i = 0; i < EDID_LENGTH - 1; i++) in fix_edid()
251 edid[127] = 256 - csum; in fix_edid()
294 specs->manufacturer[0] = ((block[0] & 0x7c) >> 2) + '@'; in parse_vendor_block()
295 specs->manufacturer[1] = ((block[0] & 0x03) << 3) + in parse_vendor_block()
297 specs->manufacturer[2] = (block[1] & 0x1f) + '@'; in parse_vendor_block()
298 specs->manufacturer[3] = 0; 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()
302 specs->year = block[9] + 1990; in parse_vendor_block()
303 specs->week = block[8]; in parse_vendor_block()
304 DPRINTK(" Manufacturer: %s\n", specs->manufacturer); in parse_vendor_block()
305 DPRINTK(" Model: %x\n", specs->model); in parse_vendor_block()
306 DPRINTK(" Serial#: %u\n", specs->serial); in parse_vendor_block()
307 DPRINTK(" Year: %u Week %u\n", specs->year, specs->week); in parse_vendor_block()
313 specs->dpms = 0; in get_dpms_capabilities()
315 specs->dpms |= FB_DPMS_ACTIVE_OFF; in get_dpms_capabilities()
317 specs->dpms |= FB_DPMS_SUSPEND; in get_dpms_capabilities()
319 specs->dpms |= FB_DPMS_STANDBY; in get_dpms_capabilities()
335 specs->chroma.redx = tmp/1024; in get_chroma()
336 DPRINTK(" RedX: 0.%03d ", specs->chroma.redx); in get_chroma()
341 specs->chroma.redy = tmp/1024; in get_chroma()
342 DPRINTK("RedY: 0.%03d\n", specs->chroma.redy); in get_chroma()
347 specs->chroma.greenx = tmp/1024; in get_chroma()
348 DPRINTK(" GreenX: 0.%03d ", specs->chroma.greenx); in get_chroma()
353 specs->chroma.greeny = tmp/1024; in get_chroma()
354 DPRINTK("GreenY: 0.%03d\n", specs->chroma.greeny); in get_chroma()
359 specs->chroma.bluex = tmp/1024; in get_chroma()
360 DPRINTK(" BlueX: 0.%03d ", specs->chroma.bluex); in get_chroma()
365 specs->chroma.bluey = tmp/1024; in get_chroma()
366 DPRINTK("BlueY: 0.%03d\n", specs->chroma.bluey); in get_chroma()
371 specs->chroma.whitex = tmp/1024; in get_chroma()
372 DPRINTK(" WhiteX: 0.%03d ", specs->chroma.whitex); in get_chroma()
377 specs->chroma.whitey = tmp/1024; in get_chroma()
378 DPRINTK("WhiteY: 0.%03d\n", specs->chroma.whitey); in get_chroma()
389 var->xres = xres; in calc_mode_timings()
390 var->yres = yres; in calc_mode_timings()
393 mode->xres = xres; in calc_mode_timings()
394 mode->yres = yres; in calc_mode_timings()
395 mode->pixclock = var->pixclock; in calc_mode_timings()
396 mode->refresh = refresh; in calc_mode_timings()
397 mode->left_margin = var->left_margin; in calc_mode_timings()
398 mode->right_margin = var->right_margin; in calc_mode_timings()
399 mode->upper_margin = var->upper_margin; in calc_mode_timings()
400 mode->lower_margin = var->lower_margin; in calc_mode_timings()
401 mode->hsync_len = var->hsync_len; in calc_mode_timings()
402 mode->vsync_len = var->vsync_len; in calc_mode_timings()
403 mode->vmode = 0; in calc_mode_timings()
404 mode->sync = 0; in calc_mode_timings()
508 mode->flag |= FB_MODE_IS_STANDARD; in get_std_timing()
544 if (specs && specs->dclkmax in get_std_timing()
545 && PICOS2KHZ(mode->pixclock) * 1000 > specs->dclkmax) { in get_std_timing()
567 mode->xres = H_ACTIVE; in get_detailed_timing()
568 mode->yres = V_ACTIVE; in get_detailed_timing()
569 mode->pixclock = PIXEL_CLOCK; in get_detailed_timing()
570 mode->pixclock /= 1000; in get_detailed_timing()
571 mode->pixclock = KHZ2PICOS(mode->pixclock); in get_detailed_timing()
572 mode->right_margin = H_SYNC_OFFSET; in get_detailed_timing()
573 mode->left_margin = (H_ACTIVE + H_BLANKING) - in get_detailed_timing()
575 mode->upper_margin = V_BLANKING - V_SYNC_OFFSET - in get_detailed_timing()
577 mode->lower_margin = V_SYNC_OFFSET; in get_detailed_timing()
578 mode->hsync_len = H_SYNC_WIDTH; in get_detailed_timing()
579 mode->vsync_len = V_SYNC_WIDTH; in get_detailed_timing()
581 mode->sync |= FB_SYNC_HOR_HIGH_ACT; in get_detailed_timing()
583 mode->sync |= FB_SYNC_VERT_HIGH_ACT; in get_detailed_timing()
584 mode->refresh = PIXEL_CLOCK/((H_ACTIVE + H_BLANKING) * in get_detailed_timing()
587 mode->yres *= 2; in get_detailed_timing()
588 mode->upper_margin *= 2; in get_detailed_timing()
589 mode->lower_margin *= 2; in get_detailed_timing()
590 mode->vsync_len *= 2; in get_detailed_timing()
591 mode->vmode |= FB_VMODE_INTERLACED; in get_detailed_timing()
593 mode->flag = FB_MODE_IS_DETAILED; in get_detailed_timing()
600 DPRINTK("%sHSync %sVSync\n\n", (HSYNC_POSITIVE) ? "+" : "-", in get_detailed_timing()
601 (VSYNC_POSITIVE) ? "+" : "-"); in get_detailed_timing()
605 * fb_create_modedb - create video mode database
639 DPRINTK(" Detailed Timings\n"); in fb_create_modedb()
656 DPRINTK(" Standard Timings\n"); in fb_create_modedb()
684 * fb_destroy_modedb - destroys mode database
706 specs->hfmin = H_MIN_RATE * 1000; in fb_get_monitor_limits()
707 specs->hfmax = H_MAX_RATE * 1000; in fb_get_monitor_limits()
708 specs->vfmin = V_MIN_RATE; in fb_get_monitor_limits()
709 specs->vfmax = V_MAX_RATE; in fb_get_monitor_limits()
710 specs->dclkmax = MAX_PIXEL_CLOCK * 1000000; in fb_get_monitor_limits()
711 specs->gtf = (GTF_SUPPORT) ? 1 : 0; in fb_get_monitor_limits()
734 htotal = mode->xres + mode->right_margin + mode->hsync_len in fb_get_monitor_limits()
735 + mode->left_margin; in fb_get_monitor_limits()
736 vtotal = mode->yres + mode->lower_margin + mode->vsync_len in fb_get_monitor_limits()
737 + mode->upper_margin; in fb_get_monitor_limits()
739 if (mode->vmode & FB_VMODE_INTERLACED) in fb_get_monitor_limits()
742 if (mode->vmode & FB_VMODE_DOUBLE) in fb_get_monitor_limits()
749 if (specs->dclkmax == 0 || specs->dclkmax < pixclock) in fb_get_monitor_limits()
750 specs->dclkmax = pixclock; in fb_get_monitor_limits()
752 if (specs->dclkmin == 0 || specs->dclkmin > pixclock) in fb_get_monitor_limits()
753 specs->dclkmin = pixclock; in fb_get_monitor_limits()
755 if (specs->hfmax == 0 || specs->hfmax < hscan) in fb_get_monitor_limits()
756 specs->hfmax = hscan; in fb_get_monitor_limits()
758 if (specs->hfmin == 0 || specs->hfmin > hscan) in fb_get_monitor_limits()
759 specs->hfmin = hscan; in fb_get_monitor_limits()
761 if (specs->vfmax == 0 || specs->vfmax < hz) in fb_get_monitor_limits()
762 specs->vfmax = hz; in fb_get_monitor_limits()
764 if (specs->vfmin == 0 || specs->vfmin > hz) in fb_get_monitor_limits()
765 specs->vfmin = hz; in fb_get_monitor_limits()
770 DPRINTK(" H: %d-%dKHz V: %d-%dHz DCLK: %dMHz\n", in fb_get_monitor_limits()
771 specs->hfmin/1000, specs->hfmax/1000, specs->vfmin, in fb_get_monitor_limits()
772 specs->vfmax, specs->dclkmax/1000000); in fb_get_monitor_limits()
785 specs->input = 0; in get_monspecs()
787 specs->input |= FB_DISP_DDI; in get_monspecs()
788 DPRINTK(" Digital Display Input"); in get_monspecs()
790 DPRINTK(" Analog Display Input: Input Voltage - "); in get_monspecs()
794 specs->input |= FB_DISP_ANA_700_300; in get_monspecs()
798 specs->input |= FB_DISP_ANA_714_286; in get_monspecs()
802 specs->input |= FB_DISP_ANA_1000_400; in get_monspecs()
806 specs->input |= FB_DISP_ANA_700_000; in get_monspecs()
815 specs->signal = 0; in get_monspecs()
818 specs->signal |= FB_SIGNAL_BLANK_BLANK; in get_monspecs()
822 specs->signal |= FB_SIGNAL_SEPARATE; in get_monspecs()
826 specs->signal |= FB_SIGNAL_COMPOSITE; in get_monspecs()
830 specs->signal |= FB_SIGNAL_SYNC_ON_GREEN; in get_monspecs()
834 specs->signal |= FB_SIGNAL_SERRATION_ON; in get_monspecs()
837 specs->max_x = block[1]; in get_monspecs()
838 specs->max_y = block[2]; in get_monspecs()
839 DPRINTK(" Max H-size in cm: "); in get_monspecs()
840 if (specs->max_x) in get_monspecs()
841 DPRINTK("%d\n", specs->max_x); in get_monspecs()
844 DPRINTK(" Max V-size in cm: "); in get_monspecs()
845 if (specs->max_y) in get_monspecs()
846 DPRINTK("%d\n", specs->max_y); in get_monspecs()
851 specs->gamma = c+100; in get_monspecs()
853 DPRINTK("%d.%d\n", specs->gamma/100, specs->gamma % 100); in get_monspecs()
860 specs->input |= FB_DISP_MONO; in get_monspecs()
863 DPRINTK(" RGB Color Display\n"); in get_monspecs()
864 specs->input |= FB_DISP_RGB; in get_monspecs()
867 DPRINTK(" Non-RGB Multicolor Display\n"); in get_monspecs()
868 specs->input |= FB_DISP_MULTI; in get_monspecs()
872 specs->input |= FB_DISP_UNKNOWN; in get_monspecs()
878 specs->misc = 0; in get_monspecs()
882 specs->misc |= FB_MISC_PRIM_COLOR; in get_monspecs()
886 specs->misc |= FB_MISC_1ST_DETAIL; in get_monspecs()
889 printk(" Display is GTF capable\n"); in get_monspecs()
890 specs->gtf = 1; in get_monspecs()
912 var->xres = var->xres_virtual = H_ACTIVE; in fb_parse_edid()
913 var->yres = var->yres_virtual = V_ACTIVE; in fb_parse_edid()
914 var->height = var->width = 0; in fb_parse_edid()
915 var->right_margin = H_SYNC_OFFSET; in fb_parse_edid()
916 var->left_margin = (H_ACTIVE + H_BLANKING) - in fb_parse_edid()
918 var->upper_margin = V_BLANKING - V_SYNC_OFFSET - in fb_parse_edid()
920 var->lower_margin = V_SYNC_OFFSET; in fb_parse_edid()
921 var->hsync_len = H_SYNC_WIDTH; in fb_parse_edid()
922 var->vsync_len = V_SYNC_WIDTH; in fb_parse_edid()
923 var->pixclock = PIXEL_CLOCK; in fb_parse_edid()
924 var->pixclock /= 1000; in fb_parse_edid()
925 var->pixclock = KHZ2PICOS(var->pixclock); in fb_parse_edid()
928 var->sync |= FB_SYNC_HOR_HIGH_ACT; in fb_parse_edid()
930 var->sync |= FB_SYNC_VERT_HIGH_ACT; in fb_parse_edid()
953 specs->version = edid[EDID_STRUCT_VERSION]; in fb_edid_to_monspecs()
954 specs->revision = edid[EDID_STRUCT_REVISION]; in fb_edid_to_monspecs()
957 DPRINTK("Display Information (EDID)\n"); in fb_edid_to_monspecs()
959 DPRINTK(" EDID Version %d.%d\n", (int) specs->version, in fb_edid_to_monspecs()
960 (int) specs->revision); in fb_edid_to_monspecs()
967 copy_string(block, specs->serial_no); in fb_edid_to_monspecs()
968 DPRINTK(" Serial Number: %s\n", specs->serial_no); in fb_edid_to_monspecs()
970 copy_string(block, specs->ascii); in fb_edid_to_monspecs()
971 DPRINTK(" ASCII Block: %s\n", specs->ascii); in fb_edid_to_monspecs()
973 copy_string(block, specs->monitor); in fb_edid_to_monspecs()
974 DPRINTK(" Monitor Name: %s\n", specs->monitor); in fb_edid_to_monspecs()
978 DPRINTK(" Display Characteristics:\n"); in fb_edid_to_monspecs()
981 specs->modedb = fb_create_modedb(edid, &specs->modedb_len, specs); in fb_edid_to_monspecs()
982 if (!specs->modedb) in fb_edid_to_monspecs()
990 for (i = 0; i < specs->modedb_len; i++) { in fb_edid_to_monspecs()
991 if (specs->modedb[i].flag & FB_MODE_IS_DETAILED) { in fb_edid_to_monspecs()
998 specs->misc &= ~FB_MISC_1ST_DETAIL; in fb_edid_to_monspecs()
1029 * fb_get_vblank - get vertical blank time
1040 * left_margin = --------------- - vsync_len
1053 * fb_get_hblank_by_hfreq - get horizontal blank time given hfreq
1060 * hblank = ------------------
1061 * 100 - duty_cycle
1063 * duty cycle = percent of htotal assigned to inactive display
1064 * duty cycle = C - (M/Hfreq)
1066 * where: C = ((offset - scale factor) * blank_scale)
1067 * -------------------------------------- + scale factor
1076 c_val = (((H_OFFSET - H_SCALEFACTOR) * H_BLANKSCALE)/256 + in fb_get_hblank_by_hfreq()
1080 duty_cycle = c_val - m_val; in fb_get_hblank_by_hfreq()
1081 hblank = (xres * duty_cycle)/(100000 - duty_cycle); in fb_get_hblank_by_hfreq()
1086 * fb_get_hblank_by_dclk - get horizontal blank time given pixelclock
1093 * hblank = ------------------
1094 * 100 - duty_cycle
1096 * duty cycle = percent of htotal assigned to inactive display
1097 * duty cycle = C - (M * h_period)
1099 * where: h_period = SQRT(100 - C + (0.4 * xres * M)/dclk) + C - 100
1100 * -----------------------------------------------
1110 h_period = 100 - C_VAL; in fb_get_hblank_by_dclk()
1116 h_period -= (100 - C_VAL) * 100; in fb_get_hblank_by_dclk()
1120 duty_cycle = C_VAL * 1000 - (M_VAL * h_period)/100; in fb_get_hblank_by_dclk()
1121 hblank = (xres * duty_cycle)/(100000 - duty_cycle) + 8; in fb_get_hblank_by_dclk()
1127 * fb_get_hfreq - estimate hsync
1134 * hfreq = -------------------------------------
1135 * (1000000 - (vfreq * FLYBACK)
1143 divisor = (1000000 - (vfreq * FLYBACK))/1000; in fb_get_hfreq()
1148 static void fb_timings_vfreq(struct __fb_timings *timings) in fb_timings_vfreq() argument
1150 timings->hfreq = fb_get_hfreq(timings->vfreq, timings->vactive); in fb_timings_vfreq()
1151 timings->vblank = fb_get_vblank(timings->hfreq); in fb_timings_vfreq()
1152 timings->vtotal = timings->vactive + timings->vblank; in fb_timings_vfreq()
1153 timings->hblank = fb_get_hblank_by_hfreq(timings->hfreq, in fb_timings_vfreq()
1154 timings->hactive); in fb_timings_vfreq()
1155 timings->htotal = timings->hactive + timings->hblank; in fb_timings_vfreq()
1156 timings->dclk = timings->htotal * timings->hfreq; in fb_timings_vfreq()
1159 static void fb_timings_hfreq(struct __fb_timings *timings) in fb_timings_hfreq() argument
1161 timings->vblank = fb_get_vblank(timings->hfreq); in fb_timings_hfreq()
1162 timings->vtotal = timings->vactive + timings->vblank; in fb_timings_hfreq()
1163 timings->vfreq = timings->hfreq/timings->vtotal; in fb_timings_hfreq()
1164 timings->hblank = fb_get_hblank_by_hfreq(timings->hfreq, in fb_timings_hfreq()
1165 timings->hactive); in fb_timings_hfreq()
1166 timings->htotal = timings->hactive + timings->hblank; in fb_timings_hfreq()
1167 timings->dclk = timings->htotal * timings->hfreq; in fb_timings_hfreq()
1170 static void fb_timings_dclk(struct __fb_timings *timings) in fb_timings_dclk() argument
1172 timings->hblank = fb_get_hblank_by_dclk(timings->dclk, in fb_timings_dclk()
1173 timings->hactive); in fb_timings_dclk()
1174 timings->htotal = timings->hactive + timings->hblank; in fb_timings_dclk()
1175 timings->hfreq = timings->dclk/timings->htotal; in fb_timings_dclk()
1176 timings->vblank = fb_get_vblank(timings->hfreq); in fb_timings_dclk()
1177 timings->vtotal = timings->vactive + timings->vblank; in fb_timings_dclk()
1178 timings->vfreq = timings->hfreq/timings->vtotal; in fb_timings_dclk()
1182 * fb_get_mode - calculates video mode using VESA GTF
1183 * @flags: if: 0 - maximize vertical refresh rate
1184 * 1 - vrefresh-driven calculation;
1185 * 2 - hscan-driven calculation;
1186 * 3 - pixelclock-driven calculation;
1197 * refresh rate. Otherwise, it will calculate timings based on
1201 * ignored and @var will be filled with the calculated timings.
1207 * The timings generated by the GTF will be different from VESA
1213 * A valid info->monspecs, otherwise 'safe numbers' will be used.
1217 struct __fb_timings *timings; in fb_get_mode() local
1222 timings = kzalloc(sizeof(struct __fb_timings), GFP_KERNEL); in fb_get_mode()
1224 if (!timings) in fb_get_mode()
1225 return -ENOMEM; in fb_get_mode()
1231 if (!info || !info->monspecs.hfmax || !info->monspecs.vfmax || in fb_get_mode()
1232 !info->monspecs.dclkmax || in fb_get_mode()
1233 info->monspecs.hfmax < info->monspecs.hfmin || in fb_get_mode()
1234 info->monspecs.vfmax < info->monspecs.vfmin || in fb_get_mode()
1235 info->monspecs.dclkmax < info->monspecs.dclkmin) { in fb_get_mode()
1240 hfmin = info->monspecs.hfmin; in fb_get_mode()
1241 hfmax = info->monspecs.hfmax; in fb_get_mode()
1242 vfmin = info->monspecs.vfmin; in fb_get_mode()
1243 vfmax = info->monspecs.vfmax; in fb_get_mode()
1244 dclkmin = info->monspecs.dclkmin; in fb_get_mode()
1245 dclkmax = info->monspecs.dclkmax; in fb_get_mode()
1248 timings->hactive = var->xres; in fb_get_mode()
1249 timings->vactive = var->yres; in fb_get_mode()
1250 if (var->vmode & FB_VMODE_INTERLACED) { in fb_get_mode()
1251 timings->vactive /= 2; in fb_get_mode()
1254 if (var->vmode & FB_VMODE_DOUBLE) { in fb_get_mode()
1255 timings->vactive *= 2; in fb_get_mode()
1261 timings->hfreq = hfmax; in fb_get_mode()
1262 fb_timings_hfreq(timings); in fb_get_mode()
1263 if (timings->vfreq > vfmax) { in fb_get_mode()
1264 timings->vfreq = vfmax; in fb_get_mode()
1265 fb_timings_vfreq(timings); in fb_get_mode()
1267 if (timings->dclk > dclkmax) { in fb_get_mode()
1268 timings->dclk = dclkmax; in fb_get_mode()
1269 fb_timings_dclk(timings); in fb_get_mode()
1273 timings->vfreq = val; in fb_get_mode()
1274 fb_timings_vfreq(timings); in fb_get_mode()
1277 timings->hfreq = val; in fb_get_mode()
1278 fb_timings_hfreq(timings); in fb_get_mode()
1281 timings->dclk = PICOS2KHZ(val) * 1000; in fb_get_mode()
1282 fb_timings_dclk(timings); in fb_get_mode()
1285 err = -EINVAL; in fb_get_mode()
1290 (timings->vfreq < vfmin || timings->vfreq > vfmax || in fb_get_mode()
1291 timings->hfreq < hfmin || timings->hfreq > hfmax || in fb_get_mode()
1292 timings->dclk < dclkmin || timings->dclk > dclkmax))) { in fb_get_mode()
1293 err = -EINVAL; in fb_get_mode()
1295 var->pixclock = KHZ2PICOS(timings->dclk/1000); in fb_get_mode()
1296 var->hsync_len = (timings->htotal * 8)/100; in fb_get_mode()
1297 var->right_margin = (timings->hblank/2) - var->hsync_len; in fb_get_mode()
1298 var->left_margin = timings->hblank - var->right_margin - in fb_get_mode()
1299 var->hsync_len; in fb_get_mode()
1300 var->vsync_len = (3 * interlace)/dscan; in fb_get_mode()
1301 var->lower_margin = (1 * interlace)/dscan; in fb_get_mode()
1302 var->upper_margin = (timings->vblank * interlace)/dscan - in fb_get_mode()
1303 (var->vsync_len + var->lower_margin); in fb_get_mode()
1306 kfree(timings); in fb_get_mode()
1316 fbmode->xres = vm->hactive; in fb_videomode_from_videomode()
1317 fbmode->left_margin = vm->hback_porch; in fb_videomode_from_videomode()
1318 fbmode->right_margin = vm->hfront_porch; in fb_videomode_from_videomode()
1319 fbmode->hsync_len = vm->hsync_len; in fb_videomode_from_videomode()
1321 fbmode->yres = vm->vactive; in fb_videomode_from_videomode()
1322 fbmode->upper_margin = vm->vback_porch; in fb_videomode_from_videomode()
1323 fbmode->lower_margin = vm->vfront_porch; in fb_videomode_from_videomode()
1324 fbmode->vsync_len = vm->vsync_len; in fb_videomode_from_videomode()
1327 fbmode->pixclock = vm->pixelclock ? in fb_videomode_from_videomode()
1328 KHZ2PICOS(vm->pixelclock / 1000) : 0; in fb_videomode_from_videomode()
1330 fbmode->sync = 0; in fb_videomode_from_videomode()
1331 fbmode->vmode = 0; in fb_videomode_from_videomode()
1332 if (vm->flags & DISPLAY_FLAGS_HSYNC_HIGH) in fb_videomode_from_videomode()
1333 fbmode->sync |= FB_SYNC_HOR_HIGH_ACT; in fb_videomode_from_videomode()
1334 if (vm->flags & DISPLAY_FLAGS_VSYNC_HIGH) in fb_videomode_from_videomode()
1335 fbmode->sync |= FB_SYNC_VERT_HIGH_ACT; in fb_videomode_from_videomode()
1336 if (vm->flags & DISPLAY_FLAGS_INTERLACED) in fb_videomode_from_videomode()
1337 fbmode->vmode |= FB_VMODE_INTERLACED; in fb_videomode_from_videomode()
1338 if (vm->flags & DISPLAY_FLAGS_DOUBLESCAN) in fb_videomode_from_videomode()
1339 fbmode->vmode |= FB_VMODE_DOUBLE; in fb_videomode_from_videomode()
1340 fbmode->flag = 0; in fb_videomode_from_videomode()
1342 htotal = vm->hactive + vm->hfront_porch + vm->hback_porch + in fb_videomode_from_videomode()
1343 vm->hsync_len; in fb_videomode_from_videomode()
1344 vtotal = vm->vactive + vm->vfront_porch + vm->vback_porch + in fb_videomode_from_videomode()
1345 vm->vsync_len; in fb_videomode_from_videomode()
1349 fbmode->refresh = vm->pixelclock / total; in fb_videomode_from_videomode()
1352 fbmode->refresh = 0; in fb_videomode_from_videomode()
1353 return -EINVAL; in fb_videomode_from_videomode()
1364 m->xres, m->yres, m->refresh, m->pixclock, m->left_margin, in dump_fb_videomode()
1365 m->right_margin, m->upper_margin, m->lower_margin, in dump_fb_videomode()
1366 m->hsync_len, m->vsync_len, m->sync, m->vmode, m->flag); in dump_fb_videomode()
1370 * of_get_fb_videomode - get a fb_videomode from devicetree
1373 * @index: index into the list of display timings in devicetree
1394 pr_debug("%pOF: got %dx%d display mode\n", in of_get_fb_videomode()
1418 return -EINVAL; in fb_get_mode()
1423 * fb_validate_mode - validates var against monitor capabilities
1429 * info->monspecs.
1432 * A valid info->monspecs.
1443 if (!info->monspecs.hfmax || !info->monspecs.vfmax || in fb_validate_mode()
1444 !info->monspecs.dclkmax || in fb_validate_mode()
1445 info->monspecs.hfmax < info->monspecs.hfmin || in fb_validate_mode()
1446 info->monspecs.vfmax < info->monspecs.vfmin || in fb_validate_mode()
1447 info->monspecs.dclkmax < info->monspecs.dclkmin) { in fb_validate_mode()
1452 hfmin = info->monspecs.hfmin; in fb_validate_mode()
1453 hfmax = info->monspecs.hfmax; in fb_validate_mode()
1454 vfmin = info->monspecs.vfmin; in fb_validate_mode()
1455 vfmax = info->monspecs.vfmax; in fb_validate_mode()
1456 dclkmin = info->monspecs.dclkmin; in fb_validate_mode()
1457 dclkmax = info->monspecs.dclkmax; in fb_validate_mode()
1460 if (!var->pixclock) in fb_validate_mode()
1461 return -EINVAL; in fb_validate_mode()
1462 pixclock = PICOS2KHZ(var->pixclock) * 1000; in fb_validate_mode()
1464 htotal = var->xres + var->right_margin + var->hsync_len + in fb_validate_mode()
1465 var->left_margin; in fb_validate_mode()
1466 vtotal = var->yres + var->lower_margin + var->vsync_len + in fb_validate_mode()
1467 var->upper_margin; in fb_validate_mode()
1469 if (var->vmode & FB_VMODE_INTERLACED) in fb_validate_mode()
1471 if (var->vmode & FB_VMODE_DOUBLE) in fb_validate_mode()
1482 -EINVAL : 0; in fb_validate_mode()
1502 res = &dev->resource[PCI_ROM_RESOURCE]; in fb_firmware_edid()
1504 if (res && res->flags & IORESOURCE_ROM_SHADOW) in fb_firmware_edid()