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

Commit 048c9018 authored by Samantha Tran's avatar Samantha Tran
Browse files

msm: sde: add Kona mdss HW rev support for SDE offline rotator



This change adds Kona mdss hardware revision support for
SDE offline rotator.

Change-Id: I9bb812e4d015b7e3de67e3e5c59e93314c14dfff
Signed-off-by: default avatarSamantha Tran <samtran@codeaurora.org>
parent 1fa7a093
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -531,6 +531,8 @@ if DVB_PLATFORM_DRIVERS
source "drivers/media/platform/sti/c8sectpfe/Kconfig"
endif #DVB_PLATFORM_DRIVERS

source "drivers/media/platform/msm/Kconfig"

menuconfig CEC_PLATFORM_DRIVERS
	bool "CEC platform devices"
	depends on MEDIA_CEC_SUPPORT
+2 −1
Original line number Diff line number Diff line
/* SPDX-License-Identifier: GPL-2.0-only */
/*
 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 */

#ifndef __SDE_ROTATOR_BASE_H__
@@ -40,6 +40,7 @@
#define SDE_MDP_HW_REV_410	SDE_MDP_REV(4, 1, 0)	/* sdm670 v1.0 */
#define SDE_MDP_HW_REV_500	SDE_MDP_REV(5, 0, 0)	/* sm8150 v1.0 */
#define SDE_MDP_HW_REV_530	SDE_MDP_REV(5, 3, 0)	/* sm6150 v1.0 */
#define SDE_MDP_HW_REV_600	SDE_MDP_REV(6, 0, 0)    /* msmnile+ v1.0 */

#define SDE_MDP_VBIF_4_LEVEL_REMAPPER	4
#define SDE_MDP_VBIF_8_LEVEL_REMAPPER	8
+5 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt)	"%s:%d: " fmt, __func__, __LINE__
@@ -3116,12 +3116,14 @@ int sde_rotator_core_init(struct sde_rot_mgr **pmgr,
		IS_SDE_MAJOR_MINOR_SAME(mdata->mdss_version,
			SDE_MDP_HW_REV_410) ||
		IS_SDE_MAJOR_SAME(mdata->mdss_version,
			SDE_MDP_HW_REV_500)) {
			SDE_MDP_HW_REV_500) ||
		IS_SDE_MAJOR_SAME(mdata->mdss_version,
			SDE_MDP_HW_REV_600)) {
		mgr->ops_hw_init = sde_rotator_r3_init;
		mgr->min_rot_clk = ROT_MIN_ROT_CLK;

		if (!IS_SDE_MAJOR_SAME(mdata->mdss_version,
					SDE_MDP_HW_REV_500) &&
					SDE_MDP_HW_REV_600) &&
				!sde_rotator_get_clk(mgr,
					SDE_ROTATOR_CLK_MDSS_AXI)) {
			SDEROT_ERR("unable to get mdss_axi_clk\n");
+57 −21
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2015-2019, The Linux Foundation. All rights reserved.
 */

#define pr_fmt(fmt)	"%s:%d: " fmt, __func__, __LINE__
@@ -1302,6 +1302,35 @@ static void sde_hw_rotator_setup_qos_lut_rd(struct sde_hw_rotator_context *ctx)
	sde_hw_rotator_put_regdma_segment(ctx, wrptr);
}

static void sde_hw_rotator_setup_fetchengine_helper(
		struct sde_hw_rot_sspp_cfg *cfg,
		struct sde_rot_data_type *mdata,
		struct sde_hw_rotator_context *ctx, char __iomem *wrptr,
		u32 flags, u32 *width, u32 *height)
{
	int i;

	/*
	 * initialize start control trigger selection first
	 */
	if (test_bit(SDE_CAPS_SBUF_1, mdata->sde_caps_map)) {
		if (ctx->sbuf_mode)
			SDE_REGDMA_WRITE(wrptr, ROTTOP_START_CTRL,
					ctx->start_ctrl);
		else
			SDE_REGDMA_WRITE(wrptr, ROTTOP_START_CTRL, 0);
	}

	/* source image setup */
	if ((flags & SDE_ROT_FLAG_DEINTERLACE)
			&& !(flags & SDE_ROT_FLAG_SOURCE_ROTATED_90)) {
		for (i = 0; i < cfg->src_plane.num_planes; i++)
			cfg->src_plane.ystride[i] *= 2;
		*width *= 2;
		*height /= 2;
	}
}

