From 8b66f9e2ca0f5b8068dadfecfb43c8d48c33aeaf Mon Sep 17 00:00:00 2001 From: Tomi Valkeinen Date: Thu, 17 Nov 2011 14:26:48 +0200 Subject: [PATCH] --- yaml --- r: 284956 b: refs/heads/master c: fcc764dca80ead39b7391ff2c67a6b78de16d7a9 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/drivers/video/omap2/dss/apply.c | 40 +++++++++++++++++++++++++++ 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index 0097fb2dce7e..ce13e1b7453f 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 9d11c321a84266db2dba82cfb0d9d3bc17c326a8 +refs/heads/master: fcc764dca80ead39b7391ff2c67a6b78de16d7a9 diff --git a/trunk/drivers/video/omap2/dss/apply.c b/trunk/drivers/video/omap2/dss/apply.c index 4cc7c37acbb4..dccddd264436 100644 --- a/trunk/drivers/video/omap2/dss/apply.c +++ b/trunk/drivers/video/omap2/dss/apply.c @@ -928,12 +928,52 @@ int dss_mgr_unset_device(struct omap_overlay_manager *mgr) } +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, struct omap_overlay_info *info) { struct ovl_priv_data *op = get_ovl_priv(ovl); unsigned long flags; + int r; + + r = dss_ovl_simple_check(ovl, info); + if (r) + return r; spin_lock_irqsave(&data_lock, flags);