aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2013-11-12 05:21:46 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2013-12-30 09:14:15 -0500
commit7a53df2c08119c1a7008d8480205fb3e6859c721 (patch)
treed0cf7d5306e660404fa5b95ce170fcfdde662819 /drivers/video/omap2
parentac9f24211e4cf9cc30122a7e0d830eba2cace14b (diff)
OMAPDSS: apply fixes
When omapfb does ovl->get_overlay_info, ovl->set_overlay_info, the set function may fail even if the info has not been changed. This is because omapdss doesn't initialize the info, but expect the caller to set valid values. Normally that is the case, but there is at least one corner case: if omapfb has not allocated memory for the overlay yet, and the user uses ioctl to disable the overlay to make sure it's disabled. In this case get_overlay_info returns invalid data, but the user is only interested in setting the overlay to disabled, not configuring it, and set_overlay_info fails. The issue is made possible by the omapfb's setup_plane ioctl, which groups overlay configuration and overlay enable/disable bit into the same struct. Thus, when you are disabling an overlay, you are also configuring it. This is a bit counter intuitive, so I think it's better to initialize the info to some valid values. The fields requiring initialization are color_mode and rotation_type, and also we need to remove the check for (paddr == 0), as paddr is 0 for unallocated overlay (but it's still fine to disable the overlay). Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/apply.c3
-rw-r--r--drivers/video/omap2/dss/overlay.c5
2 files changed, 3 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/apply.c b/drivers/video/omap2/dss/apply.c
index 24cd7c248504..0a0b084ce65d 100644
--- a/drivers/video/omap2/dss/apply.c
+++ b/drivers/video/omap2/dss/apply.c
@@ -149,6 +149,9 @@ static void apply_init_priv(void)
149 149
150 op = &dss_data.ovl_priv_data_array[i]; 150 op = &dss_data.ovl_priv_data_array[i];
151 151
152 op->info.color_mode = OMAP_DSS_COLOR_RGB16;
153 op->info.rotation_type = OMAP_DSS_ROT_DMA;
154
152 op->info.global_alpha = 255; 155 op->info.global_alpha = 255;
153 156
154 switch (i) { 157 switch (i) {
diff --git a/drivers/video/omap2/dss/overlay.c b/drivers/video/omap2/dss/overlay.c
index eccde322c28a..2f7cee985cdd 100644
--- a/drivers/video/omap2/dss/overlay.c
+++ b/drivers/video/omap2/dss/overlay.c
@@ -113,11 +113,6 @@ void dss_uninit_overlays(struct platform_device *pdev)
113int dss_ovl_simple_check(struct omap_overlay *ovl, 113int dss_ovl_simple_check(struct omap_overlay *ovl,
114 const struct omap_overlay_info *info) 114 const struct omap_overlay_info *info)
115{ 115{
116 if (info->paddr == 0) {
117 DSSERR("check_overlay: paddr cannot be 0\n");
118 return -EINVAL;
119 }
120
121 if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) { 116 if ((ovl->caps & OMAP_DSS_OVL_CAP_SCALE) == 0) {
122 if (info->out_width != 0 && info->width != info->out_width) { 117 if (info->out_width != 0 && info->width != info->out_width) {
123 DSSERR("check_overlay: overlay %d doesn't support " 118 DSSERR("check_overlay: overlay %d doesn't support "