Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cbc4c33d authored by YoungJun Cho's avatar YoungJun Cho Committed by Inki Dae
Browse files

drm/exynos: Clean up logs for DRM_ERROR / DRM_DEBUG_KMS



This patch cleans up logs for DRM_ERROR / DRM_DEBUG_KMS to avoid
logging duplicated function name because the macros already contain
 __func__.

Signed-off-by: default avatarYoungJun Cho <yj44.cho@samsung.com>
Signed-off-by: default avatarSeung-Woo Kim <sw0312.kim@samsung.com>
Signed-off-by: default avatarInki Dae <inki.dae@samsung.com>
parent bca34c9a
Loading
Loading
Loading
Loading
+53 −60
Original line number Diff line number Diff line
@@ -217,7 +217,7 @@ static void fimc_set_type_ctrl(struct fimc_context *ctx, enum fimc_wb wb)
{
	u32 cfg;

	DRM_DEBUG_KMS("%s:wb[%d]\n", __func__, wb);
	DRM_DEBUG_KMS("wb[%d]\n", wb);

	cfg = fimc_read(EXYNOS_CIGCTRL);
	cfg &= ~(EXYNOS_CIGCTRL_TESTPATTERN_MASK |
@@ -253,10 +253,10 @@ static void fimc_set_polarity(struct fimc_context *ctx,
{
	u32 cfg;

	DRM_DEBUG_KMS("%s:inv_pclk[%d]inv_vsync[%d]\n",
		__func__, pol->inv_pclk, pol->inv_vsync);
	DRM_DEBUG_KMS("%s:inv_href[%d]inv_hsync[%d]\n",
		__func__, pol->inv_href, pol->inv_hsync);
	DRM_DEBUG_KMS("inv_pclk[%d]inv_vsync[%d]\n",
		pol->inv_pclk, pol->inv_vsync);
	DRM_DEBUG_KMS("inv_href[%d]inv_hsync[%d]\n",
		pol->inv_href, pol->inv_hsync);

	cfg = fimc_read(EXYNOS_CIGCTRL);
	cfg &= ~(EXYNOS_CIGCTRL_INVPOLPCLK | EXYNOS_CIGCTRL_INVPOLVSYNC |
@@ -278,7 +278,7 @@ static void fimc_handle_jpeg(struct fimc_context *ctx, bool enable)
{
	u32 cfg;

	DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
	DRM_DEBUG_KMS("enable[%d]\n", enable);

	cfg = fimc_read(EXYNOS_CIGCTRL);
	if (enable)
@@ -294,7 +294,7 @@ static void fimc_handle_irq(struct fimc_context *ctx, bool enable,
{
	u32 cfg;

	DRM_DEBUG_KMS("%s:enable[%d]overflow[%d]level[%d]\n", __func__,
	DRM_DEBUG_KMS("enable[%d]overflow[%d]level[%d]\n",
			enable, overflow, level);

	cfg = fimc_read(EXYNOS_CIGCTRL);
@@ -329,7 +329,7 @@ static bool fimc_check_ovf(struct fimc_context *ctx)
	flag = EXYNOS_CISTATUS_OVFIY | EXYNOS_CISTATUS_OVFICB |
		EXYNOS_CISTATUS_OVFICR;

	DRM_DEBUG_KMS("%s:flag[0x%x]\n", __func__, flag);
	DRM_DEBUG_KMS("flag[0x%x]\n", flag);

	if (status & flag) {
		cfg = fimc_read(EXYNOS_CIWDOFST);
@@ -358,7 +358,7 @@ static bool fimc_check_frame_end(struct fimc_context *ctx)

	cfg = fimc_read(EXYNOS_CISTATUS);

	DRM_DEBUG_KMS("%s:cfg[0x%x]\n", __func__, cfg);
	DRM_DEBUG_KMS("cfg[0x%x]\n", cfg);

	if (!(cfg & EXYNOS_CISTATUS_FRAMEEND))
		return false;
@@ -380,7 +380,7 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
	if (frame_cnt == 0)
		frame_cnt = EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg);

	DRM_DEBUG_KMS("%s:present[%d]before[%d]\n", __func__,
	DRM_DEBUG_KMS("present[%d]before[%d]\n",
		EXYNOS_CISTATUS2_GET_FRAMECOUNT_PRESENT(cfg),
		EXYNOS_CISTATUS2_GET_FRAMECOUNT_BEFORE(cfg));

@@ -390,7 +390,7 @@ static int fimc_get_buf_id(struct fimc_context *ctx)
	}

	buf_id = frame_cnt - 1;
	DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id);
	DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);

	return buf_id;
}
@@ -399,7 +399,7 @@ static void fimc_handle_lastend(struct fimc_context *ctx, bool enable)
{
	u32 cfg;

	DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
	DRM_DEBUG_KMS("enable[%d]\n", enable);

	cfg = fimc_read(EXYNOS_CIOCTRL);
	if (enable)
@@ -416,7 +416,7 @@ static int fimc_src_set_fmt_order(struct fimc_context *ctx, u32 fmt)
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
	DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

	/* RGB */
	cfg = fimc_read(EXYNOS_CISCCTRL);
@@ -489,7 +489,7 @@ static int fimc_src_set_fmt(struct device *dev, u32 fmt)
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
	DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

	cfg = fimc_read(EXYNOS_MSCTRL);
	cfg &= ~EXYNOS_MSCTRL_INFORMAT_RGB;
@@ -549,8 +549,7 @@ static int fimc_src_set_transf(struct device *dev,
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg1, cfg2;

	DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
		degree, flip);
	DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);

	cfg1 = fimc_read(EXYNOS_MSCTRL);
	cfg1 &= ~(EXYNOS_MSCTRL_FLIP_X_MIRROR |
@@ -613,10 +612,9 @@ static int fimc_set_window(struct fimc_context *ctx,
	v1 = pos->y;
	v2 = sz->vsize - pos->h - pos->y;

	DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
	__func__, pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize);
	DRM_DEBUG_KMS("%s:h1[%d]h2[%d]v1[%d]v2[%d]\n", __func__,
		h1, h2, v1, v2);
	DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]hsize[%d]vsize[%d]\n",
		pos->x, pos->y, pos->w, pos->h, sz->hsize, sz->vsize);
	DRM_DEBUG_KMS("h1[%d]h2[%d]v1[%d]v2[%d]\n", h1, h2, v1, v2);

	/*
	 * set window offset 1, 2 size
@@ -645,8 +643,8 @@ static int fimc_src_set_size(struct device *dev, int swap,
	struct drm_exynos_sz img_sz = *sz;
	u32 cfg;

	DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n",
		__func__, swap, sz->hsize, sz->vsize);
	DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
		swap, sz->hsize, sz->vsize);

	/* original size */
	cfg = (EXYNOS_ORGISIZE_HORIZONTAL(img_sz.hsize) |
@@ -654,8 +652,7 @@ static int fimc_src_set_size(struct device *dev, int swap,

	fimc_write(cfg, EXYNOS_ORGISIZE);

	DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n", __func__,
		pos->x, pos->y, pos->w, pos->h);
	DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);

	if (swap) {
		img_pos.w = pos->h;
@@ -712,7 +709,7 @@ static int fimc_src_set_addr(struct device *dev,

	property = &c_node->property;

	DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
	DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
		property->prop_id, buf_id, buf_type);

	if (buf_id > FIMC_MAX_SRC) {
@@ -764,7 +761,7 @@ static int fimc_dst_set_fmt_order(struct fimc_context *ctx, u32 fmt)
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
	DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

	/* RGB */
	cfg = fimc_read(EXYNOS_CISCCTRL);
@@ -843,7 +840,7 @@ static int fimc_dst_set_fmt(struct device *dev, u32 fmt)
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
	DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

	cfg = fimc_read(EXYNOS_CIEXTEN);

@@ -911,8 +908,7 @@ static int fimc_dst_set_transf(struct device *dev,
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
		degree, flip);
	DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);

	cfg = fimc_read(EXYNOS_CITRGFMT);
	cfg &= ~EXYNOS_CITRGFMT_FLIP_MASK;
@@ -962,7 +958,7 @@ static int fimc_dst_set_transf(struct device *dev,

static int fimc_get_ratio_shift(u32 src, u32 dst, u32 *ratio, u32 *shift)
{
	DRM_DEBUG_KMS("%s:src[%d]dst[%d]\n", __func__, src, dst);
	DRM_DEBUG_KMS("src[%d]dst[%d]\n", src, dst);

	if (src >= dst * 64) {
		DRM_ERROR("failed to make ratio and shift.\n");
@@ -1031,20 +1027,20 @@ static int fimc_set_prescaler(struct fimc_context *ctx, struct fimc_scaler *sc,

	pre_dst_width = src_w / pre_hratio;
	pre_dst_height = src_h / pre_vratio;
	DRM_DEBUG_KMS("%s:pre_dst_width[%d]pre_dst_height[%d]\n", __func__,
	DRM_DEBUG_KMS("pre_dst_width[%d]pre_dst_height[%d]\n",
		pre_dst_width, pre_dst_height);
	DRM_DEBUG_KMS("%s:pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n",
		__func__, pre_hratio, hfactor, pre_vratio, vfactor);
	DRM_DEBUG_KMS("pre_hratio[%d]hfactor[%d]pre_vratio[%d]vfactor[%d]\n",
		pre_hratio, hfactor, pre_vratio, vfactor);

	sc->hratio = (src_w << 14) / (dst_w << hfactor);
	sc->vratio = (src_h << 14) / (dst_h << vfactor);
	sc->up_h = (dst_w >= src_w) ? true : false;
	sc->up_v = (dst_h >= src_h) ? true : false;
	DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
	__func__, sc->hratio, sc->vratio, sc->up_h, sc->up_v);
	DRM_DEBUG_KMS("hratio[%d]vratio[%d]up_h[%d]up_v[%d]\n",
		sc->hratio, sc->vratio, sc->up_h, sc->up_v);

	shfactor = FIMC_SHFACTOR - (hfactor + vfactor);
	DRM_DEBUG_KMS("%s:shfactor[%d]\n", __func__, shfactor);
	DRM_DEBUG_KMS("shfactor[%d]\n", shfactor);

	cfg = (EXYNOS_CISCPRERATIO_SHFACTOR(shfactor) |
		EXYNOS_CISCPRERATIO_PREHORRATIO(pre_hratio) |
@@ -1062,10 +1058,10 @@ static void fimc_set_scaler(struct fimc_context *ctx, struct fimc_scaler *sc)
{
	u32 cfg, cfg_ext;

	DRM_DEBUG_KMS("%s:range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
		__func__, sc->range, sc->bypass, sc->up_h, sc->up_v);
	DRM_DEBUG_KMS("%s:hratio[%d]vratio[%d]\n",
		__func__, sc->hratio, sc->vratio);
	DRM_DEBUG_KMS("range[%d]bypass[%d]up_h[%d]up_v[%d]\n",
		sc->range, sc->bypass, sc->up_h, sc->up_v);
	DRM_DEBUG_KMS("hratio[%d]vratio[%d]\n",
		sc->hratio, sc->vratio);

	cfg = fimc_read(EXYNOS_CISCCTRL);
	cfg &= ~(EXYNOS_CISCCTRL_SCALERBYPASS |
@@ -1105,8 +1101,8 @@ static int fimc_dst_set_size(struct device *dev, int swap,
	struct drm_exynos_sz img_sz = *sz;
	u32 cfg;

	DRM_DEBUG_KMS("%s:swap[%d]hsize[%d]vsize[%d]\n",
		__func__, swap, sz->hsize, sz->vsize);
	DRM_DEBUG_KMS("swap[%d]hsize[%d]vsize[%d]\n",
		swap, sz->hsize, sz->vsize);

	/* original size */
	cfg = (EXYNOS_ORGOSIZE_HORIZONTAL(img_sz.hsize) |
@@ -1114,8 +1110,7 @@ static int fimc_dst_set_size(struct device *dev, int swap,

	fimc_write(cfg, EXYNOS_ORGOSIZE);

	DRM_DEBUG_KMS("%s:x[%d]y[%d]w[%d]h[%d]\n",
		__func__, pos->x, pos->y, pos->w, pos->h);
	DRM_DEBUG_KMS("x[%d]y[%d]w[%d]h[%d]\n", pos->x, pos->y, pos->w, pos->h);

	/* CSC ITU */
	cfg = fimc_read(EXYNOS_CIGCTRL);
@@ -1172,7 +1167,7 @@ static int fimc_dst_get_buf_seq(struct fimc_context *ctx)
		if (cfg & (mask << i))
			buf_num++;

	DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num);
	DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);

	return buf_num;
}
@@ -1186,8 +1181,7 @@ static int fimc_dst_set_buf_seq(struct fimc_context *ctx, u32 buf_id,
	u32 mask = 0x00000001 << buf_id;
	int ret = 0;

	DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__,
		buf_id, buf_type);
	DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);

	mutex_lock(&ctx->lock);

@@ -1244,7 +1238,7 @@ static int fimc_dst_set_addr(struct device *dev,

	property = &c_node->property;

	DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
	DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
		property->prop_id, buf_id, buf_type);

	if (buf_id > FIMC_MAX_DST) {
@@ -1294,7 +1288,7 @@ static struct exynos_drm_ipp_ops fimc_dst_ops = {

static int fimc_clk_ctrl(struct fimc_context *ctx, bool enable)
{
	DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
	DRM_DEBUG_KMS("enable[%d]\n", enable);

	if (enable) {
		clk_prepare_enable(ctx->clocks[FIMC_CLK_GATE]);
@@ -1318,7 +1312,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
		c_node->event_work;
	int buf_id;

	DRM_DEBUG_KMS("%s:fimc id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("fimc id[%d]\n", ctx->id);

	fimc_clear_irq(ctx);
	if (fimc_check_ovf(ctx))
@@ -1331,7 +1325,7 @@ static irqreturn_t fimc_irq_handler(int irq, void *dev_id)
	if (buf_id < 0)
		return IRQ_HANDLED;

	DRM_DEBUG_KMS("%s:buf_id[%d]\n", __func__, buf_id);
	DRM_DEBUG_KMS("buf_id[%d]\n", buf_id);

	if (fimc_dst_set_buf_seq(ctx, buf_id, IPP_BUF_DEQUEUE) < 0) {
		DRM_ERROR("failed to dequeue.\n");
@@ -1392,7 +1386,7 @@ static inline bool fimc_check_drm_flip(enum drm_exynos_flip flip)
	case EXYNOS_DRM_FLIP_BOTH:
		return true;
	default:
		DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
		DRM_DEBUG_KMS("invalid flip\n");
		return false;
	}
}
@@ -1554,7 +1548,7 @@ static int fimc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
	int ret, i;
	u32 cfg0, cfg1;

	DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
	DRM_DEBUG_KMS("cmd[%d]\n", cmd);

	if (!c_node) {
		DRM_ERROR("failed to get c_node.\n");
@@ -1663,7 +1657,7 @@ static void fimc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
	struct drm_exynos_ipp_set_wb set_wb = {0, 0};
	u32 cfg;

	DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
	DRM_DEBUG_KMS("cmd[%d]\n", cmd);

	switch (cmd) {
	case IPP_CMD_M2M:
@@ -1853,8 +1847,7 @@ static int fimc_probe(struct platform_device *pdev)
		goto err_put_clk;
	}

	DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id,
		(int)ippdrv);
	DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv);

	mutex_init(&ctx->lock);
	platform_set_drvdata(pdev, ctx);
@@ -1901,7 +1894,7 @@ static int fimc_suspend(struct device *dev)
{
	struct fimc_context *ctx = get_fimc_context(dev);

	DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("id[%d]\n", ctx->id);

	if (pm_runtime_suspended(dev))
		return 0;
@@ -1913,7 +1906,7 @@ static int fimc_resume(struct device *dev)
{
	struct fimc_context *ctx = get_fimc_context(dev);

	DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("id[%d]\n", ctx->id);

	if (!pm_runtime_suspended(dev))
		return fimc_clk_ctrl(ctx, true);
@@ -1927,7 +1920,7 @@ static int fimc_runtime_suspend(struct device *dev)
{
	struct fimc_context *ctx = get_fimc_context(dev);

	DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("id[%d]\n", ctx->id);

	return  fimc_clk_ctrl(ctx, false);
}
@@ -1936,7 +1929,7 @@ static int fimc_runtime_resume(struct device *dev)
{
	struct fimc_context *ctx = get_fimc_context(dev);

	DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("id[%d]\n", ctx->id);

	return  fimc_clk_ctrl(ctx, true);
}
+40 −50
Original line number Diff line number Diff line
@@ -456,7 +456,7 @@ static void gsc_handle_irq(struct gsc_context *ctx, bool enable,
{
	u32 cfg;

	DRM_DEBUG_KMS("%s:enable[%d]overflow[%d]level[%d]\n", __func__,
	DRM_DEBUG_KMS("enable[%d]overflow[%d]level[%d]\n",
			enable, overflow, done);

	cfg = gsc_read(GSC_IRQ);
@@ -487,7 +487,7 @@ static int gsc_src_set_fmt(struct device *dev, u32 fmt)
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
	DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

	cfg = gsc_read(GSC_IN_CON);
	cfg &= ~(GSC_IN_RGB_TYPE_MASK | GSC_IN_YUV422_1P_ORDER_MASK |
@@ -563,8 +563,7 @@ static int gsc_src_set_transf(struct device *dev,
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
		degree, flip);
	DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);

	cfg = gsc_read(GSC_IN_CON);
	cfg &= ~GSC_IN_ROT_MASK;
@@ -612,8 +611,8 @@ static int gsc_src_set_size(struct device *dev, int swap,
	struct gsc_scaler *sc = &ctx->sc;
	u32 cfg;

	DRM_DEBUG_KMS("%s:swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
		__func__, swap, pos->x, pos->y, pos->w, pos->h);
	DRM_DEBUG_KMS("swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
		swap, pos->x, pos->y, pos->w, pos->h);

	if (swap) {
		img_pos.w = pos->h;
@@ -630,8 +629,7 @@ static int gsc_src_set_size(struct device *dev, int swap,
		GSC_CROPPED_HEIGHT(img_pos.h));
	gsc_write(cfg, GSC_CROPPED_SIZE);

	DRM_DEBUG_KMS("%s:hsize[%d]vsize[%d]\n",
		__func__, sz->hsize, sz->vsize);
	DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", sz->hsize, sz->vsize);

	/* original size */
	cfg = gsc_read(GSC_SRCIMG_SIZE);
@@ -646,8 +644,7 @@ static int gsc_src_set_size(struct device *dev, int swap,
	cfg = gsc_read(GSC_IN_CON);
	cfg &= ~GSC_IN_RGB_TYPE_MASK;

	DRM_DEBUG_KMS("%s:width[%d]range[%d]\n",
		__func__, pos->w, sc->range);
	DRM_DEBUG_KMS("width[%d]range[%d]\n", pos->w, sc->range);

	if (pos->w >= GSC_WIDTH_ITU_709)
		if (sc->range)
@@ -673,8 +670,7 @@ static int gsc_src_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
	u32 cfg;
	u32 mask = 0x00000001 << buf_id;

	DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__,
		buf_id, buf_type);
	DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);

	/* mask register set */
	cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK);
@@ -717,7 +713,7 @@ static int gsc_src_set_addr(struct device *dev,

	property = &c_node->property;

	DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
	DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
		property->prop_id, buf_id, buf_type);

	if (buf_id > GSC_MAX_SRC) {
@@ -761,7 +757,7 @@ static int gsc_dst_set_fmt(struct device *dev, u32 fmt)
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:fmt[0x%x]\n", __func__, fmt);
	DRM_DEBUG_KMS("fmt[0x%x]\n", fmt);

	cfg = gsc_read(GSC_OUT_CON);
	cfg &= ~(GSC_OUT_RGB_TYPE_MASK | GSC_OUT_YUV422_1P_ORDER_MASK |
@@ -834,8 +830,7 @@ static int gsc_dst_set_transf(struct device *dev,
	struct exynos_drm_ippdrv *ippdrv = &ctx->ippdrv;
	u32 cfg;

	DRM_DEBUG_KMS("%s:degree[%d]flip[0x%x]\n", __func__,
		degree, flip);
	DRM_DEBUG_KMS("degree[%d]flip[0x%x]\n", degree, flip);

	cfg = gsc_read(GSC_IN_CON);
	cfg &= ~GSC_IN_ROT_MASK;
@@ -877,7 +872,7 @@ static int gsc_dst_set_transf(struct device *dev,

static int gsc_get_ratio_shift(u32 src, u32 dst, u32 *ratio)
{
	DRM_DEBUG_KMS("%s:src[%d]dst[%d]\n", __func__, src, dst);
	DRM_DEBUG_KMS("src[%d]dst[%d]\n", src, dst);

	if (src >= dst * 8) {
		DRM_ERROR("failed to make ratio and shift.\n");
@@ -940,20 +935,19 @@ static int gsc_set_prescaler(struct gsc_context *ctx, struct gsc_scaler *sc,
		return ret;
	}

	DRM_DEBUG_KMS("%s:pre_hratio[%d]pre_vratio[%d]\n",
		__func__, sc->pre_hratio, sc->pre_vratio);
	DRM_DEBUG_KMS("pre_hratio[%d]pre_vratio[%d]\n",
		sc->pre_hratio, sc->pre_vratio);

	sc->main_hratio = (src_w << 16) / dst_w;
	sc->main_vratio = (src_h << 16) / dst_h;

	DRM_DEBUG_KMS("%s:main_hratio[%ld]main_vratio[%ld]\n",
		__func__, sc->main_hratio, sc->main_vratio);
	DRM_DEBUG_KMS("main_hratio[%ld]main_vratio[%ld]\n",
		sc->main_hratio, sc->main_vratio);

	gsc_get_prescaler_shfactor(sc->pre_hratio, sc->pre_vratio,
		&sc->pre_shfactor);

	DRM_DEBUG_KMS("%s:pre_shfactor[%d]\n", __func__,
		sc->pre_shfactor);
	DRM_DEBUG_KMS("pre_shfactor[%d]\n", sc->pre_shfactor);

	cfg = (GSC_PRESC_SHFACTOR(sc->pre_shfactor) |
		GSC_PRESC_H_RATIO(sc->pre_hratio) |
@@ -1019,8 +1013,8 @@ static void gsc_set_scaler(struct gsc_context *ctx, struct gsc_scaler *sc)
{
	u32 cfg;

	DRM_DEBUG_KMS("%s:main_hratio[%ld]main_vratio[%ld]\n",
		__func__, sc->main_hratio, sc->main_vratio);
	DRM_DEBUG_KMS("main_hratio[%ld]main_vratio[%ld]\n",
		sc->main_hratio, sc->main_vratio);

	gsc_set_h_coef(ctx, sc->main_hratio);
	cfg = GSC_MAIN_H_RATIO_VALUE(sc->main_hratio);
@@ -1039,8 +1033,8 @@ static int gsc_dst_set_size(struct device *dev, int swap,
	struct gsc_scaler *sc = &ctx->sc;
	u32 cfg;

	DRM_DEBUG_KMS("%s:swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
		__func__, swap, pos->x, pos->y, pos->w, pos->h);
	DRM_DEBUG_KMS("swap[%d]x[%d]y[%d]w[%d]h[%d]\n",
		swap, pos->x, pos->y, pos->w, pos->h);

	if (swap) {
		img_pos.w = pos->h;
@@ -1056,8 +1050,7 @@ static int gsc_dst_set_size(struct device *dev, int swap,
	cfg = (GSC_SCALED_WIDTH(img_pos.w) | GSC_SCALED_HEIGHT(img_pos.h));
	gsc_write(cfg, GSC_SCALED_SIZE);

	DRM_DEBUG_KMS("%s:hsize[%d]vsize[%d]\n",
		__func__, sz->hsize, sz->vsize);
	DRM_DEBUG_KMS("hsize[%d]vsize[%d]\n", sz->hsize, sz->vsize);

	/* original size */
	cfg = gsc_read(GSC_DSTIMG_SIZE);
@@ -1070,8 +1063,7 @@ static int gsc_dst_set_size(struct device *dev, int swap,
	cfg = gsc_read(GSC_OUT_CON);
	cfg &= ~GSC_OUT_RGB_TYPE_MASK;

	DRM_DEBUG_KMS("%s:width[%d]range[%d]\n",
		__func__, pos->w, sc->range);
	DRM_DEBUG_KMS("width[%d]range[%d]\n", pos->w, sc->range);

	if (pos->w >= GSC_WIDTH_ITU_709)
		if (sc->range)
@@ -1100,7 +1092,7 @@ static int gsc_dst_get_buf_seq(struct gsc_context *ctx)
		if (cfg & (mask << i))
			buf_num--;

	DRM_DEBUG_KMS("%s:buf_num[%d]\n", __func__, buf_num);
	DRM_DEBUG_KMS("buf_num[%d]\n", buf_num);

	return buf_num;
}
@@ -1114,8 +1106,7 @@ static int gsc_dst_set_buf_seq(struct gsc_context *ctx, u32 buf_id,
	u32 mask = 0x00000001 << buf_id;
	int ret = 0;

	DRM_DEBUG_KMS("%s:buf_id[%d]buf_type[%d]\n", __func__,
		buf_id, buf_type);
	DRM_DEBUG_KMS("buf_id[%d]buf_type[%d]\n", buf_id, buf_type);

	mutex_lock(&ctx->lock);

@@ -1173,7 +1164,7 @@ static int gsc_dst_set_addr(struct device *dev,

	property = &c_node->property;

	DRM_DEBUG_KMS("%s:prop_id[%d]buf_id[%d]buf_type[%d]\n", __func__,
	DRM_DEBUG_KMS("prop_id[%d]buf_id[%d]buf_type[%d]\n",
		property->prop_id, buf_id, buf_type);

	if (buf_id > GSC_MAX_DST) {
@@ -1213,7 +1204,7 @@ static struct exynos_drm_ipp_ops gsc_dst_ops = {

static int gsc_clk_ctrl(struct gsc_context *ctx, bool enable)
{
	DRM_DEBUG_KMS("%s:enable[%d]\n", __func__, enable);
	DRM_DEBUG_KMS("enable[%d]\n", enable);

	if (enable) {
		clk_enable(ctx->gsc_clk);
@@ -1232,7 +1223,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx)
	u32 buf_id = GSC_MAX_SRC;
	int ret;

	DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);

	cfg = gsc_read(GSC_IN_BASE_ADDR_Y_MASK);
	curr_index = GSC_IN_CURR_GET_INDEX(cfg);
@@ -1255,7 +1246,7 @@ static int gsc_get_src_buf_index(struct gsc_context *ctx)
		return ret;
	}

	DRM_DEBUG_KMS("%s:cfg[0x%x]curr_index[%d]buf_id[%d]\n", __func__, cfg,
	DRM_DEBUG_KMS("cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg,
		curr_index, buf_id);

	return buf_id;
@@ -1267,7 +1258,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx)
	u32 buf_id = GSC_MAX_DST;
	int ret;

	DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);

	cfg = gsc_read(GSC_OUT_BASE_ADDR_Y_MASK);
	curr_index = GSC_OUT_CURR_GET_INDEX(cfg);
@@ -1290,7 +1281,7 @@ static int gsc_get_dst_buf_index(struct gsc_context *ctx)
		return ret;
	}

	DRM_DEBUG_KMS("%s:cfg[0x%x]curr_index[%d]buf_id[%d]\n", __func__, cfg,
	DRM_DEBUG_KMS("cfg[0x%x]curr_index[%d]buf_id[%d]\n", cfg,
		curr_index, buf_id);

	return buf_id;
@@ -1306,7 +1297,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
	u32 status;
	int buf_id[EXYNOS_DRM_OPS_MAX];

	DRM_DEBUG_KMS("%s:gsc id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("gsc id[%d]\n", ctx->id);

	status = gsc_read(GSC_IRQ);
	if (status & GSC_IRQ_STATUS_OR_IRQ) {
@@ -1327,7 +1318,7 @@ static irqreturn_t gsc_irq_handler(int irq, void *dev_id)
		if (buf_id[EXYNOS_DRM_OPS_DST] < 0)
			return IRQ_HANDLED;

		DRM_DEBUG_KMS("%s:buf_id_src[%d]buf_id_dst[%d]\n", __func__,
		DRM_DEBUG_KMS("buf_id_src[%d]buf_id_dst[%d]\n",
			buf_id[EXYNOS_DRM_OPS_SRC], buf_id[EXYNOS_DRM_OPS_DST]);

		event_work->ippdrv = ippdrv;
@@ -1388,7 +1379,7 @@ static inline bool gsc_check_drm_flip(enum drm_exynos_flip flip)
	case EXYNOS_DRM_FLIP_BOTH:
		return true;
	default:
		DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
		DRM_DEBUG_KMS("invalid flip\n");
		return false;
	}
}
@@ -1539,7 +1530,7 @@ static int gsc_ippdrv_start(struct device *dev, enum drm_exynos_ipp_cmd cmd)
	u32 cfg;
	int ret, i;

	DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
	DRM_DEBUG_KMS("cmd[%d]\n", cmd);

	if (!c_node) {
		DRM_ERROR("failed to get c_node.\n");
@@ -1633,7 +1624,7 @@ static void gsc_ippdrv_stop(struct device *dev, enum drm_exynos_ipp_cmd cmd)
	struct drm_exynos_ipp_set_wb set_wb = {0, 0};
	u32 cfg;

	DRM_DEBUG_KMS("%s:cmd[%d]\n", __func__, cmd);
	DRM_DEBUG_KMS("cmd[%d]\n", cmd);

	switch (cmd) {
	case IPP_CMD_M2M:
@@ -1718,8 +1709,7 @@ static int gsc_probe(struct platform_device *pdev)
		return ret;
	}

	DRM_DEBUG_KMS("%s:id[%d]ippdrv[0x%x]\n", __func__, ctx->id,
		(int)ippdrv);
	DRM_DEBUG_KMS("id[%d]ippdrv[0x%x]\n", ctx->id, (int)ippdrv);

	mutex_init(&ctx->lock);
	platform_set_drvdata(pdev, ctx);
@@ -1762,7 +1752,7 @@ static int gsc_suspend(struct device *dev)
{
	struct gsc_context *ctx = get_gsc_context(dev);

	DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("id[%d]\n", ctx->id);

	if (pm_runtime_suspended(dev))
		return 0;
@@ -1774,7 +1764,7 @@ static int gsc_resume(struct device *dev)
{
	struct gsc_context *ctx = get_gsc_context(dev);

	DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("id[%d]\n", ctx->id);

	if (!pm_runtime_suspended(dev))
		return gsc_clk_ctrl(ctx, true);
@@ -1788,7 +1778,7 @@ static int gsc_runtime_suspend(struct device *dev)
{
	struct gsc_context *ctx = get_gsc_context(dev);

	DRM_DEBUG_KMS("%s:id[%d]\n", __func__, ctx->id);
	DRM_DEBUG_KMS("id[%d]\n", ctx->id);

	return  gsc_clk_ctrl(ctx, false);
}
+67 −82

File changed.

Preview size limit exceeded, changes collapsed.

+18 −23
Original line number Diff line number Diff line
@@ -244,7 +244,7 @@ static int rotator_src_set_size(struct device *dev, int swap,
	/* Get format */
	fmt = rotator_reg_get_fmt(rot);
	if (!rotator_check_reg_fmt(fmt)) {
		DRM_ERROR("%s:invalid format.\n", __func__);
		DRM_ERROR("invalid format.\n");
		return -EINVAL;
	}

@@ -287,7 +287,7 @@ static int rotator_src_set_addr(struct device *dev,
		/* Get format */
		fmt = rotator_reg_get_fmt(rot);
		if (!rotator_check_reg_fmt(fmt)) {
			DRM_ERROR("%s:invalid format.\n", __func__);
			DRM_ERROR("invalid format.\n");
			return -EINVAL;
		}

@@ -381,7 +381,7 @@ static int rotator_dst_set_size(struct device *dev, int swap,
	/* Get format */
	fmt = rotator_reg_get_fmt(rot);
	if (!rotator_check_reg_fmt(fmt)) {
		DRM_ERROR("%s:invalid format.\n", __func__);
		DRM_ERROR("invalid format.\n");
		return -EINVAL;
	}

@@ -422,7 +422,7 @@ static int rotator_dst_set_addr(struct device *dev,
		/* Get format */
		fmt = rotator_reg_get_fmt(rot);
		if (!rotator_check_reg_fmt(fmt)) {
			DRM_ERROR("%s:invalid format.\n", __func__);
			DRM_ERROR("invalid format.\n");
			return -EINVAL;
		}

@@ -500,7 +500,7 @@ static inline bool rotator_check_drm_fmt(u32 fmt)
	case DRM_FORMAT_NV12:
		return true;
	default:
		DRM_DEBUG_KMS("%s:not support format\n", __func__);
		DRM_DEBUG_KMS("not support format\n");
		return false;
	}
}
@@ -514,7 +514,7 @@ static inline bool rotator_check_drm_flip(enum drm_exynos_flip flip)
	case EXYNOS_DRM_FLIP_BOTH:
		return true;
	default:
		DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
		DRM_DEBUG_KMS("invalid flip\n");
		return false;
	}
}
@@ -534,19 +534,18 @@ static int rotator_ippdrv_check_property(struct device *dev,

	/* Check format configuration */
	if (src_config->fmt != dst_config->fmt) {
		DRM_DEBUG_KMS("%s:not support csc feature\n", __func__);
		DRM_DEBUG_KMS("not support csc feature\n");
		return -EINVAL;
	}

	if (!rotator_check_drm_fmt(dst_config->fmt)) {
		DRM_DEBUG_KMS("%s:invalid format\n", __func__);
		DRM_DEBUG_KMS("invalid format\n");
		return -EINVAL;
	}

	/* Check transform configuration */
	if (src_config->degree != EXYNOS_DRM_DEGREE_0) {
		DRM_DEBUG_KMS("%s:not support source-side rotation\n",
			__func__);
		DRM_DEBUG_KMS("not support source-side rotation\n");
		return -EINVAL;
	}

@@ -559,51 +558,47 @@ static int rotator_ippdrv_check_property(struct device *dev,
		/* No problem */
		break;
	default:
		DRM_DEBUG_KMS("%s:invalid degree\n", __func__);
		DRM_DEBUG_KMS("invalid degree\n");
		return -EINVAL;
	}

	if (src_config->flip != EXYNOS_DRM_FLIP_NONE) {
		DRM_DEBUG_KMS("%s:not support source-side flip\n", __func__);
		DRM_DEBUG_KMS("not support source-side flip\n");
		return -EINVAL;
	}

	if (!rotator_check_drm_flip(dst_config->flip)) {
		DRM_DEBUG_KMS("%s:invalid flip\n", __func__);
		DRM_DEBUG_KMS("invalid flip\n");
		return -EINVAL;
	}

	/* Check size configuration */
	if ((src_pos->x + src_pos->w > src_sz->hsize) ||
		(src_pos->y + src_pos->h > src_sz->vsize)) {
		DRM_DEBUG_KMS("%s:out of source buffer bound\n", __func__);
		DRM_DEBUG_KMS("out of source buffer bound\n");
		return -EINVAL;
	}

	if (swap) {
		if ((dst_pos->x + dst_pos->h > dst_sz->vsize) ||
			(dst_pos->y + dst_pos->w > dst_sz->hsize)) {
			DRM_DEBUG_KMS("%s:out of destination buffer bound\n",
				__func__);
			DRM_DEBUG_KMS("out of destination buffer bound\n");
			return -EINVAL;
		}

		if ((src_pos->w != dst_pos->h) || (src_pos->h != dst_pos->w)) {
			DRM_DEBUG_KMS("%s:not support scale feature\n",
				__func__);
			DRM_DEBUG_KMS("not support scale feature\n");
			return -EINVAL;
		}
	} else {
		if ((dst_pos->x + dst_pos->w > dst_sz->hsize) ||
			(dst_pos->y + dst_pos->h > dst_sz->vsize)) {
			DRM_DEBUG_KMS("%s:out of destination buffer bound\n",
				__func__);
			DRM_DEBUG_KMS("out of destination buffer bound\n");
			return -EINVAL;
		}

		if ((src_pos->w != dst_pos->w) || (src_pos->h != dst_pos->h)) {
			DRM_DEBUG_KMS("%s:not support scale feature\n",
				__func__);
			DRM_DEBUG_KMS("not support scale feature\n");
			return -EINVAL;
		}
	}
@@ -691,7 +686,7 @@ static int rotator_probe(struct platform_device *pdev)
		goto err_ippdrv_register;
	}

	DRM_DEBUG_KMS("%s:ippdrv[0x%x]\n", __func__, (int)ippdrv);
	DRM_DEBUG_KMS("ippdrv[0x%x]\n", (int)ippdrv);

	platform_set_drvdata(pdev, rot);

+5 −5
Original line number Diff line number Diff line
@@ -1634,8 +1634,8 @@ static void hdmi_mode_set(void *ctx, struct drm_display_mode *mode)
	struct hdmi_context *hdata = ctx;
	struct drm_display_mode *m = mode;

	DRM_DEBUG_KMS("[%s]: xres=%d, yres=%d, refresh=%d, intl=%s\n",
		__func__, m->hdisplay, m->vdisplay,
	DRM_DEBUG_KMS("xres=%d, yres=%d, refresh=%d, intl=%s\n",
		m->hdisplay, m->vdisplay,
		m->vrefresh, (m->flags & DRM_MODE_FLAG_INTERLACE) ?
		"INTERLACED" : "PROGERESSIVE");

@@ -1723,7 +1723,7 @@ static void hdmi_dpms(void *ctx, int mode)
{
	struct hdmi_context *hdata = ctx;

	DRM_DEBUG_KMS("[%d] %s mode %d\n", __LINE__, __func__, mode);
	DRM_DEBUG_KMS("mode %d\n", mode);

	switch (mode) {
	case DRM_MODE_DPMS_ON:
@@ -2073,7 +2073,7 @@ static int hdmi_suspend(struct device *dev)
		drm_helper_hpd_irq_event(ctx->drm_dev);

	if (pm_runtime_suspended(dev)) {
		DRM_DEBUG_KMS("%s : Already suspended\n", __func__);
		DRM_DEBUG_KMS("Already suspended\n");
		return 0;
	}

@@ -2092,7 +2092,7 @@ static int hdmi_resume(struct device *dev)
	enable_irq(hdata->irq);

	if (!pm_runtime_suspended(dev)) {
		DRM_DEBUG_KMS("%s : Already resumed\n", __func__);
		DRM_DEBUG_KMS("Already resumed\n");
		return 0;
	}

Loading