From f8a310e13b18b5cc4cc0863a045d1ed48829d1d8 Mon Sep 17 00:00:00 2001 From: Imre Deak Date: Tue, 29 Aug 2006 16:58:55 +0300 Subject: [PATCH] ARM: OMAP: DISPC scale down in one direction - Fix the DISPC setup when scaling down only in one direction. - Check the plane setup IOCTL parameters. Signed-off-by: Imre Deak Signed-off-by: Juha Yrjola --- drivers/video/omap/dispc.c | 4 ++-- drivers/video/omap/omapfb_main.c | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/video/omap/dispc.c b/drivers/video/omap/dispc.c index 09e798807ec..c7bd1e0c73c 100644 --- a/drivers/video/omap/dispc.c +++ b/drivers/video/omap/dispc.c @@ -394,10 +394,10 @@ static inline int _setup_plane(int plane, int channel_out, if (set_vsize) { /* Set video size if set_scale hasn't set it */ - if (!dispc.fir_hinc[plane]) + if (!dispc.fir_vinc[plane]) MOD_REG_FLD(vs_reg[plane], FLD_MASK(16, 11), (height - 1) << 16); - if (!dispc.fir_vinc[plane]) + if (!dispc.fir_hinc[plane]) MOD_REG_FLD(vs_reg[plane], FLD_MASK(0, 11), width - 1); } diff --git a/drivers/video/omap/omapfb_main.c b/drivers/video/omap/omapfb_main.c index 29440b0444e..731b0575595 100644 --- a/drivers/video/omap/omapfb_main.c +++ b/drivers/video/omap/omapfb_main.c @@ -692,8 +692,13 @@ static int omapfb_setup_plane(struct fb_info *fbi, struct omapfb_plane_info *pi) { struct omapfb_plane_struct *plane = fbi->par; struct omapfb_device *fbdev = plane->fbdev; + struct lcd_panel *panel = fbdev->panel; int r; + if (pi->pos_x + pi->out_width > panel->x_res || + pi->pos_y + pi->out_height > panel->y_res) + return -EINVAL; + plane->info = *pi; r = ctrl_change_mode(fbi); if (r < 0) -- 2.41.1