Lines Matching +full:convert +full:- +full:rate

3 /*-
43 * This has required the use of 64-bit integers in a few places, but
89 * Copyright (c) 1994, 1995, 1996 - Video Electronics Standards
110 * This program takes a desired resolution and vertical refresh rate,
120 * surrounding the addressable video); on most non-overscan type
172 * #define C_PRIME (((C - J) * K/256.0) + J)
180 #define C_PRIME256(p) (((p->C - p->J) * p->K) + (p->J * 256))
181 #define M_PRIME256(p) (p->K * p->M)
186 * print_value() - print the result of the named computation; this is
195 printf("%2d: %-27s: %u\n", n, name, val); in print_value()
202 * vert_refresh() - as defined by the GTF Timing Standard, compute the
204 * words: input a desired resolution and desired refresh rate, and
273 /* 3. Find the frame rate required: in vesagtf_mode_params()
275 * [V FIELD RATE RQD] = IF([INT RQD?]="y", [I/P FREQ RQD]*2, in vesagtf_mode_params()
281 print_value(3, "[V FIELD RATE RQD]", v_field_rqd); in vesagtf_mode_params()
296 DIVIDE(v_lines * params->margin_ppt, 1000) : 0; in vesagtf_mode_params()
317 * [H PERIOD EST] = ((1/[V FIELD RATE RQD]) - [MIN VSYNC+BP]/1000000) / in vesagtf_mode_params()
321 * To make it integer friendly, we pre-multiply the 1000000 to get to in vesagtf_mode_params()
324 * [H PERIOD EST] = ((1000000/[V FIELD RATE RQD]) - [MIN VSYNC+BP]) / in vesagtf_mode_params()
335 * [H PERIOD EST] = ((2*((1000000/[V FIELD RATE RQD]) - [MIN VSYNC+BP])) / in vesagtf_mode_params()
344 h_period_est = DIVIDE(((DIVIDE(2000000000000ULL, v_field_rqd)) - in vesagtf_mode_params()
345 (2000000 * params->min_vsbp)), in vesagtf_mode_params()
346 ((2 * (v_lines + (2 * top_margin) + params->min_porch)) + interlace)); in vesagtf_mode_params()
358 vsync_plus_bp = DIVIDE(params->min_vsbp * 1000000, h_period_est); in vesagtf_mode_params()
365 * [V BACK PORCH] = [V SYNC+BP] - [V SYNC RND] in vesagtf_mode_params()
370 v_back_porch = vsync_plus_bp - params->vsync_rqd; in vesagtf_mode_params()
383 interlace + params->min_porch; in vesagtf_mode_params()
390 * [V FIELD RATE EST] = 1 / [H PERIOD EST] / [TOTAL V LINES] * 1000000 in vesagtf_mode_params()
392 * Again, we want to pre multiply by 10^9 to convert for nsec, thereby in vesagtf_mode_params()
397 * [V FIELD RATE EST] = 1000000000 / [H PERIOD EST] / [TOTAL V LINES] in vesagtf_mode_params()
405 print_value(11, "[V FIELD RATE EST(uHz)]", v_field_est); in vesagtf_mode_params()
410 * [H PERIOD] = [H PERIOD EST] / ([V FIELD RATE RQD] / [V FIELD RATE EST]) in vesagtf_mode_params()
420 * [V FIELD RATE] = 1 / [H PERIOD] / [TOTAL V LINES] * 1000000 in vesagtf_mode_params()
422 * And again, we convert to nsec ahead of time, giving us: in vesagtf_mode_params()
424 * [V FIELD RATE] = 1000000 / [H PERIOD] / [TOTAL V LINES] in vesagtf_mode_params()
431 print_value(13, "[V FIELD RATE]", v_field_rate); in vesagtf_mode_params()
436 * [V FRAME RATE] = (IF([INT RQD?]="y", [V FIELD RATE]/2, [V FIELD RATE])) in vesagtf_mode_params()
444 print_value(14, "[V FRAME RATE]", v_frame_rate); in vesagtf_mode_params()
460 DIVIDE(DIVIDE(h_pixels * params->margin_ppt, 1000), in vesagtf_mode_params()
482 * [IDEAL DUTY CYCLE] = [C'] - ([M']*[H PERIOD]/1000) in vesagtf_mode_params()
497 ((C_PRIME256(params) * 1000) - in vesagtf_mode_params()
508 * (100-[IDEAL DUTY CYCLE]) / in vesagtf_mode_params()
516 (256000 * 100ULL) - ideal_duty_cycle), in vesagtf_mode_params()
581 h_sync = DIVIDE(((params->hsync_pct * total_pixels) / 100), CELL_GRAN) * in vesagtf_mode_params()
589 * [H FRONT PORCH (PIXELS)] = ([H BLANK (PIXELS)]/2)-[H SYNC (PIXELS)] in vesagtf_mode_params()
595 h_front_porch = (h_blank / 2) - h_sync; in vesagtf_mode_params()
609 v_odd_front_porch_lines = ((2 * params->min_porch) + interlace) / 2; in vesagtf_mode_params()
616 vmp->hsync_start = h_pixels + h_front_porch; in vesagtf_mode_params()
617 vmp->hsync_end = vmp->hsync_start + h_sync; in vesagtf_mode_params()
618 vmp->htotal = total_pixels; in vesagtf_mode_params()
619 vmp->hdisplay = h_pixels; in vesagtf_mode_params()
621 vmp->vsync_start = v_lines + v_odd_front_porch_lines; in vesagtf_mode_params()
622 vmp->vsync_end = vmp->vsync_start + params->vsync_rqd; in vesagtf_mode_params()
623 vmp->vtotal = total_v_lines; in vesagtf_mode_params()
624 vmp->vdisplay = v_lines; in vesagtf_mode_params()
626 vmp->dot_clock = pixel_freq; in vesagtf_mode_params()
655 /* print_xf86_mode() - print the XFree86 modeline, given mode timings. */
663 hf = 1000.0 * vmp->dot_clock / vmp->htotal; in print_xf86_mode()
664 vf = 1.0 * hf / vmp->vtotal; in print_xf86_mode()
668 vmp->hdisplay, vmp->vdisplay, vf, hf, vmp->dot_clock / 1000.0); in print_xf86_mode()
673 " -HSync +Vsync\n\n", in print_xf86_mode()
674 vmp->hdisplay, vmp->vdisplay, vf, (vmp->dot_clock / 1000.0), in print_xf86_mode()
675 vmp->hdisplay, vmp->hsync_start, vmp->hsync_end, vmp->htotal, in print_xf86_mode()
676 vmp->vdisplay, vmp->vsync_start, vmp->vsync_end, vmp->vtotal); in print_xf86_mode()