Loading drivers/gpu/msm/adreno.c +53 −2 Original line number Diff line number Diff line Loading @@ -1686,7 +1686,7 @@ int adreno_reset(struct kgsl_device *device) } static int adreno_getproperty(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes) { Loading Loading @@ -1812,6 +1812,57 @@ static int adreno_getproperty(struct kgsl_device *device, status = 0; } break; case KGSL_PROP_UCODE_VERSION: { struct kgsl_ucode_version ucode; if (sizebytes != sizeof(ucode)) { status = -EINVAL; break; } memset(&ucode, 0, sizeof(ucode)); ucode.pfp = adreno_dev->pfp_fw_version; ucode.pm4 = adreno_dev->pm4_fw_version; if (copy_to_user(value, &ucode, sizeof(ucode))) { status = -EFAULT; break; } status = 0; } break; case KGSL_PROP_GPMU_VERSION: { struct kgsl_gpmu_version gpmu; if (adreno_dev->gpucore == NULL) { status = -EINVAL; break; } if (!ADRENO_FEATURE(adreno_dev, ADRENO_GPMU)) { status = -EOPNOTSUPP; break; } if (sizebytes != sizeof(gpmu)) { status = -EINVAL; break; } memset(&gpmu, 0, sizeof(gpmu)); gpmu.major = adreno_dev->gpucore->gpmu_major; gpmu.minor = adreno_dev->gpucore->gpmu_minor; gpmu.features = adreno_dev->gpucore->gpmu_features; if (copy_to_user(value, &gpmu, sizeof(gpmu))) { status = -EFAULT; break; } status = 0; } break; default: status = -EINVAL; } Loading Loading @@ -1880,7 +1931,7 @@ int adreno_set_constraint(struct kgsl_device *device, } static int adreno_setproperty(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, unsigned int type, void __user *value, unsigned int sizebytes) { Loading drivers/gpu/msm/adreno_a5xx.c +5 −9 Original line number Diff line number Diff line Loading @@ -1486,7 +1486,8 @@ int a5xx_rb_init(struct adreno_device *adreno_dev, } static int _load_firmware(struct adreno_device *adreno_dev, const char *fwfile, struct kgsl_memdesc *ucode, size_t *ucode_size) struct kgsl_memdesc *ucode, size_t *ucode_size, unsigned int *ucode_version) { struct kgsl_device *device = &adreno_dev->dev; const struct firmware *fw = NULL; Loading @@ -1508,6 +1509,7 @@ static int _load_firmware(struct adreno_device *adreno_dev, const char *fwfile, memcpy(ucode->hostptr, &fw->data[4], fw->size - 4); *ucode_size = (fw->size - 4) / sizeof(uint32_t); *ucode_version = fw->data[4]; release_firmware(fw); Loading @@ -1521,22 +1523,16 @@ static int _load_firmware(struct adreno_device *adreno_dev, const char *fwfile, int a5xx_microcode_read(struct adreno_device *adreno_dev) { int ret; uint *ucode; ret = _load_firmware(adreno_dev, adreno_dev->gpucore->pm4fw_name, &adreno_dev->pm4, &adreno_dev->pm4_fw_size); &adreno_dev->pm4_fw_size, &adreno_dev->pm4_fw_version); if (ret) return ret; ret = _load_firmware(adreno_dev, adreno_dev->gpucore->pfpfw_name, &adreno_dev->pfp, &adreno_dev->pfp_fw_size); ucode = (int *) adreno_dev->pm4.hostptr; adreno_dev->pm4_fw_version = ucode[0]; ucode = (int *) adreno_dev->pfp.hostptr; adreno_dev->pfp_fw_version = ucode[0]; &adreno_dev->pfp_fw_size, &adreno_dev->pfp_fw_version); if (ret) return ret; Loading drivers/gpu/msm/adreno_compat.c +2 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ #include "adreno_compat.h" int adreno_getproperty_compat(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes) { Loading Loading @@ -101,7 +101,7 @@ int adreno_getproperty_compat(struct kgsl_device *device, } int adreno_setproperty_compat(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, unsigned int type, void __user *value, unsigned int sizebytes) { Loading drivers/gpu/msm/adreno_compat.h +4 −4 Original line number Diff line number Diff line Loading @@ -19,12 +19,12 @@ #include "kgsl_device.h" int adreno_getproperty_compat(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes); int adreno_setproperty_compat(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, unsigned int type, void __user *value, unsigned int sizebytes); Loading @@ -34,14 +34,14 @@ long adreno_compat_ioctl(struct kgsl_device_private *dev_priv, #else static inline int adreno_getproperty_compat(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes) { BUG(); } static inline int adreno_setproperty_compat(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, *dev_priv, unsigned int type, void __user *value, unsigned int sizebytes) { BUG(); Loading drivers/gpu/msm/kgsl_device.h +4 −4 Original line number Diff line number Diff line Loading @@ -130,10 +130,10 @@ struct kgsl_functable { int (*start) (struct kgsl_device *device, int priority); int (*stop) (struct kgsl_device *device); int (*getproperty) (struct kgsl_device *device, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, size_t sizebytes); int (*getproperty_compat) (struct kgsl_device *device, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, size_t sizebytes); int (*waittimestamp) (struct kgsl_device *device, struct kgsl_context *context, unsigned int timestamp, Loading Loading @@ -164,10 +164,10 @@ struct kgsl_functable { long (*compat_ioctl) (struct kgsl_device_private *dev_priv, unsigned int cmd, unsigned long arg); int (*setproperty) (struct kgsl_device_private *dev_priv, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, unsigned int sizebytes); int (*setproperty_compat) (struct kgsl_device_private *dev_priv, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, unsigned int sizebytes); void (*drawctxt_sched)(struct kgsl_device *device, struct kgsl_context *context); Loading Loading
drivers/gpu/msm/adreno.c +53 −2 Original line number Diff line number Diff line Loading @@ -1686,7 +1686,7 @@ int adreno_reset(struct kgsl_device *device) } static int adreno_getproperty(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes) { Loading Loading @@ -1812,6 +1812,57 @@ static int adreno_getproperty(struct kgsl_device *device, status = 0; } break; case KGSL_PROP_UCODE_VERSION: { struct kgsl_ucode_version ucode; if (sizebytes != sizeof(ucode)) { status = -EINVAL; break; } memset(&ucode, 0, sizeof(ucode)); ucode.pfp = adreno_dev->pfp_fw_version; ucode.pm4 = adreno_dev->pm4_fw_version; if (copy_to_user(value, &ucode, sizeof(ucode))) { status = -EFAULT; break; } status = 0; } break; case KGSL_PROP_GPMU_VERSION: { struct kgsl_gpmu_version gpmu; if (adreno_dev->gpucore == NULL) { status = -EINVAL; break; } if (!ADRENO_FEATURE(adreno_dev, ADRENO_GPMU)) { status = -EOPNOTSUPP; break; } if (sizebytes != sizeof(gpmu)) { status = -EINVAL; break; } memset(&gpmu, 0, sizeof(gpmu)); gpmu.major = adreno_dev->gpucore->gpmu_major; gpmu.minor = adreno_dev->gpucore->gpmu_minor; gpmu.features = adreno_dev->gpucore->gpmu_features; if (copy_to_user(value, &gpmu, sizeof(gpmu))) { status = -EFAULT; break; } status = 0; } break; default: status = -EINVAL; } Loading Loading @@ -1880,7 +1931,7 @@ int adreno_set_constraint(struct kgsl_device *device, } static int adreno_setproperty(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, unsigned int type, void __user *value, unsigned int sizebytes) { Loading
drivers/gpu/msm/adreno_a5xx.c +5 −9 Original line number Diff line number Diff line Loading @@ -1486,7 +1486,8 @@ int a5xx_rb_init(struct adreno_device *adreno_dev, } static int _load_firmware(struct adreno_device *adreno_dev, const char *fwfile, struct kgsl_memdesc *ucode, size_t *ucode_size) struct kgsl_memdesc *ucode, size_t *ucode_size, unsigned int *ucode_version) { struct kgsl_device *device = &adreno_dev->dev; const struct firmware *fw = NULL; Loading @@ -1508,6 +1509,7 @@ static int _load_firmware(struct adreno_device *adreno_dev, const char *fwfile, memcpy(ucode->hostptr, &fw->data[4], fw->size - 4); *ucode_size = (fw->size - 4) / sizeof(uint32_t); *ucode_version = fw->data[4]; release_firmware(fw); Loading @@ -1521,22 +1523,16 @@ static int _load_firmware(struct adreno_device *adreno_dev, const char *fwfile, int a5xx_microcode_read(struct adreno_device *adreno_dev) { int ret; uint *ucode; ret = _load_firmware(adreno_dev, adreno_dev->gpucore->pm4fw_name, &adreno_dev->pm4, &adreno_dev->pm4_fw_size); &adreno_dev->pm4_fw_size, &adreno_dev->pm4_fw_version); if (ret) return ret; ret = _load_firmware(adreno_dev, adreno_dev->gpucore->pfpfw_name, &adreno_dev->pfp, &adreno_dev->pfp_fw_size); ucode = (int *) adreno_dev->pm4.hostptr; adreno_dev->pm4_fw_version = ucode[0]; ucode = (int *) adreno_dev->pfp.hostptr; adreno_dev->pfp_fw_version = ucode[0]; &adreno_dev->pfp_fw_size, &adreno_dev->pfp_fw_version); if (ret) return ret; Loading
drivers/gpu/msm/adreno_compat.c +2 −2 Original line number Diff line number Diff line Loading @@ -20,7 +20,7 @@ #include "adreno_compat.h" int adreno_getproperty_compat(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes) { Loading Loading @@ -101,7 +101,7 @@ int adreno_getproperty_compat(struct kgsl_device *device, } int adreno_setproperty_compat(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, unsigned int type, void __user *value, unsigned int sizebytes) { Loading
drivers/gpu/msm/adreno_compat.h +4 −4 Original line number Diff line number Diff line Loading @@ -19,12 +19,12 @@ #include "kgsl_device.h" int adreno_getproperty_compat(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes); int adreno_setproperty_compat(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, unsigned int type, void __user *value, unsigned int sizebytes); Loading @@ -34,14 +34,14 @@ long adreno_compat_ioctl(struct kgsl_device_private *dev_priv, #else static inline int adreno_getproperty_compat(struct kgsl_device *device, enum kgsl_property_type type, unsigned int type, void __user *value, size_t sizebytes) { BUG(); } static inline int adreno_setproperty_compat(struct kgsl_device_private *dev_priv, enum kgsl_property_type type, *dev_priv, unsigned int type, void __user *value, unsigned int sizebytes) { BUG(); Loading
drivers/gpu/msm/kgsl_device.h +4 −4 Original line number Diff line number Diff line Loading @@ -130,10 +130,10 @@ struct kgsl_functable { int (*start) (struct kgsl_device *device, int priority); int (*stop) (struct kgsl_device *device); int (*getproperty) (struct kgsl_device *device, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, size_t sizebytes); int (*getproperty_compat) (struct kgsl_device *device, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, size_t sizebytes); int (*waittimestamp) (struct kgsl_device *device, struct kgsl_context *context, unsigned int timestamp, Loading Loading @@ -164,10 +164,10 @@ struct kgsl_functable { long (*compat_ioctl) (struct kgsl_device_private *dev_priv, unsigned int cmd, unsigned long arg); int (*setproperty) (struct kgsl_device_private *dev_priv, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, unsigned int sizebytes); int (*setproperty_compat) (struct kgsl_device_private *dev_priv, enum kgsl_property_type type, void __user *value, unsigned int type, void __user *value, unsigned int sizebytes); void (*drawctxt_sched)(struct kgsl_device *device, struct kgsl_context *context); Loading