MLK-16353-5 Revert "MLK-16255-4 video: fbdev: dcss: add alignment handling for SCALER"
authorFancy Fang <chen.fang@nxp.com>
Mon, 4 Sep 2017 07:48:06 +0000 (15:48 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:27 +0000 (15:38 -0500)
Since early patch has added alignment check for SCALER,
so there is no need to do alignment calculations in the
'dcss_scaler_config()' for width and height. So revert
it.

This reverts commit 6f22641b84ac9aaabc2d7f74bf2ee1029c497318.

drivers/video/fbdev/mxc/imx_dcss.c

index 96b79b2..0ac259b 100644 (file)
@@ -1540,7 +1540,6 @@ static int dcss_scaler_config(uint32_t scaler_ch, struct dcss_info *info)
        struct dcss_pixmap *input;
        struct cbuffer *cb;
        int scale_v_luma_inc, scale_h_luma_inc;
-       uint32_t aligned_width, aligned_height;
        const struct fb_videomode *dmode = info->dft_disp_mode;
 
        if (scaler_ch > 2) {
@@ -1813,26 +1812,23 @@ static int dcss_scaler_config(uint32_t scaler_ch, struct dcss_info *info)
        fill_sb(cb, chan_info->scaler_addr + 0x14, 0x2);
 
        /* Scaler Input Luma Resolution
-        * Alighment: WIDTH and HEIGHT divisable by 4.
+        * TODO: Alighment: WIDTH and HEIGHT divisable by 4.
         */
-       aligned_width  = ALIGN(input->width, 4);
-       aligned_height = ALIGN(input->height, 4);
        fill_sb(cb, chan_info->scaler_addr + 0x18,
-               (aligned_height - 1) << 16 | (aligned_width - 1));
+               (input->height - 1) << 16 | (input->width - 1));
 
        /* Scaler Input Chroma Resolution */
        switch (fmt_is_yuv(input->format)) {
        case 0:         /* ARGB8888 */
                fill_sb(cb, chan_info->scaler_addr + 0x1c,
-                       (aligned_height - 1) << 16 |
-                       (aligned_width - 1));
+                       (input->height - 1) << 16 | (input->width - 1));
                break;
        case 1:         /* TODO: YUV422 or YUV444 */
                break;
        case 2:         /* YUV420 */
                fill_sb(cb, chan_info->scaler_addr + 0x1c,
-                       ((aligned_height >> 1) - 1) << 16 |
-                       ((aligned_width >> 1) - 1));
+                       ((input->height >> 1) - 1) << 16 |
+                       ((input->width >> 1) - 1));
                break;
        default:
                return -EINVAL;
@@ -1861,9 +1857,9 @@ static int dcss_scaler_config(uint32_t scaler_ch, struct dcss_info *info)
 
        /* scale ratio: ###.#_####_####_#### */
        /* vertical ratio */
-       scale_v_luma_inc = ((aligned_height << 13) + (dmode->yres >> 1)) / dmode->yres;
+       scale_v_luma_inc = ((input->height << 13) + (dmode->yres >> 1)) / dmode->yres;
        /* horizontal ratio */
-       scale_h_luma_inc = ((aligned_width << 13) + (dmode->xres >> 1)) / dmode->xres;
+       scale_h_luma_inc = ((input->width << 13) + (dmode->xres >> 1)) / dmode->xres;
 
        fill_sb(cb, chan_info->scaler_addr + 0x48, 0x0);
        fill_sb(cb, chan_info->scaler_addr + 0x4c, scale_v_luma_inc);