Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/crc-debugfs: Add notes about CRC<->commit interactions

CRC generation can be impacted by commits coming from userspace, and
enabling CRC generation may itself trigger a commit. Add notes about
this to the kerneldoc.

Changes since v1:
- Clarified that anything that would disable CRCs counts as a full
modeset, and so userspace needs to reconfigure after full modesets

Changes since v2:
- Add these notes
- Rebase onto drm-misc-next (trivial conflict in comment)

Signed-off-by: Brian Starkey <brian.starkey@arm.com>
Signed-off-by: Ayan Kumar Halder <ayan.halder@arm.com>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Link:- https://patchwork.freedesktop.org/patch/321974/

authored by

Brian Starkey and committed by
Ayan kumar halder
178e5f3a bc0380b9

+13
+9
drivers/gpu/drm/drm_debugfs_crc.c
··· 69 69 * implement &drm_crtc_funcs.set_crc_source and &drm_crtc_funcs.verify_crc_source. 70 70 * The debugfs files are automatically set up if those vfuncs are set. CRC samples 71 71 * need to be captured in the driver by calling drm_crtc_add_crc_entry(). 72 + * Depending on the driver and HW requirements, &drm_crtc_funcs.set_crc_source 73 + * may result in a commit (even a full modeset). 74 + * 75 + * CRC results must be reliable across non-full-modeset atomic commits, so if a 76 + * commit via DRM_IOCTL_MODE_ATOMIC would disable or otherwise interfere with 77 + * CRC generation, then the driver must mark that commit as a full modeset 78 + * (drm_atomic_crtc_needs_modeset() should return true). As a result, to ensure 79 + * consistent results, generic userspace must re-setup CRC generation after a 80 + * legacy SETCRTC or an atomic commit with DRM_MODE_ATOMIC_ALLOW_MODESET. 72 81 */ 73 82 74 83 static int crc_control_show(struct seq_file *m, void *data)
+4
include/drm/drm_crtc.h
··· 756 756 * provided from the configured source. Drivers must accept an "auto" 757 757 * source name that will select a default source for this CRTC. 758 758 * 759 + * This may trigger an atomic modeset commit if necessary, to enable CRC 760 + * generation. 761 + * 759 762 * Note that "auto" can depend upon the current modeset configuration, 760 763 * e.g. it could pick an encoder or output specific CRC sampling point. 761 764 * ··· 770 767 * 0 on success or a negative error code on failure. 771 768 */ 772 769 int (*set_crc_source)(struct drm_crtc *crtc, const char *source); 770 + 773 771 /** 774 772 * @verify_crc_source: 775 773 *