Skip to content

Commit 760f71e

Browse files
committed
drm: document driver interface for CRC capturing
This was missed in Tomeu's patch. Also remove the kerneldoc for the internal function, we don't document that in general. While at it word-smith the docs slightly for more clarity. Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170322083617.13361-4-daniel.vetter@ffwll.ch
1 parent 4834442 commit 760f71e

3 files changed

Lines changed: 13 additions & 12 deletions

File tree

‎Documentation/gpu/drm-uapi.rst‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,9 @@ Display CRC Support
207207
.. kernel-doc:: drivers/gpu/drm/drm_debugfs_crc.c
208208
:doc: CRC ABI
209209

210+
.. kernel-doc:: drivers/gpu/drm/drm_debugfs_crc.c
211+
:export:
212+
210213
VBlank event handling
211214
=====================
212215

‎drivers/gpu/drm/drm_debugfs_crc.c‎

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
* DOC: CRC ABI
3737
*
3838
* DRM device drivers can provide to userspace CRC information of each frame as
39-
* it reached a given hardware component (a "source").
39+
* it reached a given hardware component (a CRC sampling "source").
4040
*
4141
* Userspace can control generation of CRCs in a given CRTC by writing to the
4242
* file dri/0/crtc-N/crc/control in debugfs, with N being the index of the CRTC.
@@ -57,6 +57,11 @@
5757
* rely on being able to generate matching CRC values for the frame contents that
5858
* it submits. In this general case, the maximum userspace can do is to compare
5959
* the reported CRCs of frames that should have the same contents.
60+
*
61+
* On the driver side the implementation effort is minimal, drivers only need to
62+
* implement &drm_crtc_funcs.set_crc_source. The debugfs files are automatically
63+
* set up if that vfunc is set. CRC samples need to be captured in the driver by
64+
* calling drm_crtc_add_crc_entry().
6065
*/
6166

6267
static int crc_control_show(struct seq_file *m, void *data)
@@ -280,16 +285,6 @@ static const struct file_operations drm_crtc_crc_data_fops = {
280285
.release = crtc_crc_release,
281286
};
282287

283-
/**
284-
* drm_debugfs_crtc_crc_add - Add files to debugfs for capture of frame CRCs
285-
* @crtc: CRTC to whom the frames will belong
286-
*
287-
* Adds files to debugfs directory that allows userspace to control the
288-
* generation of frame CRCs and to read them.
289-
*
290-
* Returns:
291-
* Zero on success, error code on failure.
292-
*/
293288
int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
294289
{
295290
struct dentry *crc_ent, *ent;

‎include/drm/drm_crtc.h‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,9 +590,12 @@ struct drm_crtc_funcs {
590590
* When CRC generation is enabled, the driver should call
591591
* drm_crtc_add_crc_entry() at each frame, providing any information
592592
* that characterizes the frame contents in the crcN arguments, as
593-
* provided from the configured source. Drivers must accept a "auto"
593+
* provided from the configured source. Drivers must accept an "auto"
594594
* source name that will select a default source for this CRTC.
595595
*
596+
* Note that "auto" can depend upon the current modeset configuration,
597+
* e.g. it could pick an encoder or output specific CRC sampling point.
598+
*
596599
* This callback is optional if the driver does not support any CRC
597600
* generation functionality.
598601
*

0 commit comments

Comments
 (0)