msm: kgsl: Add support for KGSL_PROP_VK_DEVICE_ID

Usermode driver expect vulkan device id info from kernel.
Add new KGSL_PROP_VK_DEVICE_ID property support to provide
vk-device-id information.

Change-Id: Ib4f6872fcd3a956caeaad6e7c9f534d7c8e87305
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
This commit is contained in:
Hareesh Gundu 2021-05-10 20:56:58 +05:30
commit 4bdfdd52f5
2 changed files with 24 additions and 0 deletions

View file

@ -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,

View file

@ -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.