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

Commit 7352dd66 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Add support to detect gaming SKU"

parents bf0b314d 65ef0ac7
Loading
Loading
Loading
Loading
+26 −0
Original line number Diff line number Diff line
@@ -2388,6 +2388,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)
{
@@ -2430,6 +2455,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