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 a property to query gpu model name
Browse files Browse the repository at this point in the history
Usermode driver can query gpu model name to log it.
So add support for new gpu model property.

Change-Id: Ifc3a76c3e6856161e76dfbe26be2a950db71aa5e
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 31a3f58 commit 69dc4fe
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
12 changes: 12 additions & 0 deletions drivers/gpu/msm/adreno.c
Original file line number Diff line number Diff line change
Expand Up @@ -2685,6 +2685,17 @@ static int adreno_prop_device_info(struct kgsl_device *device,
return copy_prop(param, &devinfo, sizeof(devinfo));
}

static int adreno_prop_gpu_model(struct kgsl_device *device,
struct kgsl_device_getproperty *param)
{
struct kgsl_gpu_model model = {0};

strlcpy(model.gpu_model, adreno_get_gpu_model(device),
sizeof(model.gpu_model));

return copy_prop(param, &model, sizeof(model));
}

static int adreno_prop_device_shadow(struct kgsl_device *device,
struct kgsl_device_getproperty *param)
{
Expand Down Expand Up @@ -2835,6 +2846,7 @@ static const struct {
{ KGSL_PROP_DEVICE_BITNESS, adreno_prop_u32 },
{ KGSL_PROP_SPEED_BIN, adreno_prop_u32 },
{ KGSL_PROP_GAMING_BIN, adreno_prop_gaming_bin },
{ KGSL_PROP_GPU_MODEL, adreno_prop_gpu_model},
};

static int adreno_getproperty(struct kgsl_device *device,
Expand Down
5 changes: 5 additions & 0 deletions include/uapi/linux/msm_kgsl.h
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ enum kgsl_timestamp_type {
#define KGSL_PROP_GAMING_BIN 0x26
#define KGSL_PROP_QUERY_CAPABILITIES 0x27
#define KGSL_PROP_CONTEXT_PROPERTY 0x28
#define KGSL_PROP_GPU_MODEL 0x29

/*
* kgsl_capabilties_properties returns a list of supported properties.
Expand Down Expand Up @@ -422,6 +423,10 @@ struct kgsl_context_property_fault {
__u32 timestamp;
};

struct kgsl_gpu_model {
char gpu_model[32];
};

/* Context property sub types */
#define KGSL_CONTEXT_PROP_FAULTS 1

Expand Down

0 comments on commit 69dc4fe

Please sign in to comment.