From patchwork Wed Dec 12 16:16:44 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?VmlsbGUgU3lyasOkbMOk?= X-Patchwork-Id: 1869591 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork2.kernel.org (Postfix) with ESMTP id F23ADDF266 for ; Wed, 12 Dec 2012 18:12:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 09CD9E664F for ; Wed, 12 Dec 2012 10:12:37 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [143.182.124.21]) by gabe.freedesktop.org (Postfix) with ESMTP id AED2AE5DEA; Wed, 12 Dec 2012 08:21:30 -0800 (PST) Received: from azsmga002.ch.intel.com ([10.2.17.35]) by azsmga101.ch.intel.com with ESMTP; 12 Dec 2012 08:21:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,267,1355126400"; d="scan'208";a="179978791" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by AZSMGA002.ch.intel.com with SMTP; 12 Dec 2012 08:21:28 -0800 Received: by stinkbox (sSMTP sendmail emulation); Wed, 12 Dec 2012 18:21:27 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 77/81] drm/i915: Add trace points for flip queue length Date: Wed, 12 Dec 2012 18:16:44 +0200 Message-Id: <1355329008-31459-78-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1355329008-31459-1-git-send-email-ville.syrjala@linux.intel.com> References: <1355329008-31459-1-git-send-email-ville.syrjala@linux.intel.com> MIME-Version: 1.0 Cc: intel-gfx@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_trace.h | 15 +++++++++++++++ drivers/gpu/drm/i915/intel_atomic.c | 9 ++++++++- 3 files changed, 24 insertions(+), 1 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index d8e8a4f..53998f41 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -969,6 +969,7 @@ typedef struct drm_i915_private { struct work_struct work; struct workqueue_struct *wq; unsigned int next_flip_seq; + unsigned int queue_len; } flip; } drm_i915_private_t; diff --git a/drivers/gpu/drm/i915/i915_trace.h b/drivers/gpu/drm/i915/i915_trace.h index 44f8d40..f71e1b3 100644 --- a/drivers/gpu/drm/i915/i915_trace.h +++ b/drivers/gpu/drm/i915/i915_trace.h @@ -16,6 +16,21 @@ /* object tracking */ +TRACE_EVENT(i915_flip_queue_len, + TP_PROTO(unsigned int queue_len), + TP_ARGS(queue_len), + + TP_STRUCT__entry( + __field(u32, queue_len) + ), + + TP_fast_assign( + __entry->queue_len = queue_len; + ), + + TP_printk("queue_len=%u", __entry->queue_len) +); + TRACE_EVENT(i915_gem_object_pin_count, TP_PROTO(struct drm_i915_gem_object *obj, u32 pin_count_pre, u32 pin_count_post), TP_ARGS(obj, pin_count_pre, pin_count_post), diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index efdaff3..ef5e352 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -2179,9 +2179,12 @@ static void intel_atomic_process_flips_work(struct work_struct *work) if (intel_flip->flip_seq != flip_seq) break; list_move_tail(&intel_flip->base.list, &flips); + dev_priv->flip.queue_len--; } } + trace_i915_flip_queue_len(dev_priv->flip.queue_len); + spin_unlock_irqrestore(&dev_priv->flip.lock, flags); if (list_empty(&flips)) @@ -2407,8 +2410,12 @@ static void atomic_pipe_commit(struct drm_device *dev, spin_lock_irqsave(&dev_priv->flip.lock, flags); - list_for_each_entry_safe(intel_flip, next, &flips, base.list) + list_for_each_entry_safe(intel_flip, next, &flips, base.list) { list_move_tail(&intel_flip->base.list, &dev_priv->flip.list); + dev_priv->flip.queue_len++; + } + + trace_i915_flip_queue_len(dev_priv->flip.queue_len); /* if no rings are involved, we can avoid checking seqnos */ if (rings_mask == 0)