diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-11-15 05:02:03 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-12-02 01:54:38 -0500 |
commit | af3d64b2c674bc6246bb04654b484f34287fbbc3 (patch) | |
tree | 9fc77dc3c97297a36fc7a7faf22410db7d15c665 /drivers/video | |
parent | c10c6f042b6a5940c522a334a716d57b40f7dec9 (diff) |
OMAPDSS: APPLY: rename manager_cache_data
manager_cache_data is not a suitable name for the struct. It is more of
a private data for the manager.
Rename the struct to mgr_priv_data, and add a function,
get_mgr_priv(mgr), to get a pointer to the data.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 72 |
1 files changed, 40 insertions, 32 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index c73742e3b43d..9c035e272e19 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -73,7 +73,7 @@ struct ovl_priv_data { | |||
73 | u32 fifo_high; | 73 | u32 fifo_high; |
74 | }; | 74 | }; |
75 | 75 | ||
76 | struct manager_cache_data { | 76 | struct mgr_priv_data { |
77 | /* If true, cache changed, but not written to shadow registers. Set | 77 | /* If true, cache changed, but not written to shadow registers. Set |
78 | * in apply(), cleared when registers written. */ | 78 | * in apply(), cleared when registers written. */ |
79 | bool dirty; | 79 | bool dirty; |
@@ -91,7 +91,7 @@ struct manager_cache_data { | |||
91 | static struct { | 91 | static struct { |
92 | spinlock_t lock; | 92 | spinlock_t lock; |
93 | struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS]; | 93 | struct ovl_priv_data ovl_priv_data_array[MAX_DSS_OVERLAYS]; |
94 | struct manager_cache_data manager_cache[MAX_DSS_MANAGERS]; | 94 | struct mgr_priv_data mgr_priv_data_array[MAX_DSS_MANAGERS]; |
95 | 95 | ||
96 | bool irq_enabled; | 96 | bool irq_enabled; |
97 | } dss_cache; | 97 | } dss_cache; |
@@ -101,6 +101,11 @@ static struct ovl_priv_data *get_ovl_priv(struct omap_overlay *ovl) | |||
101 | return &dss_cache.ovl_priv_data_array[ovl->id]; | 101 | return &dss_cache.ovl_priv_data_array[ovl->id]; |
102 | } | 102 | } |
103 | 103 | ||
104 | static struct mgr_priv_data *get_mgr_priv(struct omap_overlay_manager *mgr) | ||
105 | { | ||
106 | return &dss_cache.mgr_priv_data_array[mgr->id]; | ||
107 | } | ||
108 | |||
104 | void dss_apply_init(void) | 109 | void dss_apply_init(void) |
105 | { | 110 | { |
106 | spin_lock_init(&dss_cache.lock); | 111 | spin_lock_init(&dss_cache.lock); |
@@ -124,7 +129,7 @@ static int overlay_enabled(struct omap_overlay *ovl) | |||
124 | int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) | 129 | int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) |
125 | { | 130 | { |
126 | unsigned long timeout = msecs_to_jiffies(500); | 131 | unsigned long timeout = msecs_to_jiffies(500); |
127 | struct manager_cache_data *mc; | 132 | struct mgr_priv_data *mp; |
128 | u32 irq; | 133 | u32 irq; |
129 | int r; | 134 | int r; |
130 | int i; | 135 | int i; |
@@ -138,15 +143,15 @@ int dss_mgr_wait_for_go(struct omap_overlay_manager *mgr) | |||
138 | 143 | ||
139 | irq = dispc_mgr_get_vsync_irq(mgr->id); | 144 | irq = dispc_mgr_get_vsync_irq(mgr->id); |
140 | 145 | ||
141 | mc = &dss_cache.manager_cache[mgr->id]; | 146 | mp = get_mgr_priv(mgr); |
142 | i = 0; | 147 | i = 0; |
143 | while (1) { | 148 | while (1) { |
144 | unsigned long flags; | 149 | unsigned long flags; |
145 | bool shadow_dirty, dirty; | 150 | bool shadow_dirty, dirty; |
146 | 151 | ||
147 | spin_lock_irqsave(&dss_cache.lock, flags); | 152 | spin_lock_irqsave(&dss_cache.lock, flags); |
148 | dirty = mc->dirty; | 153 | dirty = mp->dirty; |
149 | shadow_dirty = mc->shadow_dirty; | 154 | shadow_dirty = mp->shadow_dirty; |
150 | spin_unlock_irqrestore(&dss_cache.lock, flags); | 155 | spin_unlock_irqrestore(&dss_cache.lock, flags); |
151 | 156 | ||
152 | if (!dirty && !shadow_dirty) { | 157 | if (!dirty && !shadow_dirty) { |
@@ -282,11 +287,13 @@ static int dss_ovl_write_regs(struct omap_overlay *ovl) | |||
282 | 287 | ||
283 | static void dss_mgr_write_regs(struct omap_overlay_manager *mgr) | 288 | static void dss_mgr_write_regs(struct omap_overlay_manager *mgr) |
284 | { | 289 | { |
290 | struct mgr_priv_data *mp; | ||
285 | struct omap_overlay_manager_info *mi; | 291 | struct omap_overlay_manager_info *mi; |
286 | 292 | ||
287 | DSSDBGF("%d", mgr->id); | 293 | DSSDBGF("%d", mgr->id); |
288 | 294 | ||
289 | mi = &dss_cache.manager_cache[mgr->id].info; | 295 | mp = get_mgr_priv(mgr); |
296 | mi = &mp->info; | ||
290 | 297 | ||
291 | dispc_mgr_setup(mgr->id, mi); | 298 | dispc_mgr_setup(mgr->id, mi); |
292 | } | 299 | } |
@@ -300,7 +307,7 @@ static int dss_write_regs(void) | |||
300 | struct omap_overlay *ovl; | 307 | struct omap_overlay *ovl; |
301 | struct omap_overlay_manager *mgr; | 308 | struct omap_overlay_manager *mgr; |
302 | struct ovl_priv_data *op; | 309 | struct ovl_priv_data *op; |
303 | struct manager_cache_data *mc; | 310 | struct mgr_priv_data *mp; |
304 | const int num_ovls = dss_feat_get_num_ovls(); | 311 | const int num_ovls = dss_feat_get_num_ovls(); |
305 | const int num_mgrs = dss_feat_get_num_mgrs(); | 312 | const int num_mgrs = dss_feat_get_num_mgrs(); |
306 | int i; | 313 | int i; |
@@ -321,12 +328,13 @@ static int dss_write_regs(void) | |||
321 | for (i = 0; i < num_ovls; ++i) { | 328 | for (i = 0; i < num_ovls; ++i) { |
322 | ovl = omap_dss_get_overlay(i); | 329 | ovl = omap_dss_get_overlay(i); |
323 | op = get_ovl_priv(ovl); | 330 | op = get_ovl_priv(ovl); |
324 | mc = &dss_cache.manager_cache[op->channel]; | ||
325 | 331 | ||
326 | if (!op->dirty) | 332 | if (!op->dirty) |
327 | continue; | 333 | continue; |
328 | 334 | ||
329 | if (mc->manual_update && !mc->do_manual_update) | 335 | mp = get_mgr_priv(ovl->manager); |
336 | |||
337 | if (mp->manual_update && !mp->do_manual_update) | ||
330 | continue; | 338 | continue; |
331 | 339 | ||
332 | if (mgr_busy[op->channel]) { | 340 | if (mgr_busy[op->channel]) { |
@@ -346,12 +354,12 @@ static int dss_write_regs(void) | |||
346 | /* Commit manager settings */ | 354 | /* Commit manager settings */ |
347 | for (i = 0; i < num_mgrs; ++i) { | 355 | for (i = 0; i < num_mgrs; ++i) { |
348 | mgr = omap_dss_get_overlay_manager(i); | 356 | mgr = omap_dss_get_overlay_manager(i); |
349 | mc = &dss_cache.manager_cache[i]; | 357 | mp = get_mgr_priv(mgr); |
350 | 358 | ||
351 | if (!mc->dirty) | 359 | if (!mp->dirty) |
352 | continue; | 360 | continue; |
353 | 361 | ||
354 | if (mc->manual_update && !mc->do_manual_update) | 362 | if (mp->manual_update && !mp->do_manual_update) |
355 | continue; | 363 | continue; |
356 | 364 | ||
357 | if (mgr_busy[i]) { | 365 | if (mgr_busy[i]) { |
@@ -360,14 +368,15 @@ static int dss_write_regs(void) | |||
360 | } | 368 | } |
361 | 369 | ||
362 | dss_mgr_write_regs(mgr); | 370 | dss_mgr_write_regs(mgr); |
363 | mc->dirty = false; | 371 | mp->dirty = false; |
364 | mc->shadow_dirty = true; | 372 | mp->shadow_dirty = true; |
365 | mgr_go[i] = true; | 373 | mgr_go[i] = true; |
366 | } | 374 | } |
367 | 375 | ||
368 | /* set GO */ | 376 | /* set GO */ |
369 | for (i = 0; i < num_mgrs; ++i) { | 377 | for (i = 0; i < num_mgrs; ++i) { |
370 | mc = &dss_cache.manager_cache[i]; | 378 | mgr = omap_dss_get_overlay_manager(i); |
379 | mp = get_mgr_priv(mgr); | ||
371 | 380 | ||
372 | if (!mgr_go[i]) | 381 | if (!mgr_go[i]) |
373 | continue; | 382 | continue; |
@@ -375,7 +384,7 @@ static int dss_write_regs(void) | |||
375 | /* We don't need GO with manual update display. LCD iface will | 384 | /* We don't need GO with manual update display. LCD iface will |
376 | * always be turned off after frame, and new settings will be | 385 | * always be turned off after frame, and new settings will be |
377 | * taken in to use at next update */ | 386 | * taken in to use at next update */ |
378 | if (!mc->manual_update) | 387 | if (!mp->manual_update) |
379 | dispc_mgr_go(i); | 388 | dispc_mgr_go(i); |
380 | } | 389 | } |
381 | 390 | ||
@@ -389,23 +398,20 @@ static int dss_write_regs(void) | |||
389 | 398 | ||
390 | void dss_mgr_start_update(struct omap_overlay_manager *mgr) | 399 | void dss_mgr_start_update(struct omap_overlay_manager *mgr) |
391 | { | 400 | { |
392 | struct manager_cache_data *mc; | 401 | struct mgr_priv_data *mp = get_mgr_priv(mgr); |
393 | struct ovl_priv_data *op; | 402 | struct ovl_priv_data *op; |
394 | struct omap_overlay *ovl; | 403 | struct omap_overlay *ovl; |
395 | 404 | ||
396 | mc = &dss_cache.manager_cache[mgr->id]; | 405 | mp->do_manual_update = true; |
397 | |||
398 | mc->do_manual_update = true; | ||
399 | dss_write_regs(); | 406 | dss_write_regs(); |
400 | mc->do_manual_update = false; | 407 | mp->do_manual_update = false; |
401 | 408 | ||
402 | list_for_each_entry(ovl, &mgr->overlays, list) { | 409 | list_for_each_entry(ovl, &mgr->overlays, list) { |
403 | op = get_ovl_priv(ovl); | 410 | op = get_ovl_priv(ovl); |
404 | op->shadow_dirty = false; | 411 | op->shadow_dirty = false; |
405 | } | 412 | } |
406 | 413 | ||
407 | mc = &dss_cache.manager_cache[mgr->id]; | 414 | mp->shadow_dirty = false; |
408 | mc->shadow_dirty = false; | ||
409 | 415 | ||
410 | dispc_mgr_enable(mgr->id, true); | 416 | dispc_mgr_enable(mgr->id, true); |
411 | } | 417 | } |
@@ -447,7 +453,8 @@ static void dss_unregister_vsync_isr(void) | |||
447 | static void dss_apply_irq_handler(void *data, u32 mask) | 453 | static void dss_apply_irq_handler(void *data, u32 mask) |
448 | { | 454 | { |
449 | struct omap_overlay *ovl; | 455 | struct omap_overlay *ovl; |
450 | struct manager_cache_data *mc; | 456 | struct omap_overlay_manager *mgr; |
457 | struct mgr_priv_data *mp; | ||
451 | struct ovl_priv_data *op; | 458 | struct ovl_priv_data *op; |
452 | const int num_ovls = dss_feat_get_num_ovls(); | 459 | const int num_ovls = dss_feat_get_num_ovls(); |
453 | const int num_mgrs = dss_feat_get_num_mgrs(); | 460 | const int num_mgrs = dss_feat_get_num_mgrs(); |
@@ -467,9 +474,10 @@ static void dss_apply_irq_handler(void *data, u32 mask) | |||
467 | } | 474 | } |
468 | 475 | ||
469 | for (i = 0; i < num_mgrs; ++i) { | 476 | for (i = 0; i < num_mgrs; ++i) { |
470 | mc = &dss_cache.manager_cache[i]; | 477 | mgr = omap_dss_get_overlay_manager(i); |
478 | mp = get_mgr_priv(mgr); | ||
471 | if (!mgr_busy[i]) | 479 | if (!mgr_busy[i]) |
472 | mc->shadow_dirty = false; | 480 | mp->shadow_dirty = false; |
473 | } | 481 | } |
474 | 482 | ||
475 | r = dss_write_regs(); | 483 | r = dss_write_regs(); |
@@ -539,9 +547,9 @@ static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl) | |||
539 | 547 | ||
540 | static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr) | 548 | static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr) |
541 | { | 549 | { |
542 | struct manager_cache_data *mc; | 550 | struct mgr_priv_data *mp; |
543 | 551 | ||
544 | mc = &dss_cache.manager_cache[mgr->id]; | 552 | mp = get_mgr_priv(mgr); |
545 | 553 | ||
546 | if (mgr->device_changed) { | 554 | if (mgr->device_changed) { |
547 | mgr->device_changed = false; | 555 | mgr->device_changed = false; |
@@ -555,10 +563,10 @@ static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr) | |||
555 | return; | 563 | return; |
556 | 564 | ||
557 | mgr->info_dirty = false; | 565 | mgr->info_dirty = false; |
558 | mc->dirty = true; | 566 | mp->dirty = true; |
559 | mc->info = mgr->info; | 567 | mp->info = mgr->info; |
560 | 568 | ||
561 | mc->manual_update = mgr_manual_update(mgr); | 569 | mp->manual_update = mgr_manual_update(mgr); |
562 | } | 570 | } |
563 | 571 | ||
564 | static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl) | 572 | static void omap_dss_mgr_apply_ovl_fifos(struct omap_overlay *ovl) |