Mercurial > mplayer.hg
annotate libvo/gtf.c @ 33929:ef9b6445fc55
Ensure we do not use 100% CPU when waiting for input with no file-based inputs.
author | reimar |
---|---|
date | Sat, 27 Aug 2011 09:58:54 +0000 |
parents | 32725ca88fed |
children |
rev | line source |
---|---|
7069 | 1 /* |
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
2 * GTF calculations formulas are taken from GTF_V1R1.xls |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
3 * created by ANDY.MORRISH@NSC.COM |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
4 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
5 * copyright (C) 2002 Rudolf Marek <r.marek@assembler.cz> |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
6 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
7 * This file is part of MPlayer. |
7069 | 8 * |
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
9 * MPlayer is free software; you can redistribute it and/or modify |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
10 * it under the terms of the GNU General Public License as published by |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
11 * the Free Software Foundation; either version 2 of the License, or |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
12 * (at your option) any later version. |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
13 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
14 * MPlayer is distributed in the hope that it will be useful, |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
17 * GNU General Public License for more details. |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
18 * |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
19 * You should have received a copy of the GNU General Public License along |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
20 * with MPlayer; if not, write to the Free Software Foundation, Inc., |
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
7069 | 22 */ |
27509
d97a607821f1
Replace casual GPL notices by proper license headers.
diego
parents:
25563
diff
changeset
|
23 |
7069 | 24 //Version 0.4 |
15394
d701716bfbbc
if define HAVE_ROUND do not define round again. patch by Steven M. Schultz <sms@2BSD.COM>
nplourde
parents:
7069
diff
changeset
|
25 #include "config.h" |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
26 #include <stdio.h> |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
27 #include <stdlib.h> |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
28 #include <math.h> |
7069 | 29 #include "gtf.h" |
30 | |
31 #undef GTF_DEBUG | |
32 | |
33 #ifdef GTF_DEBUG | |
34 #define DEBUG_PRINTF(a,b) printf(a,b); | |
35 #else | |
36 #define DEBUG_PRINTF(a,b) | |
37 #endif | |
38 | |
39 static GTF_constants GTF_given_constants = { 3.0,550.0,1,8,1.8,8,40,20,128,600 }; | |
40 | |
41 static void GetRoundedConstants(GTF_constants *c) | |
42 { | |
43 c->Vsync_need = round(GTF_given_constants.Vsync_need); | |
44 c->min_Vsync_BP = GTF_given_constants.min_Vsync_BP; | |
45 c->min_front_porch = round(GTF_given_constants.min_front_porch); | |
46 c->char_cell_granularity = GTF_given_constants.char_cell_granularity; | |
47 c->margin_width = GTF_given_constants.margin_width; | |
48 c->sync_width = GTF_given_constants.sync_width; | |
49 c->c = ((GTF_given_constants.c - GTF_given_constants.j)*(GTF_given_constants.k / 256)) + GTF_given_constants.j; | |
50 c->j = GTF_given_constants.j; | |
51 c->k = GTF_given_constants.k; | |
52 c->m = (GTF_given_constants.k / 256) * GTF_given_constants.m; | |
53 } | |
54 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
55 void GTF_calcTimings(double X,double Y,double freq, int type, |
7069 | 56 int want_margins, int want_interlace,struct VesaCRTCInfoBlock *result ) |
57 { | |
58 GTF_constants c; | |
59 double RR, margin_top, margin_bottom, margin_left, margin_right; | |
60 double estimated_H_period,sync_plus_BP,BP,interlace,V_total_lines_field; | |
61 double estimated_V_field_rate,actual_H_period,actual_V_field_freq; | |
62 double total_active_pixels, ideal_duty_cycle, blanking_time, H_total_pixels; | |
63 double H_freq, pixel_freq,actual_V_frame_freq; | |
64 double H_sync_start, H_sync_end, H_back_porch, H_front_porch, H_sync_width; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
65 double V_back_porch, V_front_porch, V_sync_start, V_sync_end,V_sync_width; |
7069 | 66 double ideal_H_period; |
67 GetRoundedConstants(&c); | |
68 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
69 |
7069 | 70 pixel_freq = RR = freq; |
71 | |
72 /* DETERMINE IF 1/2 LINE INTERLACE IS PRESENT */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
73 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
74 interlace = 0; |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
75 |
7069 | 76 if (want_interlace) { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
77 RR = RR * 2; |
7069 | 78 Y=Y/2; |
79 interlace = 0.5; | |
80 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
81 |
7069 | 82 result->Flags = 0; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
83 |
7069 | 84 if ((Y==300)||(Y==200)||(Y==240)) |
85 { | |
86 Y*=2; | |
87 result->Flags = VESA_CRTC_DOUBLESCAN; /* TODO: check if mode support */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
88 } |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
89 |
7069 | 90 /* DETERMINE NUMBER OF LINES IN V MARGIN */ |
91 /* DETERMINE NUMBER OF PIXELS IN H MARGIN [pixels] */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
92 |
7069 | 93 margin_left = margin_right = 0; |
94 margin_top = margin_bottom = 0; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
95 |
7069 | 96 if (want_margins) { |
97 margin_top = margin_bottom = (c.margin_width / 100) * Y; | |
98 margin_left = round(( X* c.margin_width/100)/c.char_cell_granularity) \ | |
99 * c.char_cell_granularity; | |
100 margin_right = margin_left; | |
101 DEBUG_PRINTF("margin_left_right : %f\n",margin_right) | |
102 DEBUG_PRINTF("margin_top_bottom : %f\n",margin_top) | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
103 } |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
104 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
105 /* FIND TOTAL NUMBER OF ACTIVE PIXELS (IMAGE + MARGIN) [pixels] */ |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
106 |
7069 | 107 total_active_pixels = margin_left + margin_right + X; |
108 DEBUG_PRINTF("total_active_pixels: %f\n",total_active_pixels) | |
109 | |
110 if (type == GTF_PF) | |
111 { | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
112 ideal_H_period = ((c.c-100)+(sqrt(((100-c.c)*(100-c.c) )+(0.4*c.m*(total_active_pixels + margin_left + margin_right) / freq))))/2/c.m*1000; |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
113 |
7069 | 114 DEBUG_PRINTF("ideal_H_period: %f\n",ideal_H_period) |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
115 |
7069 | 116 /* FIND IDEAL BLANKING DUTY CYCLE FROM FORMULA [%] */ |
117 ideal_duty_cycle = c.c - (c.m * ideal_H_period /1000); | |
118 DEBUG_PRINTF("ideal_duty_cycle: %f\n",ideal_duty_cycle) | |
119 | |
120 /* FIND BLANKING TIME (TO NEAREST CHAR CELL) [pixels] */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
121 |
7069 | 122 blanking_time = round(total_active_pixels * ideal_duty_cycle \ |
123 / (100-ideal_duty_cycle) / (2*c.char_cell_granularity)) \ | |
124 * (2*c.char_cell_granularity); | |
125 DEBUG_PRINTF("blanking_time : %f\n",blanking_time ) | |
126 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
127 /* FIND TOTAL NUMBER OF PIXELS IN A LINE [pixels] */ |
7069 | 128 H_total_pixels = total_active_pixels + blanking_time ; |
129 DEBUG_PRINTF("H_total_pixels: %f\n",H_total_pixels) | |
130 H_freq = freq / H_total_pixels * 1000; | |
131 DEBUG_PRINTF("H_freq: %f\n",H_freq) | |
132 actual_H_period = 1000 / H_freq; | |
133 DEBUG_PRINTF("actual_H_period: %f\n",actual_H_period) | |
134 sync_plus_BP = round(H_freq * c.min_Vsync_BP/1000); | |
135 // sync_plus_BP = round( freq / H_total_pixels * c.min_Vsync_BP); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
136 |
7069 | 137 DEBUG_PRINTF("sync_plus_BP: %f\n",sync_plus_BP) |
138 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
139 } else if (type == GTF_VF) |
7069 | 140 { |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
141 |
7069 | 142 /* ESTIMATE HORIZ. PERIOD [us] */ |
143 | |
144 estimated_H_period = (( 1/RR ) - c.min_Vsync_BP/1000000 ) / (Y + (2 * margin_top) + c.min_front_porch + interlace) * 1000000; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
145 |
7069 | 146 DEBUG_PRINTF("estimated_H_period: %f\n",estimated_H_period) |
147 | |
148 /* FIND NUMBER OF LINES IN (SYNC + BACK PORCH) [lines] */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
149 |
7069 | 150 sync_plus_BP = round( c.min_Vsync_BP / estimated_H_period ); |
151 DEBUG_PRINTF("sync_plus_BP: %f\n",sync_plus_BP) | |
152 | |
153 } else if (type == GTF_HF) | |
154 { | |
155 sync_plus_BP = round(freq * c.min_Vsync_BP/1000); | |
156 DEBUG_PRINTF("sync_plus_BP: %f\n",sync_plus_BP) | |
157 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
158 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
159 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
160 |
7069 | 161 /* FIND TOTAL NUMBER OF LINES IN VERTICAL FIELD */ |
162 | |
163 V_total_lines_field = sync_plus_BP+interlace+margin_bottom+margin_top+Y+c.min_front_porch; | |
164 DEBUG_PRINTF("V_total_lines_field : %f\n",V_total_lines_field ) | |
165 | |
166 if (type == GTF_VF) | |
167 { | |
168 /* ESTIMATE VERTICAL FIELD RATE [hz] */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
169 |
7069 | 170 estimated_V_field_rate = 1 / estimated_H_period / V_total_lines_field * 1000000; |
171 DEBUG_PRINTF(" estimated_V_field_rate: %f\n", estimated_V_field_rate) | |
172 /* FIND ACTUAL HORIZONTAL PERIOD [us] */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
173 |
7069 | 174 actual_H_period = estimated_H_period / (RR / estimated_V_field_rate); |
175 DEBUG_PRINTF("actual_H_period: %f\n",actual_H_period) | |
176 /* FIND ACTUAL VERTICAL FIELD FREQUENCY [Hz] */ | |
177 | |
178 actual_V_field_freq = 1 / actual_H_period / V_total_lines_field * 1000000; | |
179 DEBUG_PRINTF("actual_V_field_freq: %f\n",actual_V_field_freq) | |
180 | |
181 /* FIND IDEAL BLANKING DUTY CYCLE FROM FORMULA [%] */ | |
182 ideal_duty_cycle = c.c - (c.m * actual_H_period /1000); | |
183 DEBUG_PRINTF("ideal_duty_cycle: %f\n",ideal_duty_cycle) | |
184 //if (type == GTF_VF) | |
185 //{ | |
186 //moved | |
187 //} | |
188 } else if (type == GTF_HF) | |
189 { | |
190 /* FIND IDEAL BLANKING DUTY CYCLE FROM FORMULA [%] */ | |
191 ideal_duty_cycle = c.c - (c.m / freq); | |
192 DEBUG_PRINTF("ideal_duty_cycle: %f\n",ideal_duty_cycle) | |
193 } | |
194 | |
195 /* FIND BLANKING TIME (TO NEAREST CHAR CELL) [pixels] */ | |
196 | |
197 if (!(type == GTF_PF)) | |
198 { | |
199 blanking_time = round(total_active_pixels * ideal_duty_cycle \ | |
200 / (100-ideal_duty_cycle) / (2*c.char_cell_granularity)) \ | |
201 * (2*c.char_cell_granularity); | |
202 DEBUG_PRINTF("blanking_time : %f\n",blanking_time ) | |
203 } | |
204 else | |
205 // if (type == GTF_PF) | |
206 { | |
207 actual_V_field_freq = H_freq / V_total_lines_field * 1000; | |
208 } | |
209 | |
210 if (type == GTF_HF) | |
211 { | |
212 /* Hz */ | |
213 actual_V_field_freq = freq / V_total_lines_field * 1000; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
214 DEBUG_PRINTF("actual_V_field_freq: %f\n",actual_V_field_freq) |
7069 | 215 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
216 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
217 |
7069 | 218 actual_V_frame_freq = actual_V_field_freq; |
219 | |
220 /* FIND ACTUAL VERTICAL FRAME FREQUENCY [Hz]*/ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
221 |
7069 | 222 if (want_interlace) actual_V_frame_freq = actual_V_field_freq / 2; |
223 DEBUG_PRINTF("actual_V_frame_freq: %f\n",actual_V_frame_freq) | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
224 |
7069 | 225 // V_freq = actual_V_frame_freq; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
226 // DEBUG_PRINTF("V_freq %f\n",V_freq) |
7069 | 227 |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
228 |
7069 | 229 if (!(type == GTF_PF)) |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
230 { |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
231 /* FIND TOTAL NUMBER OF PIXELS IN A LINE [pixels] */ |
7069 | 232 H_total_pixels = total_active_pixels + blanking_time ; |
233 DEBUG_PRINTF("H_total_pixels: %f\n",H_total_pixels) | |
234 if (type == GTF_VF) | |
235 { | |
236 /* FIND PIXEL FREQUENCY [Mhz] */ | |
237 pixel_freq = H_total_pixels / actual_H_period ; | |
238 DEBUG_PRINTF("pixel_freq: %f\n",pixel_freq) | |
239 } else if (type == GTF_HF) | |
240 { | |
241 /* FIND PIXEL FREQUENCY [Mhz] */ | |
242 pixel_freq = H_total_pixels * freq / 1000 ; | |
243 DEBUG_PRINTF("pixel_freq: %f\n",pixel_freq) | |
244 actual_H_period = 1000/freq; | |
245 } | |
246 | |
247 /* FIND ACTUAL HORIZONTAL FREQUENCY [KHz] */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
248 |
7069 | 249 H_freq = 1000 / actual_H_period; |
250 DEBUG_PRINTF("H_freq %f\n",H_freq) | |
251 | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
252 |
7069 | 253 } |
254 | |
255 /* FIND NUMBER OF LINES IN BACK PORCH [lines] */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
256 |
7069 | 257 BP = sync_plus_BP - c.Vsync_need; |
258 DEBUG_PRINTF("BP: %f\n",BP) | |
259 | |
260 /*------------------------------------------------------------------------------------------------*/ | |
261 /* FIND H SYNC WIDTH (TO NEAREST CHAR CELL) */ | |
262 H_sync_width = round(c.sync_width/100*H_total_pixels/c.char_cell_granularity)*c.char_cell_granularity; | |
263 DEBUG_PRINTF("H_sync_width %f\n",H_sync_width) | |
264 | |
265 /* FIND FRONT H PORCH(TO NEAREST CHAR CELL) */ | |
266 H_front_porch = (blanking_time/2) - H_sync_width; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
267 DEBUG_PRINTF("H_front_porch %f\n",H_front_porch) |
7069 | 268 /* FIND BACK H PORCH(TO NEAREST CHAR CELL) */ |
269 H_back_porch = H_sync_width + H_front_porch; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
270 DEBUG_PRINTF("H_back_porch%f\n",H_back_porch) |
7069 | 271 |
272 H_sync_start = H_total_pixels - (H_sync_width + H_back_porch); | |
273 DEBUG_PRINTF("H_sync_start %f\n",H_sync_start) | |
274 H_sync_end = H_total_pixels - H_back_porch; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
275 DEBUG_PRINTF("H_sync_end %f\n",H_sync_end) |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
276 |
7069 | 277 V_back_porch = interlace + BP; |
278 DEBUG_PRINTF("V_back_porch%f\n",V_back_porch) | |
279 V_front_porch = interlace + c.min_front_porch; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
280 DEBUG_PRINTF("V_front_porch%f\n",V_front_porch) |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
281 |
7069 | 282 V_sync_width = c.Vsync_need; |
283 V_sync_start = V_total_lines_field - (V_sync_width + V_back_porch); | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
284 DEBUG_PRINTF("V_sync_start %f\n",V_sync_start) |
7069 | 285 V_sync_end = V_total_lines_field - V_back_porch; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
286 DEBUG_PRINTF("V_sync_end %f\n",V_sync_end) |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
287 |
7069 | 288 result->hTotal = H_total_pixels; |
289 result-> hSyncStart = H_sync_start; /* Horizontal sync start in pixels */ | |
290 result-> hSyncEnd = H_sync_end; /* Horizontal sync end in pixels */ | |
291 result-> vTotal= V_total_lines_field; /* Vertical total in lines */ | |
292 result-> vSyncStart = V_sync_start; /* Vertical sync start in lines */ | |
293 result-> vSyncEnd = V_sync_end; /* Vertical sync end in lines */ | |
294 result-> Flags = (result->Flags)|VESA_CRTC_HSYNC_NEG; /* Flags (Interlaced, Double Scan etc) */ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
295 |
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
296 if (want_interlace) |
7069 | 297 { |
298 result->Flags = (result->Flags) | VESA_CRTC_INTERLACED; | |
299 } | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
300 |
7069 | 301 result-> PixelClock = pixel_freq*1000000; /* Pixel clock in units of Hz */ |
302 result-> RefreshRate = actual_V_frame_freq*100;/* Refresh rate in units of 0.01 Hz*/ | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
27509
diff
changeset
|
303 |
7069 | 304 } |