fbdev: dpu20: sync-up dpu common code
authorChiHun Won <chihun.won@samsung.com>
Wed, 4 Jul 2018 06:10:34 +0000 (15:10 +0900)
committerWooyeon Kim <wooy88.kim@samsung.com>
Fri, 6 Jul 2018 01:43:20 +0000 (10:43 +0900)
Change-Id: Ifa434bd0a2d91bbf1d5cea3fbbd092ae4a8368c9
Signed-off-by: ChiHun Won <chihun.won@samsung.com>
12 files changed:
drivers/video/fbdev/exynos/dpu20/Kconfig
drivers/video/fbdev/exynos/dpu20/Makefile
drivers/video/fbdev/exynos/dpu20/decon.h
drivers/video/fbdev/exynos/dpu20/decon_core.c
drivers/video/fbdev/exynos/dpu20/decon_dsi.c
drivers/video/fbdev/exynos/dpu20/dpp_drv.c
drivers/video/fbdev/exynos/dpu20/dsim.h
drivers/video/fbdev/exynos/dpu20/dsim_drv.c
drivers/video/fbdev/exynos/dpu20/event_log.c
drivers/video/fbdev/exynos/dpu20/hdr_metadata.h
drivers/video/fbdev/exynos/dpu20/helper.c
drivers/video/fbdev/exynos/dpu20/win_update.c

index 1d046d1c48b3545d68fe6e4a20dae270890dcf7b..1866591394754a8cf9a16e1809ebaad6ec8362a8 100644 (file)
@@ -51,7 +51,7 @@ config EXYNOS_AFBC_DEBUG
 config EXYNOS_MULTIRESOLUTION
        bool "Support Multi Resolution LCD"
        depends on EXYNOS_DPU20 && EXYNOS_WINDOW_UPDATE
-       default y
+       default n
 
 config EXYNOS_VIRTUAL_DISPLAY
        bool "Support Virtual Display Mode"
index 91bbeec38e64f407972d77b0a3c4420840295cbb..09551b716a3b6a44bf93c4e8d1b1b03ec960c892 100644 (file)
@@ -9,9 +9,12 @@ obj-$(CONFIG_EXYNOS_DPP) += dpp.o
 dpp-y := dpp_drv.o
 obj-$(CONFIG_EXYNOS_MIPI_DSIM) += dsim.o
 dsim-y += dsim_drv.o
-obj-$(CONFIG_EXYNOS_DISPLAYPORT) += displayport.o
-displayport-y += displayport_drv.o displayport_edid.o displayport_hdcp13.o ./cal_9610/displayport_reg.o
 obj-$(CONFIG_SOC_EXYNOS9610) += ./cal_9610/dsim_reg.o ./cal_9610/dpp_reg.o ./cal_9610/decon_reg.o
+ifdef CONFIG_EXYNOS_DISPLAYPORT
+obj-$(CONFIG_EXYNOS_DISPLAYPORT) += displayport.o
+displayport-y += displayport_drv.o displayport_edid.o displayport_hdcp13.o decon_displayport.o
+obj-$(CONFIG_SOC_EXYNOS9610) += ./cal_9610/displayport_reg.o
+endif
 obj-$(CONFIG_EXYNOS_DPU20) += decon.o
 obj-$(CONFIG_EXYNOS_BTS) += bts.o
 decon-y += decon_core.o decon_dsi.o decon_wb.o helper.o win_update.o cursor.o fence.o event_log.o
index 606ed83a04c02fd44fc7a4798eb9b209f593d405..a208d4b70cce09cf0a98ab8b768b23292644276f 100644 (file)
@@ -49,7 +49,9 @@
 
 #include "./panels/decon_lcd.h"
 #include "dsim.h"
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
 #include "displayport.h"
+#endif
 #if defined(CONFIG_SUPPORT_LEGACY_FENCE)
 #include "../../../../dma-buf/sync_debug.h"
 #endif
