0001
0002
0003
0004
0005
0006
0007 #ifndef __HOST1X_DEBUG_H
0008 #define __HOST1X_DEBUG_H
0009
0010 #include <linux/debugfs.h>
0011 #include <linux/seq_file.h>
0012
0013 struct host1x;
0014
0015 struct output {
0016 void (*fn)(void *ctx, const char *str, size_t len, bool cont);
0017 void *ctx;
0018 char buf[256];
0019 };
0020
0021 static inline void write_to_seqfile(void *ctx, const char *str, size_t len,
0022 bool cont)
0023 {
0024 seq_write((struct seq_file *)ctx, str, len);
0025 }
0026
0027 static inline void write_to_printk(void *ctx, const char *str, size_t len,
0028 bool cont)
0029 {
0030 if (cont)
0031 pr_cont("%s", str);
0032 else
0033 pr_info("%s", str);
0034 }
0035
0036 void __printf(2, 3) host1x_debug_output(struct output *o, const char *fmt, ...);
0037 void __printf(2, 3) host1x_debug_cont(struct output *o, const char *fmt, ...);
0038
0039 extern unsigned int host1x_debug_trace_cmdbuf;
0040
0041 void host1x_debug_init(struct host1x *host1x);
0042 void host1x_debug_deinit(struct host1x *host1x);
0043 void host1x_debug_dump(struct host1x *host1x);
0044 void host1x_debug_dump_syncpts(struct host1x *host1x);
0045
0046 #endif