浏览代码

disp: msm: rotator: add revision check for pitti target

This change includes hw revision check and adds
supported color format for decoder and encoder
of offline rotator.

Change-Id: I0ff20874f756743e1d2bf6b985952b028eeef488
Signed-off-by: Akhil Jaiswal <[email protected]>
Akhil Jaiswal 1 年之前
父节点
当前提交
d132c7b3fc
共有 4 个文件被更改,包括 108 次插入4 次删除
  1. 4 1
      rotator/sde_rotator_base.c
  2. 1 0
      rotator/sde_rotator_base.h
  3. 5 3
      rotator/sde_rotator_core.c
  4. 98 0
      rotator/sde_rotator_r3.c

+ 4 - 1
rotator/sde_rotator_base.c

@@ -1,5 +1,6 @@
 // SPDX-License-Identifier: GPL-2.0-only
 /*
+ * Copyright (c) 2024 Qualcomm Innovation Center, Inc. All rights reserved.
  * Copyright (c) 2012, 2015-2020, The Linux Foundation. All rights reserved.
  */
 #define pr_fmt(fmt)	"%s: " fmt, __func__
@@ -265,7 +266,9 @@ u32 sde_mdp_get_ot_limit(u32 width, u32 height, u32 pixfmt, u32 fps, u32 is_rd)
 			ot_lim = 16;
 		}
 	} else if (IS_SDE_MAJOR_SAME(mdata->mdss_version,
-				SDE_MDP_HW_REV_600) || is_yuv) {
+				SDE_MDP_HW_REV_600) ||
+				IS_SDE_MAJOR_SAME(mdata->mdss_version,
+				SDE_MDP_HW_REV_870) || is_yuv) {
 		if (res <= (RES_1080p * 30))
 			ot_lim = 2;
 		else if (res <= (RES_1080p * 60))

+ 1 - 0
rotator/sde_rotator_base.h

@@ -50,6 +50,7 @@
 #define SDE_MDP_HW_REV_630	SDE_MDP_REV(6, 3, 0)	/* bengal v1.0 */
 #define SDE_MDP_HW_REV_660	SDE_MDP_REV(6, 6, 0)	/* holi */
 #define SDE_MDP_HW_REV_690	SDE_MDP_REV(6, 9, 0)	/* blair */
+#define SDE_MDP_HW_REV_870	SDE_MDP_REV(8, 7, 0)    /* pitti */
 
 #define SDE_MDP_VBIF_4_LEVEL_REMAPPER	4
 #define SDE_MDP_VBIF_8_LEVEL_REMAPPER	8

+ 5 - 3
rotator/sde_rotator_core.c

@@ -3141,7 +3141,9 @@ int sde_rotator_core_init(struct sde_rot_mgr **pmgr,
 		IS_SDE_MAJOR_SAME(mdata->mdss_version,
 			SDE_MDP_HW_REV_500) ||
 		IS_SDE_MAJOR_SAME(mdata->mdss_version,
-			SDE_MDP_HW_REV_600)) {
+			SDE_MDP_HW_REV_600) ||
+		IS_SDE_MAJOR_SAME(mdata->mdss_version,
+			SDE_MDP_HW_REV_870)) {
 		mgr->ops_hw_init = sde_rotator_r3_init;
 		mgr->min_rot_clk = ROT_MIN_ROT_CLK;
 
@@ -3154,8 +3156,8 @@ int sde_rotator_core_init(struct sde_rot_mgr **pmgr,
 			SDE_MDP_HW_REV_500))
 			mgr->max_rot_clk = ROT_R3_MAX_ROT_CLK;
 