@@ -80,8 +82,6 @@ extern struct decon_bts_ops decon_bts_control;
 #define MIN_BLK_MODE_HEIGHT    16
 #define VSYNC_TIMEOUT_MSEC     200
 #define DEFAULT_BPP            32
-#define MIN_WIN_BLOCK_WIDTH    8
-#define MIN_WIN_BLOCK_HEIGHT   1
 #define FD_TRY_CNT             3
 #define VALID_FD_VAL           3
 #define DECON_TRACE_BUF_SIZE   40
@@ -582,7 +582,9 @@ struct disp_log_dpp {
        u32 id;
        u32 start_cnt;
        u32 done_cnt;
-       u32 comp_src;
+       u32 comp;
+       u32 rot;
+       u32 hdr_std;
        struct decon_frame src;
        struct decon_frame dst;
 };
@@ -1038,6 +1040,7 @@ int decon_wb_get_clocks(struct decon_device *decon);
 void decon_wb_set_clocks(struct decon_device *decon);
 int decon_wb_get_out_sd(struct decon_device *decon);
 
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
 /* DECON to DISPLAYPORT interface functions */
 int decon_displayport_register_irq(struct decon_device *decon);
 void decon_displayport_free_irq(struct decon_device *decon);
@@ -1052,6 +1055,7 @@ int decon_displayport_get_config(struct decon_device *dex,
                struct exynos_displayport_data *displayport_data);
 int decon_displayport_set_config(struct decon_device *dex,
                struct exynos_displayport_data *displayport_data);
+#endif
 
 /* window update related function */
 #define DPU_FULL_RECT(r, lcd)                  \
index d3000910cc38bf56e79efca2b4d41f978cba6016..16f2875bd50f64cdc66d88960c2bcf7ed7e1975a 100644 (file)
@@ -53,7 +53,9 @@
 #include "./panels/lcd_ctrl.h"
 #include "../../../../dma-buf/sync_debug.h"
 #include "dpp.h"
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
 #include "displayport.h"
+#endif
 
 int decon_log_level = 6;
 module_param(decon_log_level, int, 0644);
