#include <linux/circ_buf.h>
#include <linux/debugfs.h>
#include <linux/kfifo.h>
#include <linux/uaccess.h>
#include <linux/wait.h>
#include <drm/drm_file.h>
#include "msm_drv.h"
#include "msm_gpu.h"
#include "msm_gem.h"
bool rd_full = …;
MODULE_PARM_DESC(…) …;
module_param_named(rd_full, rd_full, bool, 0600);
#ifdef CONFIG_DEBUG_FS
enum rd_sect_type { … };
#define BUF_SZ …
#define circ_count(circ) …
#define circ_count_to_end(circ) …
#define circ_space(circ) …
#define circ_space_to_end(circ) …
struct msm_rd_state { … };
static void rd_write(struct msm_rd_state *rd, const void *buf, int sz)
{ … }
static void rd_write_section(struct msm_rd_state *rd,
enum rd_sect_type type, const void *buf, int sz)
{ … }
static ssize_t rd_read(struct file *file, char __user *buf,
size_t sz, loff_t *ppos)
{ … }
static int rd_open(struct inode *inode, struct file *file)
{ … }
static int rd_release(struct inode *inode, struct file *file)
{ … }
static const struct file_operations rd_debugfs_fops = …;
static void rd_cleanup(struct msm_rd_state *rd)
{ … }
static struct msm_rd_state *rd_init(struct drm_minor *minor, const char *name)
{ … }
int msm_rd_debugfs_init(struct drm_minor *minor)
{ … }
void msm_rd_debugfs_cleanup(struct msm_drm_private *priv)
{ … }
static void snapshot_buf(struct msm_rd_state *rd,
struct msm_gem_submit *submit, int idx,
uint64_t iova, uint32_t size, bool full)
{ … }
void msm_rd_dump_submit(struct msm_rd_state *rd, struct msm_gem_submit *submit,
const char *fmt, ...)
{ … }
#endif