From 1c082257384535fbc1ceede7466d5e7e50a03f60 Mon Sep 17 00:00:00 2001 From: Laurentiu Palcu Date: Wed, 17 Oct 2018 11:28:36 +0300 Subject: [PATCH] MLK-19689 drm/imx/dcss: Fix scaler freeze on channel-0 For channel 0 if 1920x1080@NV12 was used when setting a mode would freeze the scaler. That's because the chroma vertical size was set to 540 (1920 / 2) instead of 544 (which is divisible to 8). This patch makes sure we round up the chroma vertical size for channel-0 properly. Signed-off-by: Laurentiu Palcu --- drivers/gpu/imx/dcss/dcss-dpr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/imx/dcss/dcss-dpr.c b/drivers/gpu/imx/dcss/dcss-dpr.c index bfff87b539b4..f43089167520 100644 --- a/drivers/gpu/imx/dcss/dcss-dpr.c +++ b/drivers/gpu/imx/dcss/dcss-dpr.c @@ -340,6 +340,7 @@ void dcss_dpr_set_res(struct dcss_soc *dcss, int ch_num, u32 xres, u32 yres, for (plane = 0; plane < max_planes; plane++) { yres = plane == 1 ? yres >> 1 : yres; + adj_h = plane == 1 ? adj_h >> 1 : adj_h; pix_x_wide = dcss_dpr_x_pix_wide_adjust(ch, xres, pix_format); pix_y_high = dcss_dpr_y_pix_high_adjust(ch, yres, pix_format); @@ -348,8 +349,8 @@ void dcss_dpr_set_res(struct dcss_soc *dcss, int ch_num, u32 xres, u32 yres, if (pix_x_wide < adj_w) pix_x_wide = adj_w; - if (pix_y_high != adj_h) - pix_y_high = plane == 0 ? adj_h : adj_h >> 1; + if (pix_y_high < adj_h) + pix_y_high = adj_h; if (plane == 0) ch->pitch = pix_x_wide; -- 2.17.1