@@ -1250,7 +1252,9 @@ static int decon_import_buffer(struct decon_device *decon, int idx,
 #endif
        struct dma_buf *buf = NULL;
        struct decon_dma_buf_data *dma_buf_data = NULL;
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
        struct displayport_device *displayport;
+#endif
        struct dsim_device *dsim;
        struct device *dev;
        int i;
@@ -1284,8 +1288,10 @@ static int decon_import_buffer(struct decon_device *decon, int idx,
                        return PTR_ERR(buf);
                }
                if (decon->dt.out_type == DECON_OUT_DP) {
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
                        displayport = v4l2_get_subdevdata(decon->out_sd[0]);
                        dev = displayport->dev;
+#endif
                } else { /* DSI case */
                        dsim = v4l2_get_subdevdata(decon->out_sd[0]);
                        dev = dsim->dev;
@@ -1716,6 +1722,10 @@ static int __decon_update_regs(struct decon_device *decon, struct decon_reg_data
                return 0;
        }
 
+#if defined(CONFIG_EXYNOS_CONTENT_PATH_PROTECTION)
+       decon_set_protected_content(decon, regs);
+#endif
+
        for (i = 0; i < decon->dt.max_win; i++) {
                if (regs->is_cursor_win[i]) {
                        dpu_cursor_win_update_config(decon, regs);
@@ -1742,10 +1752,6 @@ static int __decon_update_regs(struct decon_device *decon, struct decon_reg_data
                decon_reg_config_wb_size(decon->id, decon->lcd_info, &p);
        }
 
-#if defined(CONFIG_EXYNOS_CONTENT_PATH_PROTECTION)
-       decon_set_protected_content(decon, regs);
-#endif
-
        decon_reg_all_win_shadow_update_req(decon->id);
        decon_to_psr_info(decon, &psr);
        if (decon_reg_start(decon->id, &psr) < 0) {
@@ -1852,7 +1858,10 @@ static int decon_set_hdr_info(struct decon_device *decon,
                struct decon_reg_data *regs, int win_num, bool on)
 {
        struct exynos_video_meta *video_meta;
-       int ret = 0, hdr_cmp = 0;
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
+       int ret = 0;
+#endif
+       int hdr_cmp = 0;
        int meta_plane = 0;
 
        if (!on) {
@@ -1860,12 +1869,13 @@ static int decon_set_hdr_info(struct decon_device *decon,
 
                hdr_static_info.mid = -1;
                decon->prev_hdr_info.mid = -1;
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
                ret = v4l2_subdev_call(decon->displayport_sd, core, ioctl,
                                DISPLAYPORT_IOC_SET_HDR_METADATA,
                                &hdr_static_info);
                if (ret)
                        goto err_hdr_io;
-
+#endif
                return 0;
        }
 
@@ -1889,7 +1899,7 @@ static int decon_set_hdr_info(struct decon_device *decon,
 #endif
 
        hdr_cmp = memcmp(&decon->prev_hdr_info,
-                       &video_meta->data.dec.shdr_static_info,
+                       &video_meta->shdr_static_info,
                        sizeof(struct exynos_hdr_static_info));
 
        /* HDR metadata is same, so skip subdev call.
@@ -1901,22 +1911,24 @@ static int decon_set_hdr_info(struct decon_device *decon,
 #endif
                return 0;
        }
-
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
        ret = v4l2_subdev_call(decon->displayport_sd, core, ioctl,
                        DISPLAYPORT_IOC_SET_HDR_METADATA,
-                       &video_meta->data.dec.shdr_static_info);
+                       &video_meta->shdr_static_info);
        if (ret)
                goto err_hdr_io;
-
+#endif
        memcpy(&decon->prev_hdr_info,
-                       &video_meta->data.dec.shdr_static_info,
+                       &video_meta->shdr_static_info,
                        sizeof(struct exynos_hdr_static_info));
 #if !defined(CONFIG_SUPPORT_LEGACY_ION)
        dma_buf_vunmap(regs->dma_buf_data[win_num][meta_plane].dma_buf, video_meta);
 #endif
        return 0;
 
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
 err_hdr_io:
+#endif
        /* When the subdev call is failed,
         * current hdr_static_info is not copied to prev.
         */
@@ -2314,7 +2326,7 @@ static int decon_prepare_win_config(struct decon_device *decon,
                                &win_config[decon->dt.max_win], regs);
        }
 
-       for (i = 0; i < decon->dt.dpp_cnt; i++) {
+       for (i = 0; i < (decon->dt.dpp_cnt + 1); i++) {
                memcpy(&regs->dpp_config[i], &win_config[i],
                                sizeof(struct decon_win_config));
                regs->dpp_config[i].format =
@@ -2961,6 +2973,8 @@ static int decon_register_subdevs(struct decon_device *decon)
        else if (decon->dt.out_type == DECON_OUT_DP)
                ret = decon_displayport_get_out_sd(decon);
 #endif
+       else
+               ret = -ENODEV;
 
        return ret;
 }
@@ -3529,7 +3543,7 @@ static int decon_itmon_notifier(struct notifier_block *nb,
 static int decon_initial_display(struct decon_device *decon, bool is_colormap)
 {
        struct decon_param p;
-       struct fb_info *fbinfo = decon->win[decon->dt.dft_win]->fbinfo;
+       struct fb_info *fbinfo;
        struct decon_window_regs win_regs;
        struct decon_win_config config;
        struct v4l2_subdev *sd = NULL;
@@ -3545,6 +3559,8 @@ static int decon_initial_display(struct decon_device *decon, bool is_colormap)
                return 0;
        }
 
+       fbinfo = decon->win[decon->dt.dft_win]->fbinfo;
+
        pm_stay_awake(decon->dev);
        dev_warn(decon->dev, "pm_stay_awake");
 
index f141ddc7ac1875184718929bdc502510944c06c3..ad572985449e42a3f53d060a722f1e39c56e65f6 100644 (file)
@@ -400,6 +400,12 @@ static ssize_t decon_show_psr_info(struct device *dev,
        char *p = buf;
        struct lcd_mres_info *mres_info = &lcd_info->dt_lcd_mres;
        int len;
+       struct v4l2_subdev *sd;
+       struct dpp_restriction res;
+       int sz_align = 1;
+
+       sd = decon->dpp_sd[0];
+       v4l2_subdev_call(sd, core, ioctl, DPP_GET_RESTRICTION, &res);
 
        len = sprintf(p, "%d\n", decon->dt.psr_mode);
        len += sprintf(p + len, "%d\n", mres_info->mres_number);
@@ -415,8 +421,8 @@ static ssize_t decon_show_psr_info(struct device *dev,
                        len += sprintf(p + len, "%d\n%d\n%d\n%d\n%d\n",
                                mres_info->res_info[i].width,
                                mres_info->res_info[i].height,
-                               MIN_WIN_BLOCK_WIDTH,
-                               MIN_WIN_BLOCK_HEIGHT,
+                               (res.src_f_w.min * sz_align),
+                               (res.src_f_h.min * sz_align),
                                mres_info->res_info[i].dsc_en);
        }
        return len;
index 3400c34c614774242a0c495730b7e2f0bed94434..70a792d4200ff31363bb4a61fa5b71c7fc607678 100644 (file)
@@ -94,6 +94,8 @@ static void dpp_get_params(struct dpp_device *dpp, struct dpp_params_info *p)
        p->addr[3] = 0;
        p->eq_mode = config->dpp_parm.eq_mode;
        p->hdr = config->dpp_parm.hdr_std;
+       p->max_luminance = config->dpp_parm.max_luminance;
+       p->min_luminance = config->dpp_parm.min_luminance;
        p->is_4p = false;
        p->y_2b_strd = 0;
        p->c_2b_strd = 0;
index 6e1c0e63d0ac4adffb183cf8071b6e5c599ae358..e456974b9270e70f27a12edd3847de5f2929f4a2 100644 (file)
@@ -196,7 +196,7 @@ struct dsim_resources {
        struct clk *rgb_vclk0;
        struct clk *pclk_disp;
        struct clk *aclk;
-       int lcd_power[2];
+       int lcd_power[3];
        int lcd_reset;
        int irq;
        void __iomem *regs;
index ef5f28c950e3f8b8337db979baf111b5132f56d8..0f2b46f0ababc5ec0ef1fbe3f0806e4275222ab3 100644 (file)
@@ -326,6 +326,7 @@ int dsim_read_data(struct dsim_device *dsim, u32 id, u32 addr, u32 cnt, u8 *buf)
                        dsim_dbg("Short Packet was received from LCD module.\n");
                        for (i = 0; i <= cnt; i++)
                                buf[i] = (rx_fifo >> (8 + i * 8)) & 0xff;
+                       rx_size = cnt;
                        break;
                case MIPI_DSI_RX_DCS_LONG_READ_RESPONSE:
                case MIPI_DSI_RX_GENERIC_LONG_READ_RESPONSE:
@@ -550,6 +551,11 @@ static int dsim_get_gpios(struct dsim_device *dsim)
                        res->lcd_power[1] = -1;
                        dsim_info("This board doesn't support 2nd LCD power GPIO");
                }
+               res->lcd_power[2] = of_get_gpio(dev->of_node, 3);
+               if (res->lcd_power[2] < 0) {
+                       res->lcd_power[2] = -1;
+                       dsim_info("This board doesn't support 3rd LCD power GPIO");
+               }
        }
 
        dsim_info("%s -\n", __func__);
@@ -644,6 +650,16 @@ int dsim_set_panel_power(struct dsim_device *dsim, bool on)
                        gpio_free(res->lcd_power[1]);
                        usleep_range(10000, 11000);
                }
+               if (res->lcd_power[2] > 0) {
+                       ret = gpio_request_one(res->lcd_power[2],
+                                       GPIOF_OUT_INIT_HIGH, "lcd_power2");
+                       if (ret < 0) {
+                               dsim_err("failed 3rd LCD power on\n");
+                               return -EINVAL;
+                       }
+                       gpio_free(res->lcd_power[2]);
+                       usleep_range(10000, 11000);
+               }
                if (res->regulator_1p8v > 0) {
                        ret = regulator_enable(res->regulator_1p8v);
                        if (ret) {
@@ -690,6 +706,16 @@ int dsim_set_panel_power(struct dsim_device *dsim, bool on)
                        gpio_free(res->lcd_power[1]);
                        usleep_range(5000, 6000);
                }
+               if (res->lcd_power[2] > 0) {
+                       ret = gpio_request_one(res->lcd_power[2],
+                                       GPIOF_OUT_INIT_LOW, "lcd_power2");
+                       if (ret < 0) {
+                               dsim_err("failed 3nd LCD power off\n");
+                               return -EINVAL;
+                       }
+                       gpio_free(res->lcd_power[2]);
+                       usleep_range(5000, 6000);
+               }
                if (res->regulator_1p8v > 0) {
                        ret = regulator_disable(res->regulator_1p8v);
                        if (ret) {
index e194c25858e828041a512458e348104c2954312a..56cb1c92b1cfd8e90fd6bd50adf98bcdf1b24123 100644 (file)
@@ -178,6 +178,9 @@ static inline void dpu_event_log_dpp
                break;
        case DPU_EVT_DPP_WINCON:
                log->data.dpp.id = dpp->id;
+               log->data.dpp.comp = dpp->dpp_config->config.compression;
+               log->data.dpp.rot = dpp->dpp_config->config.dpp_parm.rot;
+               log->data.dpp.hdr_std = dpp->dpp_config->config.dpp_parm.hdr_std;
                memcpy(&log->data.dpp.src, &dpp->dpp_config->config.src, sizeof(struct decon_frame));
                memcpy(&log->data.dpp.dst, &dpp->dpp_config->config.dst, sizeof(struct decon_frame));
                break;
@@ -597,10 +600,11 @@ void DPU_EVENT_SHOW(struct seq_file *s, struct decon_device *decon)
                        break;
                case DPU_EVT_DPP_WINCON:
                        seq_printf(s, "%20s  ", "DPP_WINCON");
-                       seq_printf(s, "ID:%d, start= %d, done= %d\n",
+                       seq_printf(s, "ID:%d, comp= %d, rot= %d, hdr= %d\n",
                                        log->data.dpp.id,
-                                       log->data.dpp.start_cnt,
-                                       log->data.dpp.done_cnt);
+                                       log->data.dpp.comp,
+                                       log->data.dpp.rot,
+                                       log->data.dpp.hdr_std);
                        break;
                case DPU_EVT_DPP_FRAMEDONE:
                        seq_printf(s, "%20s  ", "DPP_FRAMEDONE");
index 1c82f9ff42d23e27b3f74d97e25efc713e431aa4..fa3c1698ef1c87cc3cfb6942a453587af18abba1 100644 (file)
@@ -58,20 +58,18 @@ struct exynos_hdr_static_info {
 };
 
 struct exynos_video_dec_data {
-       struct exynos_hdr_static_info shdr_static_info;
-       struct exynos_color_aspects scolor_aspects;
        int ninterlaced_type;
 };
 
 struct exynos_video_enc_data {
-       struct exynos_hdr_static_info shdr_static_info;
-       struct exynos_color_aspects scolor_aspects;
        struct exynos_video_ysum_data sysum_data;
 };
 
 struct exynos_video_meta {
        enum exynos_video_info_type etype;
-
+       /* common */
+       struct exynos_hdr_static_info   shdr_static_info;
+       struct exynos_color_aspects     scolor_aspects;
        union {
                struct exynos_video_dec_data dec;
                struct exynos_video_enc_data enc;
index 21e42c1807124be03c14282ee66d18729ed22db0..5405128cffdc47d29ee79d0e0cae5921c8e2ff1b 100644 (file)
@@ -24,7 +24,9 @@
 #include "decon.h"
 #include "dsim.h"
 #include "dpp.h"
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
 #include "displayport.h"
+#endif
 #include "./panels/lcd_ctrl.h"
 #include <video/mipi_display.h>
 
@@ -32,7 +34,9 @@ static int __dpu_match_dev(struct device *dev, void *data)
 {
        struct dpp_device *dpp;
        struct dsim_device *dsim;
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
        struct displayport_device *displayport;
+#endif
        struct decon_device *decon = (struct decon_device *)data;
 
        decon_dbg("%s: drvname(%s)\n", __func__, dev->driver->name);
@@ -46,10 +50,12 @@ static int __dpu_match_dev(struct device *dev, void *data)
                dsim = (struct dsim_device *)dev_get_drvdata(dev);
                decon->dsim_sd[dsim->id] = &dsim->sd;
                decon_dbg("dsim sd name(%s)\n", dsim->sd.name);
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
        } else if (!strcmp(DISPLAYPORT_MODULE_NAME, dev->driver->name)) {
                displayport = (struct displayport_device *)dev_get_drvdata(dev);
                decon->displayport_sd = &displayport->sd;
                decon_dbg("displayport sd name(%s)\n", displayport->sd.name);
+#endif
        } else {
                decon_err("failed to get driver name\n");
        }
@@ -680,8 +686,10 @@ int dpu_sysmmu_fault_handler(struct iommu_domain *domain,
 
        if (!strcmp(DSIM_MODULE_NAME, dev->driver->name)) {
                decon = get_decon_drvdata(0);
+#if defined(CONFIG_EXYNOS_DISPLAYPORT)
        } else if (!strcmp(DISPLAYPORT_MODULE_NAME, dev->driver->name)) {
                decon = get_decon_drvdata(2);
+#endif
        } else {
                decon_err("unknown driver for dpu sysmmu falut handler(%s)\n",
                                dev->driver->name);
index a144bda6d5855b5049fa00ebef66be3105a209a7..f004d8864a57558da0814f1e1bf3d109b5db2cc5 100644 (file)
@@ -25,6 +25,10 @@ static void win_update_adjust_region(struct decon_device *decon,
        struct decon_win_config *update_config = &win_config[DECON_WIN_UPDATE_IDX];
        struct decon_win_config *config;
        struct decon_frame adj_region;
+       struct v4l2_subdev *sd;
+       struct dpp_restriction res;
+       u32 min_src_w, min_src_h;
+       int sz_align = 1;
 
        regs->need_update = false;
        DPU_FULL_RECT(&regs->up_region, decon->lcd_info);
@@ -71,8 +75,28 @@ static void win_update_adjust_region(struct decon_device *decon,
        r2.bottom = div_h * decon->win_up.rect_h - 1;
 
        /* TODO: Now, 4 slices must be used. This will be modified */
-       r2.left = 0;
-       r2.right = decon->lcd_info->xres - 1;
+       if (decon->lcd_info->dsc_enabled) {
+               r2.left = 0;
+               r2.right = decon->lcd_info->xres - 1;
+       } else {
+               sd = decon->dpp_sd[0];
+               v4l2_subdev_call(sd, core, ioctl, DPP_GET_RESTRICTION, &res);
+
+               min_src_w = res.src_f_w.min * sz_align;
+               min_src_h = res.src_f_h.min * sz_align;
+
+               if (decon->lcd_info->xres - r2.left < min_src_w)
+                       r2.left = ((r1.left - min_src_w) / decon->win_up.rect_w) *
+                       decon->win_up.rect_w;
+               if (decon->lcd_info->yres - r2.top < min_src_h)
+                       r2.top = ((r1.top - min_src_h) / decon->win_up.rect_h) *
+                       decon->win_up.rect_h;
+
+               if (decon->lcd_info->xres < r2.right)
+                       r2.right = decon->lcd_info->xres - 1;
+               if (decon->lcd_info->yres < r2.bottom)
+                       r2.bottom = decon->lcd_info->yres - 1;
+       }
 
        memcpy(&regs->up_region, &r2, sizeof(struct decon_rect));
 
@@ -562,6 +586,9 @@ void dpu_set_win_update_partial_size(struct decon_device *decon,
 void dpu_init_win_update(struct decon_device *decon)
 {
        struct decon_lcd *lcd = decon->lcd_info;
+       struct v4l2_subdev *sd;
+       struct dpp_restriction res;
+       int sz_align = 1;
 
        decon->win_up.enabled = false;
        decon->cursor.xpos = lcd->xres / 2;
@@ -578,30 +605,37 @@ void dpu_init_win_update(struct decon_device *decon)
                return;
        }
 
+       sd = decon->dpp_sd[0];
+       v4l2_subdev_call(sd, core, ioctl, DPP_GET_RESTRICTION, &res);
+
        if (lcd->dsc_enabled) {
                decon->win_up.rect_w = lcd->xres / lcd->dsc_slice_num;
                decon->win_up.rect_h = lcd->dsc_slice_h;
        } else {
-               decon->win_up.rect_w = MIN_WIN_BLOCK_WIDTH;
-               decon->win_up.rect_h = MIN_WIN_BLOCK_HEIGHT;
+               decon->win_up.rect_w = res.src_f_w.min * sz_align;
+               decon->win_up.rect_h = res.src_f_h.min * sz_align;
        }
 
        DPU_FULL_RECT(&decon->win_up.prev_up_region, lcd);
 
        decon->win_up.hori_cnt = decon->lcd_info->xres / decon->win_up.rect_w;
-       if (decon->lcd_info->xres - decon->win_up.hori_cnt * decon->win_up.rect_w) {
-               decon_warn("%s: parameters is wrong. lcd w(%d), win rect w(%d)\n",
-                               __func__, decon->lcd_info->xres,
-                               decon->win_up.rect_w);
-               return;
+       if (lcd->dsc_enabled) {
+               if (decon->lcd_info->xres - decon->win_up.hori_cnt * decon->win_up.rect_w) {
+                       decon_warn("%s: parameters is wrong. lcd w(%d), win rect w(%d)\n",
+                                       __func__, decon->lcd_info->xres,
+                                       decon->win_up.rect_w);
+                       return;
+               }
        }
 
        decon->win_up.verti_cnt = decon->lcd_info->yres / decon->win_up.rect_h;
-       if (decon->lcd_info->yres - decon->win_up.verti_cnt * decon->win_up.rect_h) {
-               decon_warn("%s: parameters is wrong. lcd h(%d), win rect h(%d)\n",
-                               __func__, decon->lcd_info->yres,
-                               decon->win_up.rect_h);
-               return;
+       if (lcd->dsc_enabled) {
+               if (decon->lcd_info->yres - decon->win_up.verti_cnt * decon->win_up.rect_h) {
+                       decon_warn("%s: parameters is wrong. lcd h(%d), win rect h(%d)\n",
+                                       __func__, decon->lcd_info->yres,
+                                       decon->win_up.rect_h);
+                       return;
+               }
        }
 
        decon_info("window update is enabled: win rectangle w(%d), h(%d)\n",