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

Commit 1b2e2927 authored by Rajesh Kemisetti's avatar Rajesh Kemisetti Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Add quirk support to use alternative secure context bank



Add quirk to select alternative secure context bank node
which can use different SID during secure context play back.

Change-Id: I60b8f84e5ca2c851c591145c9122f284eae6e4bb
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
Signed-off-by: default avatarUrvashi Agrawal <urvaagra@codeaurora.org>
parent d8e268ee
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -207,6 +207,9 @@ GPU Quirks:
- qcom,gpu-quirk-limit-uche-gbif-rw:
				Limit number of read and write transactions from UCHE block to
				GBIF to avoid possible deadlock between GBIF, SMMU and MEMNOC.
- qcom,gpu-quirk-mmu-secure-cb-alt:
				Select alternate secure context bank to generate SID1 for
				secure playback.

KGSL Memory Pools:
- qcom,gpu-mempools:		Container for sets of GPU mempools.Multiple sets
+1 −0
Original line number Diff line number Diff line
@@ -744,6 +744,7 @@ static struct {
	{ ADRENO_QUIRK_SECVID_SET_ONCE, "qcom,gpu-quirk-secvid-set-once" },
	{ ADRENO_QUIRK_LIMIT_UCHE_GBIF_RW,
			"qcom,gpu-quirk-limit-uche-gbif-rw" },
	{ ADRENO_QUIRK_MMU_SECURE_CB_ALT, "qcom,gpu-quirk-mmu-secure-cb-alt" },
};

static struct device_node *
+2 −0
Original line number Diff line number Diff line
@@ -150,6 +150,8 @@
 * between GBIF, SMMU and MEMNOC.
 */
#define ADRENO_QUIRK_LIMIT_UCHE_GBIF_RW BIT(8)
/* Select alternate secure context bank for mmu */
#define ADRENO_QUIRK_MMU_SECURE_CB_ALT BIT(9)

/* Flags to control command packet settings */
#define KGSL_CMD_FLAGS_NONE             0
+11 −2
Original line number Diff line number Diff line
@@ -2530,6 +2530,7 @@ static const struct {
} kgsl_iommu_cbs[] = {
	{ KGSL_IOMMU_CONTEXT_USER, "gfx3d_user", },
	{ KGSL_IOMMU_CONTEXT_SECURE, "gfx3d_secure" },
	{ KGSL_IOMMU_CONTEXT_SECURE, "gfx3d_secure_alt" },
};

static int _kgsl_iommu_cb_probe(struct kgsl_device *device,
@@ -2537,12 +2538,20 @@ static int _kgsl_iommu_cb_probe(struct kgsl_device *device,
{
	struct platform_device *pdev = of_find_device_by_node(node);
	struct kgsl_iommu_context *ctx = NULL;
	struct adreno_device *adreno_dev = ADRENO_DEVICE(device);
	int i;

	for (i = 0; i < ARRAY_SIZE(kgsl_iommu_cbs); i++) {
		if (!strcmp(node->name, kgsl_iommu_cbs[i].name)) {
			int id = kgsl_iommu_cbs[i].id;

			if (ADRENO_QUIRK(adreno_dev,
				ADRENO_QUIRK_MMU_SECURE_CB_ALT)) {
				if (!strcmp(node->name, "gfx3d_secure"))
					continue;
			} else if (!strcmp(node->name, "gfx3d_secure_alt"))
				continue;

			ctx = &iommu->ctx[id];
			ctx->id = id;
			ctx->cb_num = -1;
@@ -2553,8 +2562,8 @@ static int _kgsl_iommu_cb_probe(struct kgsl_device *device,
	}

	if (ctx == NULL) {
		KGSL_CORE_ERR("dt: Unknown context label %s\n", node->name);
		return -EINVAL;
		KGSL_CORE_ERR("dt: Unused context label %s\n", node->name);
		return 0;
	}

	if (ctx->id == KGSL_IOMMU_CONTEXT_SECURE)