Loading drivers/gpu/msm/adreno.h +34 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "adreno_perfcounter.h" #include <linux/stat.h> #include <linux/delay.h> #include "kgsl_gmu.h" #include "a4xx_reg.h" Loading Loading @@ -1673,4 +1674,37 @@ static inline unsigned int counter_delta(struct kgsl_device *device, *counter = val; return ret; } static inline int adreno_perfcntr_active_oob_get( struct adreno_device *adreno_dev) { struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev); int ret; ret = kgsl_active_count_get(KGSL_DEVICE(adreno_dev)); if (ret) return ret; if (gpudev->oob_set) { ret = gpudev->oob_set(adreno_dev, OOB_PERFCNTR_SET_MASK, OOB_PERFCNTR_CHECK_MASK, OOB_PERFCNTR_CLEAR_MASK); if (ret) kgsl_active_count_put(KGSL_DEVICE(adreno_dev)); } return ret; } static inline void adreno_perfcntr_active_oob_put( struct adreno_device *adreno_dev) { struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev); if (gpudev->oob_clear) gpudev->oob_clear(adreno_dev, OOB_PERFCNTR_CLEAR_MASK); kgsl_active_count_put(KGSL_DEVICE(adreno_dev)); } #endif /*__ADRENO_H */ drivers/gpu/msm/adreno_ioctl.c +10 −5 Original line number Diff line number Diff line Loading @@ -31,14 +31,19 @@ long adreno_ioctl_perfcounter_get(struct kgsl_device_private *dev_priv, * during start(), so it is not safe to take an * active count inside that function. */ result = kgsl_active_count_get(device); if (result == 0) { result = adreno_perfcntr_active_oob_get(adreno_dev); if (result) { mutex_unlock(&device->mutex); return (long)result; } result = adreno_perfcounter_get(adreno_dev, get->groupid, get->countable, &get->offset, &get->offset_hi, PERFCOUNTER_FLAG_NONE); kgsl_active_count_put(device); } adreno_perfcntr_active_oob_put(adreno_dev); mutex_unlock(&device->mutex); return (long) result; Loading drivers/gpu/msm/adreno_perfcounter.c +4 −2 Original line number Diff line number Diff line Loading @@ -267,7 +267,8 @@ int adreno_perfcounter_read_group(struct adreno_device *adreno_dev, } mutex_lock(&device->mutex); ret = kgsl_active_count_get(device); ret = adreno_perfcntr_active_oob_get(adreno_dev); if (ret) { mutex_unlock(&device->mutex); goto done; Loading Loading @@ -296,7 +297,8 @@ int adreno_perfcounter_read_group(struct adreno_device *adreno_dev, } } kgsl_active_count_put(device); adreno_perfcntr_active_oob_put(adreno_dev); mutex_unlock(&device->mutex); /* write the data */ Loading drivers/gpu/msm/adreno_profile.c +2 −2 Original line number Diff line number Diff line Loading @@ -739,7 +739,7 @@ static ssize_t profile_assignments_write(struct file *filep, goto error_unlock; } ret = kgsl_active_count_get(device); ret = adreno_perfcntr_active_oob_get(adreno_dev); if (ret) { size = ret; goto error_unlock; Loading Loading @@ -786,7 +786,7 @@ static ssize_t profile_assignments_write(struct file *filep, size = len; error_put: kgsl_active_count_put(device); adreno_perfcntr_active_oob_put(adreno_dev); error_unlock: mutex_unlock(&device->mutex); error_free: Loading drivers/gpu/msm/kgsl_gmu.h +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ #define OOB_CPINIT_SET_MASK BIT(16) #define OOB_CPINIT_CHECK_MASK BIT(24) #define OOB_CPINIT_CLEAR_MASK BIT(24) #define OOB_PERFCNTR_SET_MASK BIT(17) #define OOB_PERFCNTR_CHECK_MASK BIT(25) #define OOB_PERFCNTR_CLEAR_MASK BIT(25) /* Bits for the flags field in the gmu structure */ enum gmu_flags { Loading Loading
drivers/gpu/msm/adreno.h +34 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include "adreno_perfcounter.h" #include <linux/stat.h> #include <linux/delay.h> #include "kgsl_gmu.h" #include "a4xx_reg.h" Loading Loading @@ -1673,4 +1674,37 @@ static inline unsigned int counter_delta(struct kgsl_device *device, *counter = val; return ret; } static inline int adreno_perfcntr_active_oob_get( struct adreno_device *adreno_dev) { struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev); int ret; ret = kgsl_active_count_get(KGSL_DEVICE(adreno_dev)); if (ret) return ret; if (gpudev->oob_set) { ret = gpudev->oob_set(adreno_dev, OOB_PERFCNTR_SET_MASK, OOB_PERFCNTR_CHECK_MASK, OOB_PERFCNTR_CLEAR_MASK); if (ret) kgsl_active_count_put(KGSL_DEVICE(adreno_dev)); } return ret; } static inline void adreno_perfcntr_active_oob_put( struct adreno_device *adreno_dev) { struct adreno_gpudev *gpudev = ADRENO_GPU_DEVICE(adreno_dev); if (gpudev->oob_clear) gpudev->oob_clear(adreno_dev, OOB_PERFCNTR_CLEAR_MASK); kgsl_active_count_put(KGSL_DEVICE(adreno_dev)); } #endif /*__ADRENO_H */
drivers/gpu/msm/adreno_ioctl.c +10 −5 Original line number Diff line number Diff line Loading @@ -31,14 +31,19 @@ long adreno_ioctl_perfcounter_get(struct kgsl_device_private *dev_priv, * during start(), so it is not safe to take an * active count inside that function. */ result = kgsl_active_count_get(device); if (result == 0) { result = adreno_perfcntr_active_oob_get(adreno_dev); if (result) { mutex_unlock(&device->mutex); return (long)result; } result = adreno_perfcounter_get(adreno_dev, get->groupid, get->countable, &get->offset, &get->offset_hi, PERFCOUNTER_FLAG_NONE); kgsl_active_count_put(device); } adreno_perfcntr_active_oob_put(adreno_dev); mutex_unlock(&device->mutex); return (long) result; Loading
drivers/gpu/msm/adreno_perfcounter.c +4 −2 Original line number Diff line number Diff line Loading @@ -267,7 +267,8 @@ int adreno_perfcounter_read_group(struct adreno_device *adreno_dev, } mutex_lock(&device->mutex); ret = kgsl_active_count_get(device); ret = adreno_perfcntr_active_oob_get(adreno_dev); if (ret) { mutex_unlock(&device->mutex); goto done; Loading Loading @@ -296,7 +297,8 @@ int adreno_perfcounter_read_group(struct adreno_device *adreno_dev, } } kgsl_active_count_put(device); adreno_perfcntr_active_oob_put(adreno_dev); mutex_unlock(&device->mutex); /* write the data */ Loading
drivers/gpu/msm/adreno_profile.c +2 −2 Original line number Diff line number Diff line Loading @@ -739,7 +739,7 @@ static ssize_t profile_assignments_write(struct file *filep, goto error_unlock; } ret = kgsl_active_count_get(device); ret = adreno_perfcntr_active_oob_get(adreno_dev); if (ret) { size = ret; goto error_unlock; Loading Loading @@ -786,7 +786,7 @@ static ssize_t profile_assignments_write(struct file *filep, size = len; error_put: kgsl_active_count_put(device); adreno_perfcntr_active_oob_put(adreno_dev); error_unlock: mutex_unlock(&device->mutex); error_free: Loading
drivers/gpu/msm/kgsl_gmu.h +3 −0 Original line number Diff line number Diff line Loading @@ -70,6 +70,9 @@ #define OOB_CPINIT_SET_MASK BIT(16) #define OOB_CPINIT_CHECK_MASK BIT(24) #define OOB_CPINIT_CLEAR_MASK BIT(24) #define OOB_PERFCNTR_SET_MASK BIT(17) #define OOB_PERFCNTR_CHECK_MASK BIT(25) #define OOB_PERFCNTR_CLEAR_MASK BIT(25) /* Bits for the flags field in the gmu structure */ enum gmu_flags { Loading