Skip to content
This repository has been archived by the owner on Jul 3, 2023. It is now read-only.

Commit

Permalink
BACKPORT: msm: kgsl: Add support for KGSL_PROP_VK_DEVICE_ID
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: UtsavBalar1231 <[email protected]>
  • Loading branch information
Hareesh Gundu authored and mvaisakh committed Mar 13, 2023
1 parent 69dc4fe commit e6bf44e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
23 changes: 23 additions & 0 deletions drivers/gpu/msm/adreno.c
Original file line number Diff line number Diff line change
Expand Up @@ -1519,6 +1519,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;
}

static int adreno_probe_efuse(struct platform_device *pdev,
struct adreno_device *adreno_dev)
{
Expand Down Expand Up @@ -2823,6 +2843,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 = adreno_dev->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));
}
Expand All @@ -2847,6 +2869,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,
Expand Down
1 change: 1 addition & 0 deletions include/uapi/linux/msm_kgsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,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_capabilties_properties returns a list of supported properties.
Expand Down

0 comments on commit e6bf44e

Please sign in to comment.