aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/video/omap2/dss/apply.c53
-rw-r--r--drivers/video/omap2/dss/dss.h2
-rw-r--r--drivers/video/omap2/dss/manager.c17
-rw-r--r--drivers/video/omap2/dss/overlay.c90
4 files changed, 3 insertions, 159 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 1aab0a340ee..b5a542fbd81 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -503,10 +503,9 @@ end:
503 spin_unlock(&data_lock); 503 spin_unlock(&data_lock);
504} 504}
505 505
506static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl) 506static void omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
507{ 507{
508 struct ovl_priv_data *op; 508 struct ovl_priv_data *op;
509 struct omap_dss_device *dssdev;
510 509
511 op = get_ovl_priv(ovl); 510 op = get_ovl_priv(ovl);
512 511
@@ -520,21 +519,11 @@ static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
520 op->enabled = false; 519 op->enabled = false;
521 op->dirty = true; 520 op->dirty = true;
522 } 521 }
523 return 0; 522 return;
524 } 523 }
525 524
526 if (!ovl->info_dirty) 525 if (!ovl->info_dirty)
527 return 0; 526 return;
528
529 dssdev = ovl->manager->device;
530
531 if (dss_check_overlay(ovl, dssdev)) {
532 if (op->enabled) {
533 op->enabled = false;
534 op->dirty = true;
535 }
536 return -EINVAL;
537 }
538 527
539 ovl->info_dirty = false; 528 ovl->info_dirty = false;
540 op->dirty = true; 529 op->dirty = true;
@@ -543,8 +532,6 @@ static int omap_dss_mgr_apply_ovl(struct omap_overlay *ovl)
543 op->channel = ovl->manager->id; 532 op->channel = ovl->manager->id;
544 533
545 op->enabled = true; 534 op->enabled = true;
546
547 return 0;
548} 535}
549 536
550static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr) 537static void omap_dss_mgr_apply_mgr(struct omap_overlay_manager *mgr)
@@ -665,18 +652,7 @@ void dss_mgr_disable(struct omap_overlay_manager *mgr)
665int dss_mgr_set_info(struct omap_overlay_manager *mgr, 652int dss_mgr_set_info(struct omap_overlay_manager *mgr,
666 struct omap_overlay_manager_info *info) 653 struct omap_overlay_manager_info *info)
667{ 654{
668 int r;
669 struct omap_overlay_manager_info old_info;
670
671 old_info = mgr->info;
672 mgr->info = *info; 655 mgr->info = *info;
673
674 r = dss_check_manager(mgr);
675 if (r) {
676 mgr->info = old_info;
677 return r;
678 }
679
680 mgr->info_dirty = true; 656 mgr->info_dirty = true;
681 657
682 return 0; 658 return 0;
@@ -692,7 +668,6 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,
692 struct omap_dss_device *dssdev) 668 struct omap_dss_device *dssdev)
693{ 669{
694 int r; 670 int r;
695 struct omap_overlay *ovl;
696 671
697 if (dssdev->manager) { 672 if (dssdev->manager) {
698 DSSERR("display '%s' already has a manager '%s'\n", 673 DSSERR("display '%s' already has a manager '%s'\n",
@@ -706,15 +681,6 @@ int dss_mgr_set_device(struct omap_overlay_manager *mgr,
706 return -EINVAL; 681 return -EINVAL;
707 } 682 }
708 683
709 list_for_each_entry(ovl, &mgr->overlays, list) {
710 if (!ovl->info.enabled)
711 continue;
712
713 r = dss_check_overlay(ovl, dssdev);
714 if (r)
715 return r;
716 }
717
718 dssdev->manager = mgr; 684 dssdev->manager = mgr;
719 mgr->device = dssdev; 685 mgr->device = dssdev;
720 mgr->device_changed = true; 686 mgr->device_changed = true;
@@ -748,20 +714,7 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr)
748int dss_ovl_set_info(struct omap_overlay *ovl, 714int dss_ovl_set_info(struct omap_overlay *ovl,
749 struct omap_overlay_info *info) 715 struct omap_overlay_info *info)
750{ 716{
751 int r;
752 struct omap_overlay_info old_info;
753
754 old_info = ovl->info;
755 ovl->info = *info; 717 ovl->info = *info;
756
757 if (ovl->manager) {
758 r = dss_check_overlay(ovl, ovl->manager->device);
759 if (r) {
760 ovl->info = old_info;
761 return r;
762 }
763 }
764
765 ovl->info_dirty = true; 718 ovl->info_dirty = true;
766 719
767 return 0; 720 return 0;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 41f69a10d35..a5493df14ee 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -206,12 +206,10 @@ void default_get_overlay_fifo_thresholds(enum omap_plane plane,
206/* manager */ 206/* manager */
207int dss_init_overlay_managers(struct platform_device *pdev); 207int dss_init_overlay_managers(struct platform_device *pdev);
208void dss_uninit_overlay_managers(struct platform_device *pdev); 208void dss_uninit_overlay_managers(struct platform_device *pdev);
209int dss_check_manager(struct omap_overlay_manager *mgr);
210 209
211/* overlay */ 210/* overlay */
212void dss_init_overlays(struct platform_device *pdev); 211void dss_init_overlays(struct platform_device *pdev);
213void dss_uninit_overlays(struct platform_device *pdev); 212void dss_uninit_overlays(struct platform_device *pdev);
214int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev);
215void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr); 213void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr);
216void dss_recheck_connections(struct omap_dss_device *dssdev, bool force); 214void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
217 215
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c
index ab0b61b716f..d7fd494908d 100644
--- a/drivers/video/omap2/dss/manager.c
+++ b/drivers/video/omap2/dss/manager.c
@@ -485,23 +485,6 @@ static int dss_mgr_wait_for_vsync(struct omap_overlay_manager *mgr)
485 return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout); 485 return omap_dispc_wait_for_irq_interruptible_timeout(irq, timeout);
486} 486}
487 487
488int dss_check_manager(struct omap_overlay_manager *mgr)
489{
490 if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) {
491 /*
492 * OMAP3 supports only graphics source transparency color key
493 * and alpha blending simultaneously. See TRM 15.4.2.4.2.2
494 * Alpha Mode
495 */
496 if (mgr->info.partial_alpha_enabled && mgr->info.trans_enabled
497 && mgr->info.trans_key_type !=
498 OMAP_DSS_COLOR_KEY_GFX_DST)
499 return -EINVAL;
500 }
501
502 return 0;
503}
504
505int dss_init_overlay_managers(struct platform_device *pdev) 488int dss_init_overlay_managers(struct platform_device *pdev)
506{ 489{
507 int i, r; 490 int i, r;
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index 00c01a39555..4dc6b92592d 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -430,96 +430,6 @@ static struct kobj_type overlay_ktype = {
430 .default_attrs = overlay_sysfs_attrs, 430 .default_attrs = overlay_sysfs_attrs,
431}; 431};
432 432
433/* Check if overlay parameters are compatible with display */
434int dss_check_overlay(struct omap_overlay *ovl, struct omap_dss_device *dssdev)
435{
436 struct omap_overlay_info *info;
437 u16 outw, outh;
438 u16 dw, dh;
439 int i;
440
441 if (!dssdev)
442 return 0;
443
444 if (!ovl->info.enabled)
445 return 0;
446
447 info = &ovl->info;
448
449 if (info->paddr == 0) {
450 DSSDBG("check_overlay failed: paddr 0\n");
451 return -EINVAL;
452 }
453
454 dssdev->driver->get_resolution(dssdev, &dw, &dh);
455
456 DSSDBG("check_overlay %d: (%d,%d %dx%d -> %dx%d) disp (%dx%d)\n",
457 ovl->id,
458 info->pos_x, info->pos_y,
459 info->width, info->height,
460 info->out_width, info->out_height,
461 dw, dh);
462
463 if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
464 outw = info->width;
465 outh = info->height;
466 } else {
467 if (info->out_width == 0)
468 outw = info->width;
469 else
470 outw = info->out_width;
471
472 if (info->out_height == 0)
473 outh = info->height;
474 else
475 outh = info->out_height;
476 }
477
478 if (dw < info->pos_x + outw) {
479 DSSDBG("check_overlay failed 1: %d < %d + %d\n",
480 dw, info->pos_x, outw);
481 return -EINVAL;
482 }
483
484 if (dh < info->pos_y + outh) {
485 DSSDBG("check_overlay failed 2: %d < %d + %d\n",
486 dh, info->pos_y, outh);
487 return -EINVAL;
488 }
489
490 if ((ovl->supported_modes & info->color_mode) == 0) {
491 DSSERR("overlay doesn't support mode %d\n", info->color_mode);
492 return -EINVAL;
493 }
494
495 if (ovl->caps & OMAP_DSS_OVL_CAP_ZORDER) {
496 if (info->zorder < 0 || info->zorder > 3) {
497 DSSERR("zorder out of range: %d\n",
498 info->zorder);
499 return -EINVAL;
500 }
501 /*
502 * Check that zorder doesn't match with zorder of any other
503 * overlay which is enabled and is also connected to the same
504 * manager
505 */
506 for (i = 0; i < omap_dss_get_num_overlays(); i++) {
507 struct omap_overlay *tmp_ovl = omap_dss_get_overlay(i);
508
509 if (tmp_ovl->id != ovl->id &&
510 tmp_ovl->manager == ovl->manager &&
511 tmp_ovl->info.enabled == true &&
512 tmp_ovl->info.zorder == info->zorder) {
513 DSSERR("%s and %s have same zorder: %d\n",
514 ovl->name, tmp_ovl->name, info->zorder);
515 return -EINVAL;
516 }
517 }
518 }
519
520 return 0;
521}
522
523int omap_dss_get_num_overlays(void) 433int omap_dss_get_num_overlays(void)
524{ 434{
525 return num_overlays; 435 return num_overlays;