diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-11-15 04:47:39 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-12-02 01:54:37 -0500 |
commit | f6a5e0871f22428a7c74c07ddd791197c5f5d38f (patch) | |
tree | 3d2208a75fb1c55950ff890c3e1eb9191abcddc1 /drivers/video/omap2/dss/apply.c | |
parent | bc1a95181f7069920c13fcef0159ffa7d61160f1 (diff) |
OMAPDSS: APPLY: configure_* funcs take ovl/manager as args
Make configure_overlay() and configure_manager() take overlay/manager
pointer as an argument, instead of the ovl/mgr id. This will be useful
with the future patches.
Also rename the functions to be a bit more informative:
dss_ovl_write_regs, dss_mgr_write_regs, dss_write_regs.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2/dss/apply.c')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 9cdfbfa629de..82d122b209a3 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -41,7 +41,7 @@ | |||
41 | * | dss_cache | | 41 | * | dss_cache | |
42 | * +--------------------+ | 42 | * +--------------------+ |
43 | * v | 43 | * v |
44 | * configure() | 44 | * write_regs() |
45 | * v | 45 | * v |
46 | * +--------------------+ | 46 | * +--------------------+ |
47 | * | shadow registers | | 47 | * | shadow registers | |
@@ -237,65 +237,63 @@ int dss_mgr_wait_for_go_ovl(struct omap_overlay *ovl) | |||
237 | return r; | 237 | return r; |
238 | } | 238 | } |
239 | 239 | ||
240 | static int configure_overlay(enum omap_plane plane) | 240 | static int dss_ovl_write_regs(struct omap_overlay *ovl) |
241 | { | 241 | { |
242 | struct omap_overlay *ovl; | ||
243 | struct overlay_cache_data *c; | 242 | struct overlay_cache_data *c; |
244 | struct omap_overlay_info *oi; | 243 | struct omap_overlay_info *oi; |
245 | bool ilace, replication; | 244 | bool ilace, replication; |
246 | int r; | 245 | int r; |
247 | 246 | ||
248 | DSSDBGF("%d", plane); | 247 | DSSDBGF("%d", ovl->id); |
249 | 248 | ||
250 | c = &dss_cache.overlay_cache[plane]; | 249 | c = &dss_cache.overlay_cache[ovl->id]; |
251 | oi = &c->info; | 250 | oi = &c->info; |
252 | 251 | ||
253 | if (!c->enabled) { | 252 | if (!c->enabled) { |
254 | dispc_ovl_enable(plane, 0); | 253 | dispc_ovl_enable(ovl->id, 0); |
255 | return 0; | 254 | return 0; |
256 | } | 255 | } |
257 | 256 | ||
258 | ovl = omap_dss_get_overlay(plane); | ||
259 | |||
260 | replication = dss_use_replication(ovl->manager->device, oi->color_mode); | 257 | replication = dss_use_replication(ovl->manager->device, oi->color_mode); |
261 | 258 | ||
262 | ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC; | 259 | ilace = ovl->manager->device->type == OMAP_DISPLAY_TYPE_VENC; |
263 | 260 | ||
264 | dispc_ovl_set_channel_out(plane, c->channel); | 261 | dispc_ovl_set_channel_out(ovl->id, c->channel); |
265 | 262 | ||
266 | r = dispc_ovl_setup(plane, oi, ilace, replication); | 263 | r = dispc_ovl_setup(ovl->id, oi, ilace, replication); |
267 | if (r) { | 264 | if (r) { |
268 | /* this shouldn't happen */ | 265 | /* this shouldn't happen */ |
269 | DSSERR("dispc_ovl_setup failed for ovl %d\n", plane); | 266 | DSSERR("dispc_ovl_setup failed for ovl %d\n", ovl->id); |
270 | dispc_ovl_enable(plane, 0); | 267 | dispc_ovl_enable(ovl->id, 0); |
271 | return r; | 268 | return r; |
272 | } | 269 | } |
273 | 270 | ||
274 | dispc_ovl_set_fifo_threshold(plane, c->fifo_low, c->fifo_high); | 271 | dispc_ovl_set_fifo_threshold(ovl->id, c->fifo_low, c->fifo_high); |
275 | 272 | ||
276 | dispc_ovl_enable(plane, 1); | 273 | dispc_ovl_enable(ovl->id, 1); |
277 | 274 | ||
278 | return 0; | 275 | return 0; |
279 | } | 276 | } |
280 | 277 | ||
281 | static void configure_manager(enum omap_channel channel) | 278 | static void dss_mgr_write_regs(struct omap_overlay_manager *mgr) |
282 | { | 279 | { |
283 | struct omap_overlay_manager_info *mi; | 280 | struct omap_overlay_manager_info *mi; |
284 | 281 | ||
285 | DSSDBGF("%d", channel); | 282 | DSSDBGF("%d", mgr->id); |
286 | 283 | ||
287 | /* picking info from the cache */ | 284 | mi = &dss_cache.manager_cache[mgr->id].info; |
288 | mi = &dss_cache.manager_cache[channel].info; | ||
289 | 285 | ||
290 | dispc_mgr_setup(channel, mi); | 286 | dispc_mgr_setup(mgr->id, mi); |
291 | } | 287 | } |
292 | 288 | ||
293 | /* configure_dispc() tries to write values from cache to shadow registers. | 289 | /* dss_write_regs() tries to write values from cache to shadow registers. |
294 | * It writes only to those managers/overlays that are not busy. | 290 | * It writes only to those managers/overlays that are not busy. |
295 | * returns 0 if everything could be written to shadow registers. | 291 | * returns 0 if everything could be written to shadow registers. |
296 | * returns 1 if not everything could be written to shadow registers. */ | 292 | * returns 1 if not everything could be written to shadow registers. */ |
297 | static int configure_dispc(void) | 293 | static int dss_write_regs(void) |
298 | { | 294 | { |
295 | struct omap_overlay *ovl; | ||
296 | struct omap_overlay_manager *mgr; | ||
299 | struct overlay_cache_data *oc; | 297 | struct overlay_cache_data *oc; |
300 | struct manager_cache_data *mc; | 298 | struct manager_cache_data *mc; |
301 | const int num_ovls = dss_feat_get_num_ovls(); | 299 | const int num_ovls = dss_feat_get_num_ovls(); |
@@ -316,6 +314,7 @@ static int configure_dispc(void) | |||
316 | 314 | ||
317 | /* Commit overlay settings */ | 315 | /* Commit overlay settings */ |
318 | for (i = 0; i < num_ovls; ++i) { | 316 | for (i = 0; i < num_ovls; ++i) { |
317 | ovl = omap_dss_get_overlay(i); | ||
319 | oc = &dss_cache.overlay_cache[i]; | 318 | oc = &dss_cache.overlay_cache[i]; |
320 | mc = &dss_cache.manager_cache[oc->channel]; | 319 | mc = &dss_cache.manager_cache[oc->channel]; |
321 | 320 | ||
@@ -330,9 +329,9 @@ static int configure_dispc(void) | |||
330 | continue; | 329 | continue; |
331 | } | 330 | } |
332 | 331 | ||
333 | r = configure_overlay(i); | 332 | r = dss_ovl_write_regs(ovl); |
334 | if (r) | 333 | if (r) |
335 | DSSERR("configure_overlay %d failed\n", i); | 334 | DSSERR("dss_ovl_write_regs %d failed\n", i); |
336 | 335 | ||
337 | oc->dirty = false; | 336 | oc->dirty = false; |
338 | oc->shadow_dirty = true; | 337 | oc->shadow_dirty = true; |
@@ -341,6 +340,7 @@ static int configure_dispc(void) | |||
341 | 340 | ||
342 | /* Commit manager settings */ | 341 | /* Commit manager settings */ |
343 | for (i = 0; i < num_mgrs; ++i) { | 342 | for (i = 0; i < num_mgrs; ++i) { |
343 | mgr = omap_dss_get_overlay_manager(i); | ||
344 | mc = &dss_cache.manager_cache[i]; | 344 | mc = &dss_cache.manager_cache[i]; |
345 | 345 | ||
346 | if (!mc->dirty) | 346 | if (!mc->dirty) |
@@ -354,7 +354,7 @@ static int configure_dispc(void) | |||
354 | continue; | 354 | continue; |
355 | } | 355 | } |
356 | 356 | ||
357 | configure_manager(i); | 357 | dss_mgr_write_regs(mgr); |
358 | mc->dirty = false; | 358 | mc->dirty = false; |
359 | mc->shadow_dirty = true; | 359 | mc->shadow_dirty = true; |
360 | mgr_go[i] = true; | 360 | mgr_go[i] = true; |
@@ -391,7 +391,7 @@ void dss_mgr_start_update(struct omap_overlay_manager *mgr) | |||
391 | mc = &dss_cache.manager_cache[mgr->id]; | 391 | mc = &dss_cache.manager_cache[mgr->id]; |
392 | 392 | ||
393 | mc->do_manual_update = true; | 393 | mc->do_manual_update = true; |
394 | configure_dispc(); | 394 | dss_write_regs(); |
395 | mc->do_manual_update = false; | 395 | mc->do_manual_update = false; |
396 | 396 | ||
397 | list_for_each_entry(ovl, &mgr->overlays, list) { | 397 | list_for_each_entry(ovl, &mgr->overlays, list) { |
@@ -465,7 +465,7 @@ static void dss_apply_irq_handler(void *data, u32 mask) | |||
465 | mc->shadow_dirty = false; | 465 | mc->shadow_dirty = false; |
466 | } | 466 | } |
467 | 467 | ||
468 | r = configure_dispc(); | 468 | r = dss_write_regs(); |
469 | if (r == 1) | 469 | if (r == 1) |
470 | goto end; | 470 | goto end; |
471 | 471 | ||
@@ -623,7 +623,7 @@ int omap_dss_mgr_apply(struct omap_overlay_manager *mgr) | |||
623 | if (!dss_cache.irq_enabled) | 623 | if (!dss_cache.irq_enabled) |
624 | dss_register_vsync_isr(); | 624 | dss_register_vsync_isr(); |
625 | 625 | ||
626 | configure_dispc(); | 626 | dss_write_regs(); |
627 | } | 627 | } |
628 | 628 | ||
629 | spin_unlock_irqrestore(&dss_cache.lock, flags); | 629 | spin_unlock_irqrestore(&dss_cache.lock, flags); |