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: Alan Kwong <akwong@codeaurora.org>
[dkeitel@codeaurora.org: fixed minor whitspace conflict.]
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
This commit is contained in:
Alan Kwong 2016-02-03 20:50:12 -05:00 committed by David Keitel
parent ba9fc59027
commit 11c42c9d08
4 changed files with 14 additions and 6 deletions

View file

@ -309,6 +309,8 @@ struct mdss_data_type {
bool has_pixel_ram; bool has_pixel_ram;
bool needs_hist_vote; bool needs_hist_vote;
bool has_ubwc; bool has_ubwc;
bool has_wb_ubwc;
bool has_separate_rotator;
u32 default_ot_rd_limit; u32 default_ot_rd_limit;
u32 default_ot_wr_limit; u32 default_ot_wr_limit;

View file

@ -2882,7 +2882,6 @@ static int mdss_mdp_parse_dt_mixer(struct platform_device *pdev)
u32 *mixer_offsets = NULL, *dspp_offsets = NULL, u32 *mixer_offsets = NULL, *dspp_offsets = NULL,
*pingpong_offsets = NULL; *pingpong_offsets = NULL;
u32 is_virtual_mixer_req = false; u32 is_virtual_mixer_req = false;
u32 supports_separate_rotator = 0;
struct mdss_data_type *mdata = platform_get_drvdata(pdev); struct mdss_data_type *mdata = platform_get_drvdata(pdev);
@ -2937,7 +2936,7 @@ static int mdss_mdp_parse_dt_mixer(struct platform_device *pdev)
if (rc) if (rc)
goto parse_done; 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"); "qcom,mdss-has-separate-rotator");
if (mdata->nmixers_wb) { if (mdata->nmixers_wb) {
rc = mdss_mdp_parse_dt_handler(pdev, "qcom,mdss-mixer-wb-off", rc = mdss_mdp_parse_dt_handler(pdev, "qcom,mdss-mixer-wb-off",
@ -2945,7 +2944,7 @@ static int mdss_mdp_parse_dt_mixer(struct platform_device *pdev)
mdata->nmixers_wb); mdata->nmixers_wb);
if (rc) if (rc)
goto parse_done; goto parse_done;
} else if (!supports_separate_rotator) { } else if (!mdata->has_separate_rotator) {
/* /*
* If writeback mixers are not available, put the number of * If writeback mixers are not available, put the number of
* writeback mixers equal to number of DMA pipes so that * writeback mixers equal to number of DMA pipes so that

View file

@ -1106,6 +1106,12 @@ static inline bool mdss_mdp_is_ubwc_supported(struct mdss_data_type *mdata)
return mdata->has_ubwc; 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, static inline int mdss_mdp_is_cdm_supported(struct mdss_data_type *mdata,
u32 intf_type, u32 mixer_type) u32 intf_type, u32 mixer_type)
{ {

View file

@ -1,4 +1,4 @@
/* 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 * 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 * 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() * mdss_smmu_is_valid_domain_type()
* *
* Used to check if rotator smmu domain is defined or not by checking if * 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, static inline bool mdss_smmu_is_valid_domain_type(struct mdss_data_type *mdata,
int domain_type) int domain_type)
{ {
if ((domain_type == MDSS_IOMMU_DOMAIN_ROT_UNSECURE || if ((domain_type == MDSS_IOMMU_DOMAIN_ROT_UNSECURE ||
domain_type == MDSS_IOMMU_DOMAIN_ROT_SECURE) && 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 false;
return true; return true;
} }