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

Commit 65ef0ac7 authored by Sharat Masetty's avatar Sharat Masetty
Browse files

msm: kgsl: Add support to detect gaming SKU



This patch adds support to read the gaming bin fuse bit
and share with the user mode driver. This will allow the
user mode driver to detect gaming sku and take relevant
actions.

Change-Id: I2c6778d4e8ddb099f2d6da2fa10827c41908e7f8
Signed-off-by: default avatarSharat Masetty <smasetty@codeaurora.org>
parent db92782e
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -2375,6 +2375,31 @@ static int adreno_prop_ucode_version(struct kgsl_device *device,
	return copy_prop(param, &ucode, sizeof(ucode));
}

static int adreno_prop_gaming_bin(struct kgsl_device *device,
		struct kgsl_device_getproperty *param)
{
	void *buf;
	size_t len;
	int ret;
	struct nvmem_cell *cell;

	cell = nvmem_cell_get(&device->pdev->dev, "gaming_bin");
	if (IS_ERR(cell))
		return -EINVAL;

	buf = nvmem_cell_read(cell, &len);
	nvmem_cell_put(cell);

	if (!IS_ERR(buf)) {
		ret = copy_prop(param, buf, len);
		kfree(buf);
		return ret;
	}

	dev_err(device->dev, "failed to read gaming_bin nvmem cell\n");
	return -EINVAL;
}

static int adreno_prop_u32(struct kgsl_device *device,
		struct kgsl_device_getproperty *param)
{
@@ -2417,6 +2442,7 @@ static const struct {
	{ KGSL_PROP_UBWC_MODE, adreno_prop_u32 },
	{ KGSL_PROP_DEVICE_BITNESS, adreno_prop_u32 },
	{ KGSL_PROP_SPEED_BIN, adreno_prop_u32 },
	{ KGSL_PROP_GAMING_BIN, adreno_prop_gaming_bin },
};

static int adreno_getproperty(struct kgsl_device *device,
+1 −1
Original line number Diff line number Diff line
@@ -336,7 +336,7 @@ enum kgsl_timestamp_type {
#define KGSL_PROP_SECURE_BUFFER_ALIGNMENT 0x23
#define KGSL_PROP_SECURE_CTXT_SUPPORT 0x24
#define KGSL_PROP_SPEED_BIN		0x25
/* KGSL_PROP_GAMING_BIN	is 0x26 in 4.14 but not yet supported here */
#define KGSL_PROP_GAMING_BIN		0x26
#define KGSL_PROP_QUERY_CAPABILITIES	0x27
#define KGSL_PROP_CONTEXT_PROPERTY	0x28