diff options
author | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2011-12-13 06:18:52 -0500 |
---|---|---|
committer | Tomi Valkeinen <tomi.valkeinen@ti.com> | 2012-01-02 01:51:26 -0500 |
commit | 54540d41aaad0ed3245d3e99db014ab03a219c5a (patch) | |
tree | e81c956135475ce72f61e3b1a6b36684c4222742 /drivers/video/omap2 | |
parent | 00f17e4560da32db454c46faf1e8df4fe35cc226 (diff) |
OMAPDSS: APPLY: move simple_check functions
The functions dss_ovl_simple_check() and dss_mgr_simple_check() are not
really part of the apply mechanism, and can be moved to overlay.c and
manager.c.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r-- | drivers/video/omap2/dss/apply.c | 55 | ||||
-rw-r--r-- | drivers/video/omap2/dss/dss.h | 4 | ||||
-rw-r--r-- | drivers/video/omap2/dss/manager.c | 19 | ||||
-rw-r--r-- | drivers/video/omap2/dss/overlay.c | 36 |
4 files changed, 59 insertions, 55 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c index 12f2cdb65704..0a6fb8de19c0 100644 --- a/drivers/video/omap2/dss/apply.c +++ b/drivers/video/omap2/dss/apply.c | |||
@@ -991,25 +991,6 @@ out: | |||
991 | mutex_unlock(&apply_lock); | 991 | mutex_unlock(&apply_lock); |
992 | } | 992 | } |
993 | 993 | ||
994 | static int dss_mgr_simple_check(struct omap_overlay_manager *mgr, | ||
995 | const struct omap_overlay_manager_info *info) | ||
996 | { | ||
997 | if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) { | ||
998 | /* | ||
999 | * OMAP3 supports only graphics source transparency color key | ||
1000 | * and alpha blending simultaneously. See TRM 15.4.2.4.2.2 | ||
1001 | * Alpha Mode. | ||
1002 | */ | ||
1003 | if (info->partial_alpha_enabled && info->trans_enabled | ||
1004 | && info->trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST) { | ||
1005 | DSSERR("check_manager: illegal transparency key\n"); | ||
1006 | return -EINVAL; | ||
1007 | } | ||
1008 | } | ||
1009 | |||
1010 | return 0; | ||
1011 | } | ||
1012 | |||
1013 | int dss_mgr_set_info(struct omap_overlay_manager *mgr, | 994 | int dss_mgr_set_info(struct omap_overlay_manager *mgr, |
1014 | struct omap_overlay_manager_info *info) | 995 | struct omap_overlay_manager_info *info) |
1015 | { | 996 | { |
@@ -1109,42 +1090,6 @@ err: | |||
1109 | } | 1090 | } |
1110 | 1091 | ||
1111 | 1092 | ||
1112 | static int dss_ovl_simple_check(struct omap_overlay *ovl, | ||
1113 | const struct omap_overlay_info *info) | ||
1114 | { | ||
1115 | if (info->paddr == 0) { | ||
1116 | DSSERR("check_overlay: paddr cannot be 0\n"); | ||
1117 | return -EINVAL; | ||
1118 | } | ||
1119 | |||
1120 | if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) { | ||
1121 | if (info->out_width != 0 && info->width != info->out_width) { | ||
1122 | DSSERR("check_overlay: overlay %d doesn't support " | ||
1123 | "scaling\n", ovl->id); | ||
1124 | return -EINVAL; | ||
1125 | } | ||
1126 | |||
1127 | if (info->out_height != 0 && info->height != info->out_height) { | ||
1128 | DSSERR("check_overlay: overlay %d doesn't support " | ||
1129 | "scaling\n", ovl->id); | ||
1130 | return -EINVAL; | ||
1131 | } | ||
1132 | } | ||
1133 | |||
1134 | if ((ovl->supported_modes & info->color_mode) == 0) { | ||
1135 | DSSERR("check_overlay: overlay %d doesn't support mode %d\n", | ||
1136 | ovl->id, info->color_mode); | ||
1137 | return -EINVAL; | ||
1138 | } | ||
1139 | |||
1140 | if (info->zorder >= omap_dss_get_num_overlays()) { | ||
1141 | DSSERR("check_overlay: zorder %d too high\n", info->zorder); | ||
1142 | return -EINVAL; | ||
1143 | } | ||
1144 | |||
1145 | return 0; | ||
1146 | } | ||
1147 | |||
1148 | int dss_ovl_set_info(struct omap_overlay *ovl, | 1093 | int dss_ovl_set_info(struct omap_overlay *ovl, |
1149 | struct omap_overlay_info *info) | 1094 | struct omap_overlay_info *info) |
1150 | { | 1095 | { |
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h index 20a88392ed24..3cf99a95dae2 100644 --- a/drivers/video/omap2/dss/dss.h +++ b/drivers/video/omap2/dss/dss.h | |||
@@ -209,6 +209,8 @@ void default_get_overlay_fifo_thresholds(enum omap_plane plane, | |||
209 | /* manager */ | 209 | /* manager */ |
210 | int dss_init_overlay_managers(struct platform_device *pdev); | 210 | int dss_init_overlay_managers(struct platform_device *pdev); |
211 | void dss_uninit_overlay_managers(struct platform_device *pdev); | 211 | void dss_uninit_overlay_managers(struct platform_device *pdev); |
212 | int dss_mgr_simple_check(struct omap_overlay_manager *mgr, | ||
213 | const struct omap_overlay_manager_info *info); | ||
212 | int dss_mgr_check(struct omap_overlay_manager *mgr, | 214 | int dss_mgr_check(struct omap_overlay_manager *mgr, |
213 | struct omap_dss_device *dssdev, | 215 | struct omap_dss_device *dssdev, |
214 | struct omap_overlay_manager_info *info, | 216 | struct omap_overlay_manager_info *info, |
@@ -219,6 +221,8 @@ void dss_init_overlays(struct platform_device *pdev); | |||
219 | void dss_uninit_overlays(struct platform_device *pdev); | 221 | void dss_uninit_overlays(struct platform_device *pdev); |
220 | void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr); | 222 | void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr); |
221 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force); | 223 | void dss_recheck_connections(struct omap_dss_device *dssdev, bool force); |
224 | int dss_ovl_simple_check(struct omap_overlay *ovl, | ||
225 | const struct omap_overlay_info *info); | ||
222 | int dss_ovl_check(struct omap_overlay *ovl, | 226 | int dss_ovl_check(struct omap_overlay *ovl, |
223 | struct omap_overlay_info *info, struct omap_dss_device *dssdev); | 227 | struct omap_overlay_info *info, struct omap_dss_device *dssdev); |
224 | 228 | ||
diff --git a/drivers/video/omap2/dss/manager.c b/drivers/video/omap2/dss/manager.c index 542258dbdccc..d1858e71c64e 100644 --- a/drivers/video/omap2/dss/manager.c +++ b/drivers/video/omap2/dss/manager.c | |||
@@ -592,6 +592,25 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num) | |||
592 | } | 592 | } |
593 | EXPORT_SYMBOL(omap_dss_get_overlay_manager); | 593 | EXPORT_SYMBOL(omap_dss_get_overlay_manager); |
594 | 594 | ||
595 | int dss_mgr_simple_check(struct omap_overlay_manager *mgr, | ||
596 | const struct omap_overlay_manager_info *info) | ||
597 | { | ||
598 | if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) { | ||
599 | /* | ||
600 | * OMAP3 supports only graphics source transparency color key | ||
601 | * and alpha blending simultaneously. See TRM 15.4.2.4.2.2 | ||
602 | * Alpha Mode. | ||
603 | */ | ||
604 | if (info->partial_alpha_enabled && info->trans_enabled | ||
605 | && info->trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST) { | ||
606 | DSSERR("check_manager: illegal transparency key\n"); | ||
607 | return -EINVAL; | ||
608 | } | ||
609 | } | ||
610 | |||
611 | return 0; | ||
612 | } | ||
613 | |||
595 | static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr, | 614 | static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr, |
596 | struct omap_overlay_info **overlay_infos) | 615 | struct omap_overlay_info **overlay_infos) |
597 | { | 616 | { |
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c index c91babfc44ca..6e821810deec 100644 --- a/drivers/video/omap2/dss/overlay.c +++ b/drivers/video/omap2/dss/overlay.c | |||
@@ -595,6 +595,42 @@ void dss_uninit_overlays(struct platform_device *pdev) | |||
595 | num_overlays = 0; | 595 | num_overlays = 0; |
596 | } | 596 | } |
597 | 597 | ||
598 | int dss_ovl_simple_check(struct omap_overlay *ovl, | ||
599 | const struct omap_overlay_info *info) | ||
600 | { | ||
601 | if (info->paddr == 0) { | ||
602 | DSSERR("check_overlay: paddr cannot be 0\n"); | ||
603 | return -EINVAL; | ||
604 | } | ||
605 | |||
606 | if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) { | ||
607 | if (info->out_width != 0 && info->width != info->out_width) { | ||
608 | DSSERR("check_overlay: overlay %d doesn't support " | ||
609 | "scaling\n", ovl->id); | ||
610 | return -EINVAL; | ||
611 | } | ||
612 | |||
613 | if (info->out_height != 0 && info->height != info->out_height) { | ||
614 | DSSERR("check_overlay: overlay %d doesn't support " | ||
615 | "scaling\n", ovl->id); | ||
616 | return -EINVAL; | ||
617 | } | ||
618 | } | ||
619 | |||
620 | if ((ovl->supported_modes & info->color_mode) == 0) { | ||
621 | DSSERR("check_overlay: overlay %d doesn't support mode %d\n", | ||
622 | ovl->id, info->color_mode); | ||
623 | return -EINVAL; | ||
624 | } | ||
625 | |||
626 | if (info->zorder >= omap_dss_get_num_overlays()) { | ||
627 | DSSERR("check_overlay: zorder %d too high\n", info->zorder); | ||
628 | return -EINVAL; | ||
629 | } | ||
630 | |||
631 | return 0; | ||
632 | } | ||
633 | |||
598 | int dss_ovl_check(struct omap_overlay *ovl, | 634 | int dss_ovl_check(struct omap_overlay *ovl, |
599 | struct omap_overlay_info *info, struct omap_dss_device *dssdev) | 635 | struct omap_overlay_info *info, struct omap_dss_device *dssdev) |
600 | { | 636 | { |