From patchwork Thu Aug 22 03:23:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Widawsky X-Patchwork-Id: 2848022 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B7A86BF546 for ; Thu, 22 Aug 2013 02:41:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D98F52030E for ; Thu, 22 Aug 2013 02:41:46 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DFF89202C7 for ; Thu, 22 Aug 2013 02:41:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BB61DE5EE4 for ; Wed, 21 Aug 2013 19:41:45 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail.bwidawsk.net (bwidawsk.net [166.78.191.112]) by gabe.freedesktop.org (Postfix) with ESMTP id EA36AE5DBB for ; Wed, 21 Aug 2013 19:21:51 -0700 (PDT) Received: by mail.bwidawsk.net (Postfix, from userid 5001) id E9A0959A06; Wed, 21 Aug 2013 19:21:50 -0700 (PDT) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from willis.kumite (c-24-21-100-90.hsd1.or.comcast.net [24.21.100.90]) by mail.bwidawsk.net (Postfix) with ESMTPSA id 226165828F; Wed, 21 Aug 2013 19:21:48 -0700 (PDT) From: Ben Widawsky To: Intel GFX Date: Wed, 21 Aug 2013 20:23:18 -0700 Message-Id: <1377141798-11791-1-git-send-email-benjamin.widawsky@intel.com> X-Mailer: git-send-email 1.8.3.4 In-Reply-To: <1377141353-11532-2-git-send-email-benjamin.widawsky@intel.com> References: <1377141353-11532-2-git-send-email-benjamin.widawsky@intel.com> Cc: Ben Widawsky , Ben Widawsky Subject: [Intel-gfx] [PATCH 2/2] [v2] drm/i915: Add debugfs interface for planes X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org X-Virus-Scanned: ClamAV using ClamSMTP This interface can enhanced over time to get more per plane information. I've just flip counts for now. What I'd like to do with flip counts is integrate them with existing flip tests. It serves a similar, but more coarse purpose to some of the CRC work being done. It can be used to determine if something is being flipped when we expect it to be flipped. The immediate issue I want to look into is I've seen some funny behavior where we're getting two flips per flip queued. Unfortunately, I've been unable to get something going on the test side thus far because I am inexperienced with the APIs, and don't see a way to map a crtc to a hardware plane (which is what we have flip counts for). Chris, maybe you can do something useful with this? v2: Use the right patch, with the right commit msg. Cc: Chris Wilson Signed-off-by: Ben Widawsky --- drivers/gpu/drm/i915/i915_debugfs.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 236d97e..27aee95 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -1791,6 +1791,24 @@ static int i915_energy_uJ(struct seq_file *m, void *data) return 0; } +static int i915_plane_info(struct seq_file *m, void *data) +{ + struct drm_info_node *node = m->private; + struct drm_device *dev = node->minor->dev; + struct drm_i915_private *dev_priv = dev->dev_private; + uintptr_t plane = (uintptr_t) node->info_ent->data; + + if (INTEL_INFO(dev)->gen < 5 && !INTEL_INFO(dev)->is_g4x) + return -ENODEV; + + if (plane >= INTEL_INFO(dev)->num_pipes) + return -ENODEV; + + seq_printf(m, "flip count: %u\n", I915_READ(DSPFLIPCNT(plane))); + + return 0; +} + static int i915_wedged_get(void *data, u64 *val) { @@ -2231,6 +2249,9 @@ static struct drm_info_list i915_debugfs_list[] = { {"i915_llc", i915_llc, 0}, {"i915_edp_psr_status", i915_edp_psr_status, 0}, {"i915_energy_uJ", i915_energy_uJ, 0}, + {"i915_plane_a", i915_plane_info, 0, (void *)0}, + {"i915_plane_b", i915_plane_info, 0, (void *)1}, + {"i915_plane_c", i915_plane_info, 0, (void *)2}, }; #define I915_DEBUGFS_ENTRIES ARRAY_SIZE(i915_debugfs_list)