From: Brian Starkey <brian.starkey@arm.com>
To: Liviu Dudau <Liviu.Dudau@arm.com>,
"james qian wang (Arm Technology China)"
<james.qian.wang@arm.com>,
"Lowry Li (Arm Technology China)" <Lowry.Li@arm.com>,
nd@arm.com, Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org, LKML <linux-kernel@vger.kernel.org>
Subject: [PATCH] drm/crc-debugfs: Add notes about CRC<->commit interactions
Date: Mon, 5 Aug 2019 16:11:43 +0100 [thread overview]
Message-ID: <20190805151143.12317-1-brian.starkey@arm.com> (raw)
In-Reply-To: <20190802140910.GN7444@phenom.ffwll.local>
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.
Signed-off-by: Brian Starkey <brian.starkey@arm.com>
---
I might have got the wrong end of the stick, but this is what I
understood from what you said.
Cheers,
-Brian
drivers/gpu/drm/drm_debugfs_crc.c | 15 +++++++++++----
include/drm/drm_crtc.h | 3 +++
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c
index 7ca486d750e9..1dff956bcc74 100644
--- a/drivers/gpu/drm/drm_debugfs_crc.c
+++ b/drivers/gpu/drm/drm_debugfs_crc.c
@@ -65,10 +65,17 @@
* it submits. In this general case, the maximum userspace can do is to compare
* the reported CRCs of frames that should have the same contents.
*
- * On the driver side the implementation effort is minimal, drivers only need to
- * implement &drm_crtc_funcs.set_crc_source. The debugfs files are automatically
- * set up if that vfunc is set. CRC samples need to be captured in the driver by
- * calling drm_crtc_add_crc_entry().
+ * On the driver side the implementation effort is minimal, drivers only need
+ * to implement &drm_crtc_funcs.set_crc_source. The debugfs files are
+ * automatically set up if that vfunc is set. CRC samples need to be captured
+ * in the driver by calling drm_crtc_add_crc_entry(). Depending on the driver
+ * and HW requirements, &drm_crtc_funcs.set_crc_source may result in a commit
+ * (even a full modeset).
+ *
+ * It's also possible that a "normal" commit via DRM_IOCTL_MODE_ATOMIC or the
+ * legacy paths may interfere with CRC generation. So, in the general case,
+ * userspace can't rely on the values in crtc-N/crc/data being valid
+ * across a commit.
*/
static int crc_control_show(struct seq_file *m, void *data)
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 128d8b210621..0f7ea094a900 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -756,6 +756,8 @@ struct drm_crtc_funcs {
* provided from the configured source. Drivers must accept an "auto"
* source name that will select a default source for this CRTC.
*
+ * This may trigger a commit if necessary, to enable CRC generation.
+ *
* Note that "auto" can depend upon the current modeset configuration,
* e.g. it could pick an encoder or output specific CRC sampling point.
*
@@ -767,6 +769,7 @@ struct drm_crtc_funcs {
* 0 on success or a negative error code on failure.
*/
int (*set_crc_source)(struct drm_crtc *crtc, const char *source);
+
/**
* @verify_crc_source:
*
--
2.17.1
next prev parent reply other threads:[~2019-08-05 15:11 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-01 10:42 drm/komeda: Add support for generation of CRC data per frame Liviu Dudau
2019-08-02 9:39 ` Brian Starkey
2019-08-02 9:52 ` Daniel Vetter
2019-08-02 10:13 ` Brian Starkey
2019-08-02 14:09 ` Daniel Vetter
2019-08-05 15:11 ` Brian Starkey [this message]
2019-08-05 16:24 ` [PATCH] drm/crc-debugfs: Add notes about CRC<->commit interactions Daniel Vetter
2019-08-05 16:54 ` Brian Starkey
2019-08-06 9:12 ` Daniel Vetter
2019-08-06 10:48 ` [PATCH v2] " Brian Starkey
2019-08-06 11:45 ` Daniel Vetter
2019-08-02 14:50 ` drm/komeda: Add support for generation of CRC data per frame Liviu Dudau
2019-08-02 14:58 ` Daniel Vetter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190805151143.12317-1-brian.starkey@arm.com \
--to=brian.starkey@arm.com \
--cc=Liviu.Dudau@arm.com \
--cc=Lowry.Li@arm.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=james.qian.wang@arm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nd@arm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox