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

Commit 7b78985d authored by Alan Kwong's avatar Alan Kwong Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: Enable rotator smmu domain based on DT setting



To support new v4l2 rotator driver, rotator smmu domains in
MDSS driver will be enabled based on device tree boolean setting.
This allows smmu to be associated with MDSS driver or external
rotator driver for MDS block, such as 3.0.0 onward, with a
separate rotator block, or for MDSS block, pre 2.0.0, with
built-in writeback rotator.

CRs-Fixed: 973961
Change-Id: I68ac7b1b89485d1ce46bdb1c1739c3306a7d7d89
Signed-off-by: default avatarAlan Kwong <akwong@codeaurora.org>
parent 6899126b
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -313,6 +313,7 @@ struct mdss_data_type {
	bool needs_hist_vote;
	bool has_ubwc;
	bool has_wb_ubwc;
	bool has_separate_rotator;

	u32 default_ot_rd_limit;
	u32 default_ot_wr_limit;
+2 −3
Original line number Diff line number Diff line
@@ -2962,7 +2962,6 @@ static int mdss_mdp_parse_dt_mixer(struct platform_device *pdev)
	u32 *mixer_offsets = NULL, *dspp_offsets = NULL,
	    *pingpong_offsets = NULL;
	u32 is_virtual_mixer_req = false;
	u32 supports_separate_rotator = 0;

	struct mdss_data_type *mdata = platform_get_drvdata(pdev);

@@ -3017,7 +3016,7 @@ static int mdss_mdp_parse_dt_mixer(struct platform_device *pdev)
	if (rc)
		goto parse_done;

	supports_separate_rotator = of_property_read_bool(pdev->dev.of_node,
	mdata->has_separate_rotator = of_property_read_bool(pdev->dev.of_node,
		"qcom,mdss-has-separate-rotator");
	if (mdata->nmixers_wb) {
		rc = mdss_mdp_parse_dt_handler(pdev, "qcom,mdss-mixer-wb-off",
@@ -3025,7 +3024,7 @@ static int mdss_mdp_parse_dt_mixer(struct platform_device *pdev)
				mdata->nmixers_wb);
		if (rc)
			goto parse_done;
	} else if (!supports_separate_rotator) {
	} else if (!mdata->has_separate_rotator) {
		/*
		 * If writeback mixers are not available, put the number of
		 * writeback mixers equal to number of DMA pipes so that
+6 −0
Original line number Diff line number Diff line
@@ -1106,6 +1106,12 @@ static inline bool mdss_mdp_is_ubwc_supported(struct mdss_data_type *mdata)
	return mdata->has_ubwc;
}

static inline bool mdss_mdp_is_wb_rotator_supported(
		struct mdss_data_type *mdata)
{
	return mdata && !mdata->has_separate_rotator;
}

static inline int mdss_mdp_is_cdm_supported(struct mdss_data_type *mdata,
					    u32 intf_type, u32 mixer_type)
{
+4 −3
Original line number Diff line number Diff line
/* Copyright (c) 2007-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2007-2016, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -60,14 +60,15 @@ static inline bool is_mdss_smmu_compatible_device(const char *str)
 * mdss_smmu_is_valid_domain_type()
 *
 * Used to check if rotator smmu domain is defined or not by checking if
 * vbif base is defined. As those are associated.
 * vbif base is defined and wb rotator exists. As those are associated.
 */
static inline bool mdss_smmu_is_valid_domain_type(struct mdss_data_type *mdata,
		int domain_type)
{
	if ((domain_type == MDSS_IOMMU_DOMAIN_ROT_UNSECURE ||
			domain_type == MDSS_IOMMU_DOMAIN_ROT_SECURE) &&
			!mdss_mdp_is_nrt_vbif_base_defined(mdata))
			(!mdss_mdp_is_wb_rotator_supported(mdata) ||
			!mdss_mdp_is_nrt_vbif_base_defined(mdata)))
		return false;
	return true;
}