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

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

Merge "msm: kgsl: Add support for KGSL_PROP_VK_DEVICE_ID"

parents bebc15ab 4bdfdd52
Loading
Loading
Loading
Loading
+23 −0
Original line number Diff line number Diff line
@@ -1299,6 +1299,26 @@ static const char *adreno_get_gpu_model(struct kgsl_device *device)
	return gpu_model;
}

static u32 adreno_get_vk_device_id(struct kgsl_device *device)
{
	struct device_node *node;
	static u32 device_id;

	if (device_id)
		return device_id;

	node = adreno_get_gpu_model_node(device->pdev);
	if (!node)
		node = of_node_get(device->pdev->dev.of_node);

	if (of_property_read_u32(node, "qcom,vk-device-id", &device_id))
		device_id = ADRENO_DEVICE(device)->chipid;

	of_node_put(node);

	return device_id;
}

#if IS_ENABLED(CONFIG_QCOM_LLCC)
static int adreno_probe_llcc(struct adreno_device *adreno_dev,
		struct platform_device *pdev)
@@ -2470,6 +2490,8 @@ static int adreno_prop_u32(struct kgsl_device *device,
		val = adreno_support_64bit(adreno_dev) ? 48 : 32;
	else if (param->type == KGSL_PROP_SPEED_BIN)
		val = device->speed_bin;
	else if (param->type == KGSL_PROP_VK_DEVICE_ID)
		val = adreno_get_vk_device_id(device);

	return copy_prop(param, &val, sizeof(val));
}
@@ -2494,6 +2516,7 @@ static const struct {
	{ KGSL_PROP_SPEED_BIN, adreno_prop_u32 },
	{ KGSL_PROP_GAMING_BIN, adreno_prop_gaming_bin },
	{ KGSL_PROP_GPU_MODEL, adreno_prop_gpu_model},
	{ KGSL_PROP_VK_DEVICE_ID, adreno_prop_u32},
};

static int adreno_getproperty(struct kgsl_device *device,
+1 −0
Original line number Diff line number Diff line
@@ -342,6 +342,7 @@ enum kgsl_timestamp_type {
#define KGSL_PROP_QUERY_CAPABILITIES	0x27
#define KGSL_PROP_CONTEXT_PROPERTY	0x28
#define KGSL_PROP_GPU_MODEL		0x29
#define KGSL_PROP_VK_DEVICE_ID		0x2A

/*
 * kgsl_capabilities_properties returns a list of supported properties.