-		if (!IS_SDE_MAJOR_SAME(mdata->mdss_version,
-					SDE_MDP_HW_REV_600) &&
+		if (!(IS_SDE_MAJOR_SAME(mdata->mdss_version, SDE_MDP_HW_REV_600) ||
+			IS_SDE_MAJOR_SAME(mdata->mdss_version, SDE_MDP_HW_REV_870)) &&
 				!sde_rotator_get_clk(mgr,
 					SDE_ROTATOR_CLK_MDSS_AXI)) {
 			SDEROT_ERR("unable to get mdss_axi_clk\n");

+ 98 - 0
rotator/sde_rotator_r3.c

@@ -572,6 +572,88 @@ static const u32 sde_hw_rotator_v5_outpixfmts[] = {
 	/* SDE_PIX_FMT_XBGR_2101010_TILE,*/
 };
 
+static const u32 sde_hw_rotator_v6_inpixfmts[] = {
+	SDE_PIX_FMT_XRGB_8888,
+	SDE_PIX_FMT_ARGB_8888,
+	SDE_PIX_FMT_ABGR_8888,
+	SDE_PIX_FMT_RGBA_8888,
+	SDE_PIX_FMT_BGRA_8888,
+	SDE_PIX_FMT_RGBX_8888,
+	SDE_PIX_FMT_BGRX_8888,
+	SDE_PIX_FMT_XBGR_8888,
+	SDE_PIX_FMT_RGBA_5551,
+	SDE_PIX_FMT_ARGB_1555,
+	SDE_PIX_FMT_ABGR_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X_FMT_ABGR_2101010,
+	SDE_PIX_FMT_XBGR_2101010,
+	SDE_PIX_FMT_RGBA_1010102_UBWC,
+	/* SDE_PIX_FMT_RGBX_1010102_UBWC */
+	SDE_PIX_FMT_Y_CBCR_H2V2_P010,
+	SDE_PIX_FMT_Y_CBCR_H2V2_P010_VENUS,
+	/* SDE_PIX_FMT_Y_CBCR_H2V2_TP10 */
+	SDE_PIX_FMT_Y_CBCR_H2V2_TP10_UBWC,
+	SDE_PIX_FMT_Y_CBCR_H2V2_P010_UBWC,
+
+	/* SDE_PIX_FMT_Y_CBCR_H2V2_P010_TILE, */
+	/*SDE_PIX_FMT_Y_CBCR_H2V2_TILE, */
+	/* SDE_PIX_FMT_Y_CRCB_H2V2_TILE, */
+	/* SDE_PIX_FMT_XRGB_8888_TILE, */
+	/* SDE_PIX_FMT_ARGB_8888_TILE, */
+	/* SDE_PIX_FMT_ABGR_8888_TILE, */
+	/* SDE_PIX_FMT_XBGR_8888_TILE, */
+	/* SDE_PIX_FMT_RGBA_8888_TILE, */
+	/* SDE_PIX_FMT_BGRA_8888_TILE, */
+	/* SDE_PIX_FMT_RGBX_8888_TILE, */
+	/* SDE_PIX_FMT_BGRX_8888_TILE, */
+	/* SDE_PIX_FMT_RGBA_1010102_TILE, */
+	/* SDE_PIX_FMT_RGBX_1010102_TILE, */
+	/* SDE_PIX_FMT_ARGB_2101010_TILE, */
+	/* SDE_PIX_FMT_XRGB_2101010_TILE, */
+	/* SDE_PIX_FMT_BGRA_1010102_TILE, */
+	/* SDE_PIX_FMT_BGRX_1010102_TILE, */
+	/* SDE_PIX_FMT_ABGR_2101010_TILE, */
+	/* SDE_PIX_FMT_XBGR_2101010_TILE, */
+};
+
 static const u32 sde_hw_rotator_v4_inpixfmts_sbuf[] = {
 	SDE_PIX_FMT_Y_CBCR_H2V2_P010,
 	SDE_PIX_FMT_Y_CBCR_H2V2,
@@ -3703,6 +3785,22 @@ static int sde_rotator_hw_rev_init(struct sde_hw_rotator *rot)
 				ARRAY_SIZE(sde_hw_rotator_v5_outpixfmts);
 		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_870)) {
+		SDEROT_DBG("Sys cache inline rotation not supported\n");
+		set_bit(SDE_CAPS_UBWC_2,  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_v6_inpixfmts;
+		rot->num_inpixfmt[SDE_ROTATOR_MODE_OFFLINE] =
+				ARRAY_SIZE(sde_hw_rotator_v6_inpixfmts);
+		rot->outpixfmts[SDE_ROTATOR_MODE_OFFLINE] =
+				sde_hw_rotator_v5_outpixfmts;
+		rot->num_outpixfmt[SDE_ROTATOR_MODE_OFFLINE] =
+				ARRAY_SIZE(sde_hw_rotator_v5_outpixfmts);
+		rot->downscale_caps =
+			"LINEAR/1.5/2/4/8/16/32/64 TILE/1.5/2/4 TP10/1.5/2";
 	} else {
 		rot->inpixfmts[SDE_ROTATOR_MODE_OFFLINE] =
 				sde_hw_rotator_v3_inpixfmts;