Lines Matching +full:period +full:- +full:scale
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
121 * systems, the margin period is zero. I've implemented the margin
172 * #define C_PRIME (((C - J) * K/256.0) + J)
178 * scale results using these back down, appropriately.
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()
315 /* 7. Estimate the Horizontal period 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()
348 print_value(7, "[H PERIOD EST (ps)]", h_period_est); 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()
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()
375 /* 10. Find the total number of lines in Vertical field period: 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()
397 * [V FIELD RATE EST] = 1000000000 / [H PERIOD EST] / [TOTAL V LINES] in vesagtf_mode_params()
408 /* 12. Find the actual horizontal period: in vesagtf_mode_params()
410 * [H PERIOD] = [H PERIOD EST] / ([V FIELD RATE RQD] / [V FIELD RATE EST]) in vesagtf_mode_params()
415 print_value(12, "[H PERIOD(ps)]", h_period); in vesagtf_mode_params()
420 * [V FIELD RATE] = 1 / [H PERIOD] / [TOTAL V LINES] * 1000000 in vesagtf_mode_params()
424 * [V FIELD RATE] = 1000000 / [H PERIOD] / [TOTAL V LINES] 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()
488 * Note that this means that we have to scale it appropriately in 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()
534 * [PIXEL FREQ] = [TOTAL PIXELS] / [H PERIOD] in vesagtf_mode_params()
537 * is usable with integer math. Recall that the [H PERIOD] is in in vesagtf_mode_params()
548 * [H FREQ] = 1000 / [H PERIOD] in vesagtf_mode_params()
553 * errors. Recall that the [H PERIOD] is in usec. in vesagtf_mode_params()
570 /* 17. Find the number of pixels in the horizontal sync period: in vesagtf_mode_params()
581 h_sync = DIVIDE(((params->hsync_pct * total_pixels) / 100), CELL_GRAN) * in vesagtf_mode_params()
587 /* 18. Find the number of pixels in the horizontal front porch period: 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()
600 /* 36. Find the number of lines in the odd front porch period: 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()