diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c index 5c9e7758420d..04fd2502fe71 100644 --- a/drivers/gpu/msm/adreno.c +++ b/drivers/gpu/msm/adreno.c @@ -2339,6 +2339,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) { @@ -2482,6 +2493,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, diff --git a/include/uapi/linux/msm_kgsl.h b/include/uapi/linux/msm_kgsl.h index ad91d4107ba4..671d789b983f 100644 --- a/include/uapi/linux/msm_kgsl.h +++ b/include/uapi/linux/msm_kgsl.h @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ /* - * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved. + * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved. */ #ifndef _UAPI_MSM_KGSL_H @@ -341,6 +341,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_capabilities_properties returns a list of supported properties. @@ -423,6 +424,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