drm/rockchip: debugfs: Add extra enable option for vop dump feature

Currently, the dump vop buffer feature is turned on and off through
`CONFIG_ROCKCHIP_DRM_DEBUG` marco. We want to control this at
runtime, so this patch adds a new option for enable to dump debugfs.

- DUMP_DISABLE: Disable dump and do not record plane info into list.
- DUMP_ENABLE: Record plane info into list.
- DUMP_KEEP: Record plane info into list and keep to dump plane.

Signed-off-by: Chaoyi Chen <chaoyi.chen@rock-chips.com>
Change-Id: I96ad88068b383e93071896c63c3cc68aa05c8834
This commit is contained in:
Chaoyi Chen
2024-03-15 17:43:29 +08:00
committed by Tao Huang
parent d5cb3a119c
commit a295cb5909
2 changed files with 11 additions and 2 deletions

View File

@@ -119,9 +119,10 @@ int rockchip_drm_dump_plane_buffer(struct vop_dump_info *dump_info, int frame_co
static int rockchip_drm_dump_buffer_show(struct seq_file *m, void *data)
{
seq_puts(m, " echo dump > dump to dump one frame\n");
seq_puts(m, " echo enable > Enable dump feature\n");
seq_puts(m, " echo dump > Immediately dump the current frame\n");
seq_puts(m, " echo dumpon > dump to start vop keep dumping\n");
seq_puts(m, " echo dumpoff > dump to stop keep dumping\n");
seq_puts(m, " echo dumpoff > Disable dump feature and stop keep dumping\n");
seq_puts(m, " echo dumpn > dump n is the number of dump times\n");
seq_puts(m, " dump path is /data\n");
@@ -180,6 +181,8 @@ rockchip_drm_dump_buffer_write(struct file *file, const char __user *ubuf,
drm_modeset_unlock_all(crtc->dev);
rockchip_crtc->frame_count++;
}
} else if (strncmp(buf, "enable", 6) == 0) {
rockchip_crtc->vop_dump_status = DUMP_ENABLE;
} else {
return -EINVAL;
}

View File

@@ -47,8 +47,14 @@ struct vop_dump_list {
struct vop_dump_info dump_info;
};
/**
* @DUMP_DISABLE: Disable dump and do not record plane info into list.
* @DUMP_ENABLE: Record plane info into list.
* @DUMP_KEEP: Record plane info into list and keep to dump plane.
*/
enum vop_dump_status {
DUMP_DISABLE = 0,
DUMP_ENABLE,
DUMP_KEEP
};