Loading Documentation/devicetree/bindings/gpu/adreno-iommu.txt +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ Optional properties: for secure buffer allocation - qcom,secure_align_mask: A mask for determining how secure buffers need to be aligned - qcom,unmap_fast : A boolean specifying if iommu unmap fast is supported on this target. - List of sub nodes, one for each of the translation context banks supported. The driver uses the names of these nodes to determine how they are used, Loading arch/arm64/boot/dts/qcom/trinket-gpu.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,7 @@ "alt_mem_iface_clk", "smmu_vote"; qcom,retention; qcom,unmap_fast; qcom,hyp_secure_alloc; gfx3d_user: gfx3d_user { Loading drivers/gpu/msm/kgsl_iommu.c +23 −1 Original line number Diff line number Diff line Loading @@ -405,10 +405,18 @@ static int _iommu_unmap_sync_pc(struct kgsl_pagetable *pt, uint64_t addr, uint64_t size) { struct kgsl_iommu_pt *iommu_pt = pt->priv; struct kgsl_iommu *iommu = _IOMMU_PRIV(pt->mmu); size_t unmapped = 0; _iommu_sync_mmu_pc(true); /* * Take iommu unmap fast path if CX GDSC is in OFF state. */ if (iommu->vddcx_regulator && (!regulator_is_enabled(iommu->vddcx_regulator))) unmapped = iommu_unmap_fast(iommu_pt->domain, addr, size); else unmapped = iommu_unmap(iommu_pt->domain, addr, size); _iommu_sync_mmu_pc(false); Loading Loading @@ -2676,6 +2684,7 @@ static int _kgsl_iommu_probe(struct kgsl_device *device, u32 reg_val[2]; int i = 0; struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device); struct kgsl_pwrctrl *pwr = &device->pwrctrl; struct device_node *child; struct platform_device *pdev = of_find_device_by_node(node); Loading Loading @@ -2722,6 +2731,19 @@ static int _kgsl_iommu_probe(struct kgsl_device *device, device->mmu.features |= kgsl_iommu_features[i].bit; } /* * Try to preserve the SMMU regulator if HW can support * unmap fast path. */ if (of_property_read_bool(node, "qcom,unmap_fast")) { for (i = 0; i < KGSL_MAX_REGULATORS; i++) { if (!strcmp(pwr->regulators[i].name, "vddcx")) { iommu->vddcx_regulator = pwr->regulators[i].reg; } } } if (of_property_read_u32(node, "qcom,micro-mmu-control", &iommu->micro_mmu_ctrl)) iommu->micro_mmu_ctrl = UINT_MAX; Loading drivers/gpu/msm/kgsl_iommu.h +2 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,7 @@ struct kgsl_iommu_context { * @setstate: Scratch GPU memory for IOMMU operations * @clk_enable_count: The ref count of clock enable calls * @clks: Array of pointers to IOMMU clocks * @vddcx_regulator: Handle to IOMMU regulator * @micro_mmu_ctrl: GPU register offset of this glob al register * @smmu_info: smmu info used in a5xx preemption * @protect: register protection settings for the iommu. Loading @@ -143,6 +144,7 @@ struct kgsl_iommu { struct kgsl_memdesc setstate; atomic_t clk_enable_count; struct clk *clks[KGSL_IOMMU_MAX_CLKS]; struct regulator *vddcx_regulator; unsigned int micro_mmu_ctrl; struct kgsl_memdesc smmu_info; unsigned int version; Loading Loading
Documentation/devicetree/bindings/gpu/adreno-iommu.txt +2 −0 Original line number Diff line number Diff line Loading @@ -36,6 +36,8 @@ Optional properties: for secure buffer allocation - qcom,secure_align_mask: A mask for determining how secure buffers need to be aligned - qcom,unmap_fast : A boolean specifying if iommu unmap fast is supported on this target. - List of sub nodes, one for each of the translation context banks supported. The driver uses the names of these nodes to determine how they are used, Loading
arch/arm64/boot/dts/qcom/trinket-gpu.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -261,6 +261,7 @@ "alt_mem_iface_clk", "smmu_vote"; qcom,retention; qcom,unmap_fast; qcom,hyp_secure_alloc; gfx3d_user: gfx3d_user { Loading
drivers/gpu/msm/kgsl_iommu.c +23 −1 Original line number Diff line number Diff line Loading @@ -405,10 +405,18 @@ static int _iommu_unmap_sync_pc(struct kgsl_pagetable *pt, uint64_t addr, uint64_t size) { struct kgsl_iommu_pt *iommu_pt = pt->priv; struct kgsl_iommu *iommu = _IOMMU_PRIV(pt->mmu); size_t unmapped = 0; _iommu_sync_mmu_pc(true); /* * Take iommu unmap fast path if CX GDSC is in OFF state. */ if (iommu->vddcx_regulator && (!regulator_is_enabled(iommu->vddcx_regulator))) unmapped = iommu_unmap_fast(iommu_pt->domain, addr, size); else unmapped = iommu_unmap(iommu_pt->domain, addr, size); _iommu_sync_mmu_pc(false); Loading Loading @@ -2676,6 +2684,7 @@ static int _kgsl_iommu_probe(struct kgsl_device *device, u32 reg_val[2]; int i = 0; struct kgsl_iommu *iommu = KGSL_IOMMU_PRIV(device); struct kgsl_pwrctrl *pwr = &device->pwrctrl; struct device_node *child; struct platform_device *pdev = of_find_device_by_node(node); Loading Loading @@ -2722,6 +2731,19 @@ static int _kgsl_iommu_probe(struct kgsl_device *device, device->mmu.features |= kgsl_iommu_features[i].bit; } /* * Try to preserve the SMMU regulator if HW can support * unmap fast path. */ if (of_property_read_bool(node, "qcom,unmap_fast")) { for (i = 0; i < KGSL_MAX_REGULATORS; i++) { if (!strcmp(pwr->regulators[i].name, "vddcx")) { iommu->vddcx_regulator = pwr->regulators[i].reg; } } } if (of_property_read_u32(node, "qcom,micro-mmu-control", &iommu->micro_mmu_ctrl)) iommu->micro_mmu_ctrl = UINT_MAX; Loading
drivers/gpu/msm/kgsl_iommu.h +2 −0 Original line number Diff line number Diff line Loading @@ -129,6 +129,7 @@ struct kgsl_iommu_context { * @setstate: Scratch GPU memory for IOMMU operations * @clk_enable_count: The ref count of clock enable calls * @clks: Array of pointers to IOMMU clocks * @vddcx_regulator: Handle to IOMMU regulator * @micro_mmu_ctrl: GPU register offset of this glob al register * @smmu_info: smmu info used in a5xx preemption * @protect: register protection settings for the iommu. Loading @@ -143,6 +144,7 @@ struct kgsl_iommu { struct kgsl_memdesc setstate; atomic_t clk_enable_count; struct clk *clks[KGSL_IOMMU_MAX_CLKS]; struct regulator *vddcx_regulator; unsigned int micro_mmu_ctrl; struct kgsl_memdesc smmu_info; unsigned int version; Loading