/*
 * sde_hw_rotator_setup_fetchengine - setup fetch engine
 * @ctx: Pointer to rotator context
@@ -1344,25 +1373,8 @@ static void sde_hw_rotator_setup_fetchengine(struct sde_hw_rotator_context *ctx,

	wrptr = sde_hw_rotator_get_regdma_segment(ctx);

	/*
	 * initialize start control trigger selection first
	 */
	if (test_bit(SDE_CAPS_SBUF_1, mdata->sde_caps_map)) {
		if (ctx->sbuf_mode)
			SDE_REGDMA_WRITE(wrptr, ROTTOP_START_CTRL,
					ctx->start_ctrl);
		else
			SDE_REGDMA_WRITE(wrptr, ROTTOP_START_CTRL, 0);
	}

	/* source image setup */
	if ((flags & SDE_ROT_FLAG_DEINTERLACE)
			&& !(flags & SDE_ROT_FLAG_SOURCE_ROTATED_90)) {
		for (i = 0; i < cfg->src_plane.num_planes; i++)
			cfg->src_plane.ystride[i] *= 2;
		width *= 2;
		height /= 2;
	}
	sde_hw_rotator_setup_fetchengine_helper(cfg, mdata, ctx, wrptr,
							flags, &width, &height);

	/*
	 * REGDMA BLK write from SRC_SIZE to OP_MODE, total 15 registers
@@ -3069,7 +3081,31 @@ static int sde_rotator_hw_rev_init(struct sde_hw_rotator *rot)
	SDE_ROTREG_WRITE(rot->mdss_base, REGDMA_TIMESTAMP_REG, 0);

	/* features exposed via mdss h/w version */
	if (IS_SDE_MAJOR_MINOR_SAME(mdata->mdss_version, SDE_MDP_HW_REV_500)) {
	if (IS_SDE_MAJOR_MINOR_SAME(mdata->mdss_version, SDE_MDP_HW_REV_600)) {
		SDEROT_DBG("Supporting sys cache inline rotation\n");
		set_bit(SDE_CAPS_SBUF_1,  mdata->sde_caps_map);
		set_bit(SDE_CAPS_PARTIALWR,  mdata->sde_caps_map);
		set_bit(SDE_CAPS_HW_TIMESTAMP, mdata->sde_caps_map);
		rot->inpixfmts[SDE_ROTATOR_MODE_OFFLINE] =
				sde_hw_rotator_v4_inpixfmts;
		rot->num_inpixfmt[SDE_ROTATOR_MODE_OFFLINE] =
				ARRAY_SIZE(sde_hw_rotator_v4_inpixfmts);
		rot->outpixfmts[SDE_ROTATOR_MODE_OFFLINE] =
				sde_hw_rotator_v4_outpixfmts;
		rot->num_outpixfmt[SDE_ROTATOR_MODE_OFFLINE] =
				ARRAY_SIZE(sde_hw_rotator_v4_outpixfmts);
		rot->inpixfmts[SDE_ROTATOR_MODE_SBUF] =
				sde_hw_rotator_v4_inpixfmts_sbuf;
		rot->num_inpixfmt[SDE_ROTATOR_MODE_SBUF] =
				ARRAY_SIZE(sde_hw_rotator_v4_inpixfmts_sbuf);
		rot->outpixfmts[SDE_ROTATOR_MODE_SBUF] =
				sde_hw_rotator_v4_outpixfmts_sbuf;
		rot->num_outpixfmt[SDE_ROTATOR_MODE_SBUF] =
				ARRAY_SIZE(sde_hw_rotator_v4_outpixfmts_sbuf);
		rot->downscale_caps =
			"LINEAR/1.5/2/4/8/16/32/64 TILE/1.5/2/4 TP10/1.5/2";
	} else if (IS_SDE_MAJOR_MINOR_SAME(mdata->mdss_version,
		SDE_MDP_HW_REV_500)) {
		SDEROT_DBG("Supporting sys cache inline rotation\n");
		set_bit(SDE_CAPS_SBUF_1,  mdata->sde_caps_map);
		set_bit(SDE_CAPS_UBWC_3,  mdata->sde_caps_map);
+1 −3
Original line number Diff line number Diff line
// SPDX-License-Identifier: GPL-2.0-only
/*
 * Copyright (c) 2012, 2015-2018, The Linux Foundation. All rights reserved.
 * Copyright (c) 2012, 2015-2019, The Linux Foundation. All rights reserved.
 */
#define pr_fmt(fmt)	"%s: " fmt, __func__

@@ -1211,8 +1211,6 @@ static const struct dma_buf_ops sde_rot_dmabuf_ops = {
	.map_dma_buf	= sde_rot_dmabuf_map_tiny,
	.unmap_dma_buf	= sde_rot_dmabuf_unmap,
	.release	= sde_rot_dmabuf_release,
	.map_atomic	= sde_rot_dmabuf_no_map,
	.unmap_atomic	= sde_rot_dmabuf_no_unmap,
	.map		= sde_rot_dmabuf_no_map,
	.unmap		= sde_rot_dmabuf_no_unmap,
	.mmap		= sde_rot_dmabuf_no_mmap,