aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorAmber Jain <amber@ti.com>2011-05-19 10:17:52 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2011-05-23 01:29:47 -0400
commit5719d35cce5b8f7c09cbf6860a37e9762b3bda72 (patch)
tree1442f345671f76e3225775a17348a71be37817ed /drivers/video
parented14a3ce9878185ea8348cc2f2e9b53129f84dc7 (diff)
OMAP: DSS2: Use for loop where ever possible in SR(), RR()
Use for loop instead of individual entries for OVL_FIR_COEF_H, OVL_FIR_COEF_HV, OVL_FIR_COEF_V and OVL_CONV_COEF in SR() and RR(). Signed-off-by: Amber Jain <amber@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/omap2/dss/dispc.c174
1 files changed, 46 insertions, 128 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index fd8f68e616d0..d16eb70bf5b5 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -129,6 +129,7 @@ static inline u32 dispc_read_reg(const u16 idx)
129 129
130void dispc_save_context(void) 130void dispc_save_context(void)
131{ 131{
132 int i;
132 if (cpu_is_omap24xx()) 133 if (cpu_is_omap24xx())
133 return; 134 return;
134 135
@@ -204,38 +205,17 @@ void dispc_save_context(void)
204 SR(OVL_ACCU0(OMAP_DSS_VIDEO1)); 205 SR(OVL_ACCU0(OMAP_DSS_VIDEO1));
205 SR(OVL_ACCU1(OMAP_DSS_VIDEO1)); 206 SR(OVL_ACCU1(OMAP_DSS_VIDEO1));
206 207
207 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 0)); 208 for (i = 0; i < 8; i++)
208 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 1)); 209 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, i));
209 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 2)); 210
210 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 3)); 211 for (i = 0; i < 8; i++)
211 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 4)); 212 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, i));
212 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 5)); 213
213 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 6)); 214 for (i = 0; i < 5; i++)
214 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 7)); 215 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, i));
215 216
216 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 0)); 217 for (i = 0; i < 8; i++)
217 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 1)); 218 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, i));
218 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 2));
219 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 3));
220 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 4));
221 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 5));
222 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 6));
223 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 7));
224
225 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 0));
226 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 1));
227 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 2));
228 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 3));
229 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 4));
230
231 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 0));
232 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 1));
233 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 2));
234 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 3));
235 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 4));
236 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 5));
237 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 6));
238 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 7));
239 219
240 SR(OVL_PRELOAD(OMAP_DSS_VIDEO1)); 220 SR(OVL_PRELOAD(OMAP_DSS_VIDEO1));
241 221
@@ -253,38 +233,17 @@ void dispc_save_context(void)
253 SR(OVL_ACCU0(OMAP_DSS_VIDEO2)); 233 SR(OVL_ACCU0(OMAP_DSS_VIDEO2));
254 SR(OVL_ACCU1(OMAP_DSS_VIDEO2)); 234 SR(OVL_ACCU1(OMAP_DSS_VIDEO2));
255 235
256 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 0)); 236 for (i = 0; i < 8; i++)
257 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 1)); 237 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, i));
258 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 2)); 238
259 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 3)); 239 for (i = 0; i < 8; i++)
260 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 4)); 240 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, i));
261 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 5)); 241
262 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 6)); 242 for (i = 0; i < 5; i++)
263 SR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 7)); 243 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, i));
264 244
265 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 0)); 245 for (i = 0; i < 8; i++)
266 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 1)); 246 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, i));
267 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 2));
268 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 3));
269 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 4));
270 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 5));
271 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 6));
272 SR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 7));
273
274 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 0));
275 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 1));
276 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 2));
277 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 3));
278 SR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 4));
279
280 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 0));
281 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 1));
282 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 2));
283 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 3));
284 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 4));
285 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 5));
286 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 6));
287 SR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 7));
288 247
289 SR(OVL_PRELOAD(OMAP_DSS_VIDEO2)); 248 SR(OVL_PRELOAD(OMAP_DSS_VIDEO2));
290 249
@@ -294,6 +253,7 @@ void dispc_save_context(void)
294 253
295void dispc_restore_context(void) 254void dispc_restore_context(void)
296{ 255{
256 int i;
297 RR(SYSCONFIG); 257 RR(SYSCONFIG);
298 /*RR(IRQENABLE);*/ 258 /*RR(IRQENABLE);*/
299 /*RR(CONTROL);*/ 259 /*RR(CONTROL);*/
@@ -366,38 +326,17 @@ void dispc_restore_context(void)
366 RR(OVL_ACCU0(OMAP_DSS_VIDEO1)); 326 RR(OVL_ACCU0(OMAP_DSS_VIDEO1));
367 RR(OVL_ACCU1(OMAP_DSS_VIDEO1)); 327 RR(OVL_ACCU1(OMAP_DSS_VIDEO1));
368 328
369 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 0)); 329 for (i = 0; i < 8; i++)
370 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 1)); 330 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, i));
371 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 2)); 331
372 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 3)); 332 for (i = 0; i < 8; i++)
373 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 4)); 333 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, i));
374 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 5)); 334
375 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 6)); 335 for (i = 0; i < 5; i++)
376 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO1, 7)); 336 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, i));
377 337
378 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 0)); 338 for (i = 0; i < 8; i++)
379 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 1)); 339 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, i));
380 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 2));
381 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 3));
382 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 4));
383 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 5));
384 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 6));
385 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO1, 7));
386
387 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 0));
388 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 1));
389 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 2));
390 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 3));
391 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO1, 4));
392
393 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 0));
394 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 1));
395 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 2));
396 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 3));
397 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 4));
398 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 5));
399 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 6));
400 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO1, 7));
401 340
402 RR(OVL_PRELOAD(OMAP_DSS_VIDEO1)); 341 RR(OVL_PRELOAD(OMAP_DSS_VIDEO1));
403 342
@@ -415,38 +354,17 @@ void dispc_restore_context(void)
415 RR(OVL_ACCU0(OMAP_DSS_VIDEO2)); 354 RR(OVL_ACCU0(OMAP_DSS_VIDEO2));
416 RR(OVL_ACCU1(OMAP_DSS_VIDEO2)); 355 RR(OVL_ACCU1(OMAP_DSS_VIDEO2));
417 356
418 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 0)); 357 for (i = 0; i < 8; i++)
419 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 1)); 358 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, i));
420 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 2)); 359
421 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 3)); 360 for (i = 0; i < 8; i++)
422 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 4)); 361 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, i));
423 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 5)); 362
424 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 6)); 363 for (i = 0; i < 5; i++)
425 RR(OVL_FIR_COEF_H(OMAP_DSS_VIDEO2, 7)); 364 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, i));
426 365
427 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 0)); 366 for (i = 0; i < 8; i++)
428 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 1)); 367 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, i));
429 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 2));
430 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 3));
431 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 4));
432 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 5));
433 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 6));
434 RR(OVL_FIR_COEF_HV(OMAP_DSS_VIDEO2, 7));
435
436 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 0));
437 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 1));
438 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 2));
439 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 3));
440 RR(OVL_CONV_COEF(OMAP_DSS_VIDEO2, 4));
441
442 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 0));
443 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 1));
444 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 2));
445 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 3));
446 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 4));
447 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 5));
448 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 6));
449 RR(OVL_FIR_COEF_V(OMAP_DSS_VIDEO2, 7));
450 368
451 RR(OVL_PRELOAD(OMAP_DSS_VIDEO2)); 369 RR(OVL_PRELOAD(OMAP_DSS_VIDEO2));
452 370