From: ChiHun Won Date: Wed, 4 Jul 2018 05:41:54 +0000 (+0900) Subject: [9610] fbdev: dpu20: parse DPU count and HW limitation in CAL X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c2117465c416e0ed1a30b9f1870cb72dd78b991a;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [9610] fbdev: dpu20: parse DPU count and HW limitation in CAL Change-Id: I5cb6f5b2bd6ddaf9b9a3afe0d45b1f2747ae21f5 Signed-off-by: ChiHun Won --- diff --git a/drivers/video/fbdev/exynos/dpu20/cal_9610/decon_cal.h b/drivers/video/fbdev/exynos/dpu20/cal_9610/decon_cal.h index f5d5f4b51165..f46bdf7c098f 100644 --- a/drivers/video/fbdev/exynos/dpu20/cal_9610/decon_cal.h +++ b/drivers/video/fbdev/exynos/dpu20/cal_9610/decon_cal.h @@ -16,8 +16,6 @@ #define CEIL(x) ((x-(u32)(x) > 0 ? (u32)(x+1) : (u32)(x))) -#define CHIP_VER (9610) -#define MAX_DECON_CNT 3 #define MAX_DECON_WIN 4 #define MAX_DPP_SUBDEV 5 diff --git a/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_cal.h b/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_cal.h index b864c4106846..d06189997abe 100644 --- a/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_cal.h +++ b/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_cal.h @@ -14,47 +14,6 @@ #include "../decon.h" -#define MAX_DPP_CNT 4 - -#define SRC_SIZE_MULTIPLE 1 -#define SRC_WIDTH_MIN 16 -#define SRC_WIDTH_MAX 65534 -#define SRC_HEIGHT_MIN 16 -#define SRC_HEIGHT_MAX 8190 -#define IMG_SIZE_MULTIPLE 1 -#define IMG_WIDTH_MIN 16 -#define IMG_WIDTH_MAX 4096 -#define IMG_HEIGHT_MIN 16 -#define IMG_HEIGHT_MAX 4096 -#define IMG_ROT_HEIGHT_MAX 2160 -#define SRC_OFFSET_MULTIPLE 1 - -#define SCALED_WIDTH_MIN 16 -#define SCALED_WIDTH_MAX 4096 -#define SCALED_HEIGHT_MIN 16 -#define SCALED_HEIGHT_MAX 4096 -#define SCALED_SIZE_MULTIPLE 1 -#define SCALED_SIZE_MULTIPLE 1 - -#define BLK_WIDTH_MIN 4 -#define BLK_WIDTH_MAX 4096 -#define BLK_HEIGHT_MIN 1 -#define BLK_HEIGHT_MAX 4096 -#define BLK_SIZE_MULTIPLE 1 -#define BLK_SIZE_MULTIPLE 1 - -#define DST_SIZE_MULTIPLE 1 -#define DST_SIZE_WIDTH_MIN 16 -#define DST_SIZE_WIDTH_MAX 8190 -#define DST_SIZE_HEIGHT_MIN 16 -#define DST_SIZE_HEIGHT_MAX 8190 -#define DST_OFFSET_MULTIPLE 1 -#define DST_IMG_MULTIPLE 1 -#define DST_IMG_WIDTH_MIN 16 -#define DST_IMG_WIDTH_MAX 4096 -#define DST_IMG_HEIGHT_MIN 16 -#define DST_IMG_HEIGHT_MAX 4096 - struct dpp_params_info { struct decon_frame src; struct decon_frame dst; @@ -130,13 +89,15 @@ struct dpp_img_format { u32 wb; }; +struct dpp_restriction; + /* DPP CAL APIs exposed to DPP driver */ void dpp_reg_init(u32 id, const unsigned long attr); int dpp_reg_deinit(u32 id, bool reset, const unsigned long attr); void dpp_reg_configure_params(u32 id, struct dpp_params_info *p, const unsigned long attr); void dpp_constraints_params(struct dpp_size_constraints *vc, - struct dpp_img_format *vi); + struct dpp_img_format *vi, struct dpp_restriction *res); /* DPU_DMA, DPP DEBUG */ void __dpp_dump(u32 id, void __iomem *regs, void __iomem *dma_regs, diff --git a/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_reg.c b/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_reg.c index 49021a311db8..95846241ce32 100644 --- a/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_reg.c +++ b/drivers/video/fbdev/exynos/dpu20/cal_9610/dpp_reg.c @@ -846,60 +846,60 @@ static int dma_dpp_reg_set_format(u32 id, struct dpp_params_info *p, /******************** EXPORTED DPP CAL APIs ********************/ void dpp_constraints_params(struct dpp_size_constraints *vc, - struct dpp_img_format *vi) + struct dpp_img_format *vi, struct dpp_restriction *res) { u32 sz_align = 1; if (vi->yuv) sz_align = 2; - vc->src_mul_w = SRC_SIZE_MULTIPLE * sz_align; - vc->src_mul_h = SRC_SIZE_MULTIPLE * sz_align; - vc->src_w_min = SRC_WIDTH_MIN * sz_align; - vc->src_w_max = SRC_WIDTH_MAX; - vc->src_h_min = SRC_HEIGHT_MIN; - vc->src_h_max = SRC_HEIGHT_MAX; - vc->img_mul_w = IMG_SIZE_MULTIPLE * sz_align; - vc->img_mul_h = IMG_SIZE_MULTIPLE * sz_align; - vc->img_w_min = IMG_WIDTH_MIN * sz_align; - vc->img_w_max = IMG_WIDTH_MAX; - vc->img_h_min = IMG_HEIGHT_MIN * sz_align; + vc->src_mul_w = res->src_f_w.align * sz_align; + vc->src_mul_h = res->src_f_h.align * sz_align; + vc->src_w_min = res->src_f_w.min * sz_align; + vc->src_w_max = res->src_f_w.max; + vc->src_h_min = res->src_f_h.min; + vc->src_h_max = res->src_f_h.max; + vc->img_mul_w = res->src_w.align * sz_align; + vc->img_mul_h = res->src_h.align * sz_align; + vc->img_w_min = res->src_w.min * sz_align; + vc->img_w_max = res->src_w.max; + vc->img_h_min = res->src_h.min * sz_align; if (vi->rot > DPP_ROT_180) - vc->img_h_max = IMG_ROT_HEIGHT_MAX; + vc->img_h_max = res->src_h_rot_max; else - vc->img_h_max = IMG_HEIGHT_MAX; - vc->src_mul_x = SRC_OFFSET_MULTIPLE * sz_align; - vc->src_mul_y = SRC_OFFSET_MULTIPLE * sz_align; - - vc->sca_w_min = SCALED_WIDTH_MIN; - vc->sca_w_max = SCALED_WIDTH_MAX; - vc->sca_h_min = SCALED_HEIGHT_MIN; - vc->sca_h_max = SCALED_HEIGHT_MAX; - vc->sca_mul_w = SCALED_SIZE_MULTIPLE; - vc->sca_mul_h = SCALED_SIZE_MULTIPLE; - - vc->blk_w_min = BLK_WIDTH_MIN; - vc->blk_w_max = BLK_WIDTH_MAX; - vc->blk_h_min = BLK_HEIGHT_MIN; - vc->blk_h_max = BLK_HEIGHT_MAX; - vc->blk_mul_w = BLK_SIZE_MULTIPLE; - vc->blk_mul_h = BLK_SIZE_MULTIPLE; + vc->img_h_max = res->src_h.max; + vc->src_mul_x = res->src_x_align * sz_align; + vc->src_mul_y = res->src_y_align * sz_align; + + vc->sca_w_min = res->dst_w.min; + vc->sca_w_max = res->dst_w.max; + vc->sca_h_min = res->dst_h.min; + vc->sca_h_max = res->dst_h.max; + vc->sca_mul_w = res->dst_w.align; + vc->sca_mul_h = res->dst_h.align; + + vc->blk_w_min = res->blk_w.min; + vc->blk_w_max = res->blk_w.max; + vc->blk_h_min = res->blk_h.min; + vc->blk_h_max = res->blk_h.max; + vc->blk_mul_w = res->blk_w.align; + vc->blk_mul_h = res->blk_h.align; if (vi->wb) { - vc->src_mul_w = DST_SIZE_MULTIPLE * sz_align; - vc->src_mul_h = DST_SIZE_MULTIPLE * sz_align; - vc->src_w_min = DST_SIZE_WIDTH_MIN; - vc->src_w_max = DST_SIZE_WIDTH_MAX; - vc->src_h_min = DST_SIZE_HEIGHT_MIN; - vc->src_h_max = DST_SIZE_HEIGHT_MAX; - vc->img_mul_w = DST_IMG_MULTIPLE * sz_align; - vc->img_mul_h = DST_IMG_MULTIPLE * sz_align; - vc->img_w_min = DST_IMG_WIDTH_MIN; - vc->img_w_max = DST_IMG_WIDTH_MAX; - vc->img_h_min = DST_IMG_HEIGHT_MIN; - vc->img_h_max = DST_IMG_HEIGHT_MAX; - vc->src_mul_x = DST_OFFSET_MULTIPLE * sz_align; - vc->src_mul_y = DST_OFFSET_MULTIPLE * sz_align; + vc->src_mul_w = res->dst_f_w.align * sz_align; + vc->src_mul_h = res->dst_f_h.align * sz_align; + vc->src_w_min = res->dst_f_w.min; + vc->src_w_max = res->dst_f_w.max; + vc->src_h_min = res->dst_f_h.min; + vc->src_h_max = res->dst_f_h.max; + vc->img_mul_w = res->dst_w.align * sz_align; + vc->img_mul_h = res->dst_h.align * sz_align; + vc->img_w_min = res->dst_w.min; + vc->img_w_max = res->dst_w.max; + vc->img_h_min = res->dst_h.min; + vc->img_h_max = res->dst_h.max; + vc->src_mul_x = res->dst_x_align * sz_align; + vc->src_mul_y = res->dst_y_align * sz_align; } } diff --git a/drivers/video/fbdev/exynos/dpu20/cal_9610/dsim_cal.h b/drivers/video/fbdev/exynos/dpu20/cal_9610/dsim_cal.h index 09c231ad3664..abd244f235e7 100644 --- a/drivers/video/fbdev/exynos/dpu20/cal_9610/dsim_cal.h +++ b/drivers/video/fbdev/exynos/dpu20/cal_9610/dsim_cal.h @@ -14,8 +14,6 @@ #include "../panels/decon_lcd.h" -#define MAX_DSIM_CNT 2 - struct dsim_clks { u32 hs_clk; u32 esc_clk;