]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/commitdiff
ARM: OMAP: DISPC scale down in one direction
authorImre Deak <imre.deak@solidboot.com>
Tue, 29 Aug 2006 13:58:55 +0000 (16:58 +0300)
committerJuha Yrjola <juha.yrjola@solidboot.com>
Tue, 29 Aug 2006 15:12:08 +0000 (18:12 +0300)
- Fix the DISPC setup when scaling down only in one direction.
- Check the plane setup IOCTL parameters.

Signed-off-by: Imre Deak <imre.deak@solidboot.com>
Signed-off-by: Juha Yrjola <juha.yrjola@solidboot.com>
drivers/video/omap/dispc.c
drivers/video/omap/omapfb_main.c

index 09e798807ec2c0e5f3414bb6fac001325a93ebc5..c7bd1e0c73cb1cfe9df0c3c51d7de7876e45a737 100644 (file)
@@ -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);
        }
index 29440b0444eda3fbe0ddb8b670f077381c69073e..731b0575595654a4cd9c77d715cb54d38d60a29b 100644 (file)
@@ -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)