@@ -68,6 +68,9 @@ static int crc_control_show(struct seq_file *m, void *data)
{
struct drm_crtc *crtc = m->private;
+ if (crtc->funcs->get_crc_sources)
+ crtc->funcs->get_crc_sources(m, crtc);
+
seq_printf(m, "%s\n", crtc->crc.source);
return 0;
@@ -690,6 +690,16 @@ struct drm_crtc_funcs {
* 0 on success or a negative error code on failure.
*/
int (*pre_crc_read)(struct drm_crtc *crtc);
+ /**
+ * @get_crc_sources:
+ *
+ * prints a list of available valid sources for CRC generation on
+ * seq_file
+ *
+ * This callback is optional if the driver does not support exporting of
+ * possible CRC sources list
+ */
+ void (*get_crc_sources)(struct seq_file *m, struct drm_crtc *crtc);
/**
* @atomic_print_state:
This patch implements a callback function "get_crc_sources" which will be called during read of control node. It is an optional callback function and if driver implements this callback, driver should print list of available CRC sources in seq_file privided as an input to the callback. Signed-off-by: Mahesh Kumar <mahesh1.kumar@intel.com> Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_debugfs_crc.c | 3 +++ include/drm/drm_crtc.h | 10 ++++++++++ 2 files changed, 13 insertions(+)