Merge "msm: kgsl: Retry setting the SMMU aperture on A6XX targets"

This commit is contained in:
qctecmdr 2020-04-02 05:43:12 -07:00 • committed by Gerrit - the friendly Code Review server
commit 86ba23d1ab
3 changed files with 12 additions and 2 deletions

View file

@ -1412,6 +1412,12 @@ static int adreno_bind(struct device *dev)
if (adreno_support_64bit(adreno_dev))
kgsl_mmu_set_feature(device, KGSL_MMU_64BIT);
/*
* Set the SMMU aperture on A6XX targets to use per-process pagetables.
*/
if (adreno_is_a6xx(adreno_dev))
kgsl_mmu_set_feature(device, KGSL_MMU_SMMU_APERTURE);
device->pwrctrl.bus_width = adreno_dev->gpucore->bus_width;
device->mmu.secured = (IS_ENABLED(CONFIG_QCOM_SECURE_BUFFER) &&

View file

@ -1084,13 +1084,15 @@ static int set_smmu_aperture(struct kgsl_device *device, int cb_num)
{
int ret;
if (!qcom_scm_kgsl_set_smmu_aperture_available())
if (!test_bit(KGSL_MMU_SMMU_APERTURE, &device->mmu.features))
return 0;
ret = qcom_scm_kgsl_set_smmu_aperture(cb_num);
if (ret == -EBUSY)
ret = qcom_scm_kgsl_set_smmu_aperture(cb_num);
if (ret)
dev_err(device->dev, "Unable to set the SMMU aperture: %d\n",
dev_err(device->dev, "Unable to set the SMMU aperture: %d. The aperture needs to be set to use per-process pagetables\n",
ret);
return ret;

View file

@ -126,6 +126,8 @@ enum kgsl_mmu_feature {
KGSL_MMU_SECURE_CB_ALT,
/** @KGSL_MMU_LLC_ENABLE: Set if LLC is activated for the target */
KGSL_MMU_LLCC_ENABLE,
/** @KGSL_MMU_SMMU_APERTURE: Set the SMMU aperture */
KGSL_MMU_SMMU_APERTURE,
};
/**