From patchwork Wed Dec 12 16:16:46 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: 1869681 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 60C8E3FC81 for ; Wed, 12 Dec 2012 18:18:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68A31E65E8 for ; Wed, 12 Dec 2012 10:18:33 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id 296EAE613A; Wed, 12 Dec 2012 08:21:37 -0800 (PST) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 12 Dec 2012 08:20:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.84,267,1355126400"; d="scan'208";a="232848621" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by orsmga001.jf.intel.com with SMTP; 12 Dec 2012 08:21:34 -0800 Received: by stinkbox (sSMTP sendmail emulation); Wed, 12 Dec 2012 18:21:33 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 79/81] drm/i915: Add some timing debugs to atomic flips Date: Wed, 12 Dec 2012 18:16:46 +0200 Message-Id: <1355329008-31459-80-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ä --- drivers/gpu/drm/i915/intel_atomic.c | 15 +++++++++++++++ 1 files changed, 15 insertions(+), 0 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_atomic.c b/drivers/gpu/drm/i915/intel_atomic.c index c964b64a..43767c2 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -48,6 +48,7 @@ #define USE_WRITE_SEQNO //#define SURFLIVE_DEBUG +//#define FLIP_TIME_DEBUG struct intel_flip { struct drm_flip base; @@ -1842,6 +1843,10 @@ static void intel_flip_cleanup(struct drm_flip *flip) kfree(intel_flip); } +#ifdef FLIP_TIME_DEBUG +static ktime_t tstart, tend, tdiff; +#endif + static void intel_flip_driver_flush(struct drm_flip_driver *driver) { struct drm_i915_private *dev_priv = @@ -1849,6 +1854,13 @@ static void intel_flip_driver_flush(struct drm_flip_driver *driver) /* Flush posted writes */ I915_READ(PIPEDSL(PIPE_A)); + +#ifdef FLIP_TIME_DEBUG + tend = ktime_get(); + tdiff = ktime_sub(tend, tstart); + if (ktime_to_ns(tdiff) >= 10000ULL) + DRM_DEBUG_KMS("**** flip took %llu nsec ****\n", ktime_to_ns(tdiff)); +#endif } static bool intel_have_new_frmcount(struct drm_device *dev) @@ -2242,6 +2254,9 @@ static void intel_atomic_schedule_flips(struct drm_i915_private *dev_priv, intel_pipe_vblank_evade(&intel_crtc->base); +#ifdef FLIP_TIME_DEBUG + tstart = ktime_get(); +#endif drm_flip_driver_schedule_flips(&dev_priv->flip_driver, flips); local_irq_enable();