Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp2876642ybh; Mon, 5 Aug 2019 08:14:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqxS5cxSYnTKeZVzwz9hkJqGl1Qhvs4VarD6+uljqzPEJ4gHENM45LAkCn/JbWQYAv6hpgeR X-Received: by 2002:a63:2784:: with SMTP id n126mr30592193pgn.92.1565018065742; Mon, 05 Aug 2019 08:14:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565018065; cv=none; d=google.com; s=arc-20160816; b=NXKIyyPTkDa0EzQe3Z0Uq+E47SxfySp9swTERZCglDqXYdcWWsCXy6RL43Zh4f9hbr qqoMOYjjFsBEdhId/sh1VjcjJYiWbwxj/601+AwyDgcZ9wlPWSh2KR0HohYgt2FqSmV1 6KBPbk7Zh6dWHkJXcGlIecs9ROUp/iGtvQjxO4+GOuBu8hA2tEubSnHycAIz3JN88NHO LBJ/E4IVrnEaYkiovG8tc1TwXMySni/mVp6PSNkBTex7PUigoib63WiiZGW9ERkWlfd4 JSxh3nOvAArkpL1InyhqEmZHgU0e7Gx82/cNjKU3JQQd5U63GBYZhsyMka7YW+wr+f9n z3Jg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=2HQEN6zAh8XskhNcJD263RlQvrdbFWEYHlQsXc1Xx+o=; b=kJyHZk3XQRN2NK0DEzgaE/4jRZ+QH/XBQmkmQxwi49wQkNcPr30Ng8IfWlM0Weves5 m6qVbIMCaRGWjGZJzp54MU5MP3BYCK5fHFeH1BUXXaf3cU+nibxhaBxyjPACQ2CvPDaN 95XBkS+rFqMgwysDmDIq9qQ8uiBUbfEd4lGX67CYIx0UYXL/8dynDBxrOG9A5yl3+DZz ceYkzGQEOakOu2zkildMVztJKFkVK9MfRgLsPuXOtUx0wGH2uHFmUTYSzGAtL78dbVfQ 2ggxSoFDTT/OKySoxxGQpeApIqSIU33m6GJB2Cl2zXebAk2WMveO//l1KdElNkLIru8e FehA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z15si47361551pgf.85.2019.08.05.08.14.09; Mon, 05 Aug 2019 08:14:25 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729756AbfHEPLy (ORCPT + 99 others); Mon, 5 Aug 2019 11:11:54 -0400 Received: from foss.arm.com ([217.140.110.172]:50566 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729133AbfHEPLy (ORCPT ); Mon, 5 Aug 2019 11:11:54 -0400 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id AEE62337; Mon, 5 Aug 2019 08:11:53 -0700 (PDT) Received: from DESKTOP-E1NTVVP.cambridge.arm.com (ubuntu-vbox.cambridge.arm.com [10.1.36.122]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 86B793F694; Mon, 5 Aug 2019 08:11:52 -0700 (PDT) From: Brian Starkey To: Liviu Dudau , "james qian wang (Arm Technology China)" , "Lowry Li (Arm Technology China)" , nd@arm.com, Daniel Vetter Cc: dri-devel@lists.freedesktop.org, LKML Subject: [PATCH] drm/crc-debugfs: Add notes about CRC<->commit interactions Date: Mon, 5 Aug 2019 16:11:43 +0100 Message-Id: <20190805151143.12317-1-brian.starkey@arm.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190802140910.GN7444@phenom.ffwll.local> References: <20190802140910.GN7444@phenom.ffwll.local> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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