BASE_JD_EVENT_TERMINATED;
/* fall through */
default:
+ meson_gpu_data_invalid_count ++;
dev_warn(kbdev->dev, "error detected from slot %d, job status 0x%08x (%s)",
i, completion_code,
kbase_exception_name
#endif
-
-
+extern int meson_gpu_data_invalid_count;
+extern int meson_gpu_fault;
return;
}
- if (katom->event_code != BASE_JD_EVENT_DONE)
+ if (katom->event_code != BASE_JD_EVENT_DONE) {
+ meson_gpu_fault ++;
dev_err(kbdev->dev,
"t6xx: GPU fault 0x%02lx from job slot %d\n",
- (unsigned long)katom->event_code,
- katom->slot_nr);
+ (unsigned long)katom->event_code,
+ katom->slot_nr);
+ }
if (kbase_hw_has_issue(kbdev, BASE_HW_ISSUE_8316))
kbase_as_poking_timer_release_atom(kbdev, kctx, katom);
int mpgpu_class_init(void);
void mpgpu_class_exit(void);
void mali_gpu_utilization_callback(int utilization_pp);
+u32 mpgpu_get_gpu_err_count(void);
#endif /* MESON_MAIN_H_ */
#include <asm/io.h>
#endif
+//#include <mali_kbase.h>
#include "meson_main2.h"
+int meson_gpu_data_invalid_count = 0;
+int meson_gpu_fault = 0;
+
static ssize_t domain_stat_read(struct class *class,
struct class_attribute *attr, char *buf)
{
}
#endif
+u32 mpgpu_get_gpu_err_count(void)
+{
+ return (meson_gpu_fault + meson_gpu_data_invalid_count);
+}
+
+static ssize_t meson_gpu_get_err_count(struct class *class,
+ struct class_attribute *attr, char *buf)
+{
+ return sprintf(buf, "%d\n", mpgpu_get_gpu_err_count());
+}
+
+static ssize_t mpgpu_set_err_count(struct class *class,
+ struct class_attribute *attr, const char *buf, size_t count)
+{
+ int ret;
+ unsigned int val;
+
+ ret = kstrtouint(buf, 10, &val);
+ if (0 != ret)
+ return -EINVAL;
+
+ meson_gpu_fault = val;
+
+ return count;
+}
+
static struct class_attribute mali_class_attrs[] = {
__ATTR(domain_stat, 0644, domain_stat_read, NULL),
__ATTR(mpgpucmd, 0644, NULL, mpgpu_write),
#if 0
__ATTR(cur_pp, 0644, current_pp_read, current_pp_write),
#endif
+ __ATTR(gpu_err, 0644, meson_gpu_get_err_count, mpgpu_set_err_count),
};
static struct class mpgpu_class = {
BASE_JD_EVENT_TERMINATED;
/* fall through */
default:
+ meson_gpu_data_invalid_count ++;
dev_warn(kbdev->dev, "error detected from slot %d, job status 0x%08x (%s)",
i, completion_code,
kbase_exception_name
#endif
-
-
+extern int meson_gpu_data_invalid_count;
+extern int meson_gpu_fault;
return;
}
- if (katom->event_code != BASE_JD_EVENT_DONE)
+ if (katom->event_code != BASE_JD_EVENT_DONE) {
+ meson_gpu_fault ++;
dev_err(kbdev->dev,
"t6xx: GPU fault 0x%02lx from job slot %d\n",
- (unsigned long)katom->event_code,
- katom->slot_nr);
+ (unsigned long)katom->event_code,
+ katom->slot_nr);
+ }
if (kbase_hw_has_issue(kbdev, BASE_HW_ISSUE_8316))
kbase_as_poking_timer_release_atom(kbdev, kctx, katom);
u32 mpgpu_get_utilization(void);
u32 mpgpu_get_util_gl_share(void);
u32 mpgpu_get_util_cl_share(u32 *util);
+u32 mpgpu_get_gpu_err_count(void);
#endif /* MESON_MAIN_H_ */
#include <asm/io.h>
#endif
+//#include <mali_kbase.h>
#include "meson_main2.h"
+int meson_gpu_data_invalid_count = 0;
+int meson_gpu_fault = 0;
+
static ssize_t domain_stat_read(struct class *class,
struct class_attribute *attr, char *buf)
{
return sprintf(buf, "%d %d\n", val[0], val[1]);
}
+u32 mpgpu_get_gpu_err_count(void)
+{
+ return (meson_gpu_fault + meson_gpu_data_invalid_count);
+}
+
+static ssize_t meson_gpu_get_err_count(struct class *class,
+ struct class_attribute *attr, char *buf)
+{
+ return sprintf(buf, "%d\n", mpgpu_get_gpu_err_count());
+}
+
+static ssize_t mpgpu_set_err_count(struct class *class,
+ struct class_attribute *attr, const char *buf, size_t count)
+{
+ int ret;
+ unsigned int val;
+
+ ret = kstrtouint(buf, 10, &val);
+ if (0 != ret)
+ return -EINVAL;
+
+ meson_gpu_fault = val;
+
+ return count;
+}
+
static struct class_attribute mali_class_attrs[] = {
__ATTR(domain_stat, 0644, domain_stat_read, NULL),
__ATTR(mpgpucmd, 0644, NULL, mpgpu_write),
__ATTR(utilization, 0644, utilization_read, NULL),
__ATTR(util_gl, 0644, util_gl_share_read, NULL),
__ATTR(util_cl, 0644, util_cl_share_read, NULL),
+ __ATTR(gpu_err, 0644, meson_gpu_get_err_count, mpgpu_set_err_count),
};
static struct class mpgpu_class = {