Эх сурвалжийг харах

disp: msm: sde: update inline rotation version for waipio

This change updates inline rotation version and handles listing
of color formats supported by inline rotation in waipio target.

Change-Id: Ibefc4fdfcf65c7a42642c15af5cf5e873a5b67de
Signed-off-by: Prabhanjan Kandula <[email protected]>
Prabhanjan Kandula 4 жил өмнө
parent
commit
38102ac372

+ 27 - 11
msm/sde/sde_hw_catalog.c

@@ -1596,7 +1596,8 @@ static int _sde_sspp_setup_vigs(struct device_node *np,
 					MAX_PRE_ROT_HEIGHT_INLINE_ROT_DEFAULT;
 		}
 
-		if (IS_SDE_INLINE_ROT_REV_200(sde_cfg->true_inline_rot_rev)) {
+		if (IS_SDE_INLINE_ROT_REV_200(sde_cfg->true_inline_rot_rev) ||
+				IS_SDE_INLINE_ROT_REV_201(sde_cfg->true_inline_rot_rev)) {
 			set_bit(SDE_SSPP_PREDOWNSCALE, &sspp->features);
 			sblk->in_rot_maxdwnscale_rt_num =
 				MAX_DOWNSCALE_RATIO_INROT_PD_RT_NUMERATOR;
@@ -4650,7 +4651,9 @@ static int sde_hardware_format_caps(struct sde_mdss_cfg *sde_cfg,
 	uint32_t virt_vig_list_size, in_rot_list_size = 0;
 	uint32_t cursor_list_size = 0;
 	uint32_t index = 0;
-	const struct sde_format_extended *inline_fmt_tbl;
+	uint32_t in_rot_restricted_list_size = 0;
+	const struct sde_format_extended *inline_fmt_tbl = NULL;
+	const struct sde_format_extended *inline_restricted_fmt_tbl = NULL;
 
 	/* cursor input formats */
 	if (sde_cfg->has_cursor) {
@@ -4747,12 +4750,14 @@ static int sde_hardware_format_caps(struct sde_mdss_cfg *sde_cfg,
 	} else if (IS_SDE_INLINE_ROT_REV_200(sde_cfg->true_inline_rot_rev)) {
 		inline_fmt_tbl = true_inline_rot_v2_fmts;
 		in_rot_list_size = ARRAY_SIZE(true_inline_rot_v2_fmts);
+	} else if (IS_SDE_INLINE_ROT_REV_201(sde_cfg->true_inline_rot_rev)) {
+		inline_fmt_tbl = true_inline_rot_v201_fmts;
+		in_rot_list_size = ARRAY_SIZE(true_inline_rot_v201_fmts);
+		inline_restricted_fmt_tbl = true_inline_rot_v201_restricted_fmts;
+		in_rot_restricted_list_size = ARRAY_SIZE(true_inline_rot_v201_fmts);
 	}
 
 	if (in_rot_list_size) {
-		if (sde_cfg->has_fp16)
-			in_rot_list_size += ARRAY_SIZE(fp_16_inline_rot_fmts);
-
 		sde_cfg->inline_rot_formats = kcalloc(in_rot_list_size,
 			sizeof(struct sde_format_extended), GFP_KERNEL);
 		if (!sde_cfg->inline_rot_formats) {
@@ -4763,14 +4768,25 @@ static int sde_hardware_format_caps(struct sde_mdss_cfg *sde_cfg,
 
 		index = sde_copy_formats(sde_cfg->inline_rot_formats,
 			in_rot_list_size, 0, inline_fmt_tbl, in_rot_list_size);
-		if (sde_cfg->has_fp16)
-			index += sde_copy_formats(sde_cfg->inline_rot_formats,
-				in_rot_list_size, index, fp_16_inline_rot_fmts,
-				ARRAY_SIZE(fp_16_inline_rot_fmts));
 	}
 
-	return 0;
+	if (in_rot_restricted_list_size) {
+		sde_cfg->inline_rot_restricted_formats = kcalloc(in_rot_restricted_list_size,
+			sizeof(struct sde_format_extended), GFP_KERNEL);
+		if (!sde_cfg->inline_rot_restricted_formats) {
+			SDE_ERROR("failed to alloc inline rot restricted format list\n");
+			rc = -ENOMEM;
+			goto free_in_rot;
+		}
 
+		index = sde_copy_formats(sde_cfg->inline_rot_restricted_formats,
+			in_rot_restricted_list_size, 0, inline_restricted_fmt_tbl,
+			in_rot_restricted_list_size);
+	}
+
+	return 0;
+free_in_rot:
+	kfree(sde_cfg->inline_rot_formats);
 free_wb:
 	kfree(sde_cfg->wb_formats);
 free_virt:
@@ -5123,7 +5139,7 @@ static int _sde_hardware_pre_caps(struct sde_mdss_cfg *sde_cfg, uint32_t hw_rev)
 		sde_cfg->has_hdr_plus = true;
 		set_bit(SDE_MDP_DHDR_MEMPOOL_4K, &sde_cfg->mdp[0].features);
 		sde_cfg->has_vig_p010 = true;
-		sde_cfg->true_inline_rot_rev = SDE_INLINE_ROT_VERSION_2_0_0;
+		sde_cfg->true_inline_rot_rev = SDE_INLINE_ROT_VERSION_2_0_1;
 		sde_cfg->uidle_cfg.uidle_rev = SDE_UIDLE_VERSION_1_0_2;
 		sde_cfg->vbif_disable_inner_outer_shareable = true;
 		sde_cfg->dither_luma_mode_support = true;

+ 4 - 0
msm/sde/sde_hw_catalog.h

@@ -113,11 +113,14 @@
  */
 #define SDE_INLINE_ROT_VERSION_1_0_0	0x100
 #define SDE_INLINE_ROT_VERSION_2_0_0	0x200
+#define SDE_INLINE_ROT_VERSION_2_0_1	0x201
 
 #define IS_SDE_INLINE_ROT_REV_100(rev) \
 	((rev) == SDE_INLINE_ROT_VERSION_1_0_0)
 #define IS_SDE_INLINE_ROT_REV_200(rev) \
 	((rev) == SDE_INLINE_ROT_VERSION_2_0_0)
+#define IS_SDE_INLINE_ROT_REV_201(rev) \
+	((rev) == SDE_INLINE_ROT_VERSION_2_0_1)
 
 
 /*
@@ -1673,6 +1676,7 @@ struct sde_mdss_cfg {
 	struct sde_format_extended *wb_formats;
 	struct sde_format_extended *virt_vig_formats;
 	struct sde_format_extended *inline_rot_formats;
+	struct sde_format_extended *inline_rot_restricted_formats;
 
 	struct list_head irq_offset_list;
 };

+ 15 - 2
msm/sde/sde_hw_catalog_format.h

@@ -175,8 +175,21 @@ static const struct sde_format_extended fp16_formats[] = {
 	{0, 0}
 };
 
-static const struct sde_format_extended fp_16_inline_rot_fmts[] = {
+static const struct sde_format_extended true_inline_rot_v201_fmts[] = {
+	{DRM_FORMAT_NV12, DRM_FORMAT_MOD_QCOM_COMPRESSED},
+	{DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_QCOM_COMPRESSED},
+	{DRM_FORMAT_ABGR2101010, DRM_FORMAT_MOD_QCOM_COMPRESSED},
+	TP10_UBWC_FMTS,
+	P010_UBWC_FMTS,
 	{DRM_FORMAT_ABGR16161616F, DRM_FORMAT_MOD_QCOM_COMPRESSED},
-	{0, 0}
+	{0, 0},
+};
+
+static const struct sde_format_extended true_inline_rot_v201_restricted_fmts[] = {
+	{DRM_FORMAT_ABGR8888, DRM_FORMAT_MOD_QCOM_COMPRESSED},
+	{DRM_FORMAT_ABGR2101010, DRM_FORMAT_MOD_QCOM_COMPRESSED},
+	P010_UBWC_FMTS,
+	{DRM_FORMAT_ABGR16161616F, DRM_FORMAT_MOD_QCOM_COMPRESSED},
+	{0, 0},
 };