Lines Matching +full:scaled +full:- +full:sync

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
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
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()
351 /* 8. Find the number of lines in V sync + back porch: in vesagtf_mode_params()
353 * [V SYNC+BP] = ROUND(([MIN VSYNC+BP]/[H PERIOD EST]),0) in vesagtf_mode_params()
358 vsync_plus_bp = DIVIDE(params->min_vsbp * 1000000, h_period_est); in vesagtf_mode_params()
360 print_value(8, "[V SYNC+BP]", vsync_plus_bp); in vesagtf_mode_params()
365 * [V BACK PORCH] = [V SYNC+BP] - [V SYNC RND] in vesagtf_mode_params()
367 * XXX is "[V SYNC RND]" a typo? should be [V SYNC RQD]? in vesagtf_mode_params()
370 v_back_porch = vsync_plus_bp - params->vsync_rqd; in vesagtf_mode_params()
378 * [BOT MARGIN (LINES)] + [V SYNC+BP] + [INTERLACE] + in vesagtf_mode_params()
383 interlace + params->min_porch; in vesagtf_mode_params()
399 * This is all scaled to get the result in uHz. Again, we're trying to 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()
570 /* 17. Find the number of pixels in the horizontal sync period: in vesagtf_mode_params()
572 * [H SYNC (PIXELS)] =(ROUND(([H SYNC%] / 100 * [TOTAL PIXELS] / in vesagtf_mode_params()
577 * [H SYNC (PIXELS)]=(ROUND((H SYNC%] * [TOTAL PIXELS] / 100 / in vesagtf_mode_params()
581 h_sync = DIVIDE(((params->hsync_pct * total_pixels) / 100), CELL_GRAN) * in vesagtf_mode_params()
584 print_value(17, "[H SYNC (PIXELS)]", h_sync); 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()
604 * Adjusting for the fact that the interlace is scaled: 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()