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>
This commit is contained in:
parent
00f17e4560
commit
54540d41aa
4 changed files with 59 additions and 55 deletions
|
@ -991,25 +991,6 @@ out:
|
||||||
mutex_unlock(&apply_lock);
|
mutex_unlock(&apply_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
|
|
||||||
const struct omap_overlay_manager_info *info)
|
|
||||||
{
|
|
||||||
if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) {
|
|
||||||
/*
|
|
||||||
* OMAP3 supports only graphics source transparency color key
|
|
||||||
* and alpha blending simultaneously. See TRM 15.4.2.4.2.2
|
|
||||||
* Alpha Mode.
|
|
||||||
*/
|
|
||||||
if (info->partial_alpha_enabled && info->trans_enabled
|
|
||||||
&& info->trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST) {
|
|
||||||
DSSERR("check_manager: illegal transparency key\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int dss_mgr_set_info(struct omap_overlay_manager *mgr,
|
int dss_mgr_set_info(struct omap_overlay_manager *mgr,
|
||||||
struct omap_overlay_manager_info *info)
|
struct omap_overlay_manager_info *info)
|
||||||
{
|
{
|
||||||
|
@ -1109,42 +1090,6 @@ err:
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
static int dss_ovl_simple_check(struct omap_overlay *ovl,
|
|
||||||
const struct omap_overlay_info *info)
|
|
||||||
{
|
|
||||||
if (info->paddr == 0) {
|
|
||||||
DSSERR("check_overlay: paddr cannot be 0\n");
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
|
|
||||||
if (info->out_width != 0 && info->width != info->out_width) {
|
|
||||||
DSSERR("check_overlay: overlay %d doesn't support "
|
|
||||||
"scaling\n", ovl->id);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (info->out_height != 0 && info->height != info->out_height) {
|
|
||||||
DSSERR("check_overlay: overlay %d doesn't support "
|
|
||||||
"scaling\n", ovl->id);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if ((ovl->supported_modes & info->color_mode) == 0) {
|
|
||||||
DSSERR("check_overlay: overlay %d doesn't support mode %d\n",
|
|
||||||
ovl->id, info->color_mode);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (info->zorder >= omap_dss_get_num_overlays()) {
|
|
||||||
DSSERR("check_overlay: zorder %d too high\n", info->zorder);
|
|
||||||
return -EINVAL;
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int dss_ovl_set_info(struct omap_overlay *ovl,
|
int dss_ovl_set_info(struct omap_overlay *ovl,
|
||||||
struct omap_overlay_info *info)
|
struct omap_overlay_info *info)
|
||||||
{
|
{
|
||||||
|
|
|
@ -209,6 +209,8 @@ void default_get_overlay_fifo_thresholds(enum omap_plane plane,
|
||||||
/* manager */
|
/* manager */
|
||||||
int dss_init_overlay_managers(struct platform_device *pdev);
|
int dss_init_overlay_managers(struct platform_device *pdev);
|
||||||
void dss_uninit_overlay_managers(struct platform_device *pdev);
|
void dss_uninit_overlay_managers(struct platform_device *pdev);
|
||||||
|
int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
|
||||||
|
const struct omap_overlay_manager_info *info);
|
||||||
int dss_mgr_check(struct omap_overlay_manager *mgr,
|
int dss_mgr_check(struct omap_overlay_manager *mgr,
|
||||||
struct omap_dss_device *dssdev,
|
struct omap_dss_device *dssdev,
|
||||||
struct omap_overlay_manager_info *info,
|
struct omap_overlay_manager_info *info,
|
||||||
|
@ -219,6 +221,8 @@ void dss_init_overlays(struct platform_device *pdev);
|
||||||
void dss_uninit_overlays(struct platform_device *pdev);
|
void dss_uninit_overlays(struct platform_device *pdev);
|
||||||
void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr);
|
void dss_overlay_setup_dispc_manager(struct omap_overlay_manager *mgr);
|
||||||
void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
|
void dss_recheck_connections(struct omap_dss_device *dssdev, bool force);
|
||||||
|
int dss_ovl_simple_check(struct omap_overlay *ovl,
|
||||||
|
const struct omap_overlay_info *info);
|
||||||
int dss_ovl_check(struct omap_overlay *ovl,
|
int dss_ovl_check(struct omap_overlay *ovl,
|
||||||
struct omap_overlay_info *info, struct omap_dss_device *dssdev);
|
struct omap_overlay_info *info, struct omap_dss_device *dssdev);
|
||||||
|
|
||||||
|
|
|
@ -592,6 +592,25 @@ struct omap_overlay_manager *omap_dss_get_overlay_manager(int num)
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(omap_dss_get_overlay_manager);
|
EXPORT_SYMBOL(omap_dss_get_overlay_manager);
|
||||||
|
|
||||||
|
int dss_mgr_simple_check(struct omap_overlay_manager *mgr,
|
||||||
|
const struct omap_overlay_manager_info *info)
|
||||||
|
{
|
||||||
|
if (dss_has_feature(FEAT_ALPHA_FIXED_ZORDER)) {
|
||||||
|
/*
|
||||||
|
* OMAP3 supports only graphics source transparency color key
|
||||||
|
* and alpha blending simultaneously. See TRM 15.4.2.4.2.2
|
||||||
|
* Alpha Mode.
|
||||||
|
*/
|
||||||
|
if (info->partial_alpha_enabled && info->trans_enabled
|
||||||
|
&& info->trans_key_type != OMAP_DSS_COLOR_KEY_GFX_DST) {
|
||||||
|
DSSERR("check_manager: illegal transparency key\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr,
|
static int dss_mgr_check_zorder(struct omap_overlay_manager *mgr,
|
||||||
struct omap_overlay_info **overlay_infos)
|
struct omap_overlay_info **overlay_infos)
|
||||||
{
|
{
|
||||||
|
|
|
@ -595,6 +595,42 @@ void dss_uninit_overlays(struct platform_device *pdev)
|
||||||
num_overlays = 0;
|
num_overlays = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int dss_ovl_simple_check(struct omap_overlay *ovl,
|
||||||
|
const struct omap_overlay_info *info)
|
||||||
|
{
|
||||||
|
if (info->paddr == 0) {
|
||||||
|
DSSERR("check_overlay: paddr cannot be 0\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
|
||||||
|
if (info->out_width != 0 && info->width != info->out_width) {
|
||||||
|
DSSERR("check_overlay: overlay %d doesn't support "
|
||||||
|
"scaling\n", ovl->id);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info->out_height != 0 && info->height != info->out_height) {
|
||||||
|
DSSERR("check_overlay: overlay %d doesn't support "
|
||||||
|
"scaling\n", ovl->id);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((ovl->supported_modes & info->color_mode) == 0) {
|
||||||
|
DSSERR("check_overlay: overlay %d doesn't support mode %d\n",
|
||||||
|
ovl->id, info->color_mode);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (info->zorder >= omap_dss_get_num_overlays()) {
|
||||||
|
DSSERR("check_overlay: zorder %d too high\n", info->zorder);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int dss_ovl_check(struct omap_overlay *ovl,
|
int dss_ovl_check(struct omap_overlay *ovl,
|
||||||
struct omap_overlay_info *info, struct omap_dss_device *dssdev)
|
struct omap_overlay_info *info, struct omap_dss_device *dssdev)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue