From patchwork Fri Nov 16 14:22:23 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: 1755401 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 679DEDF230 for ; Fri, 16 Nov 2012 14:35:21 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 50D97E5C9A for ; Fri, 16 Nov 2012 06:35:21 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F47043698; Fri, 16 Nov 2012 06:23:11 -0800 (PST) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 16 Nov 2012 06:23:10 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.83,265,1352102400"; d="scan'208";a="250270591" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.168]) by fmsmga002.fm.intel.com with SMTP; 16 Nov 2012 06:23:08 -0800 Received: by stinkbox (sSMTP sendmail emulation); Fri, 16 Nov 2012 16:23:07 +0200 From: ville.syrjala@linux.intel.com To: dri-devel@lists.freedesktop.org Subject: [PATCH 11/13] drm/i915: Add some timing debugs to atomic flips Date: Fri, 16 Nov 2012 16:22:23 +0200 Message-Id: <1353075745-30115-12-git-send-email-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 1.7.8.6 In-Reply-To: <1353075745-30115-1-git-send-email-ville.syrjala@linux.intel.com> References: <1353075745-30115-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 170ac6f..c6531b0 100644 --- a/drivers/gpu/drm/i915/intel_atomic.c +++ b/drivers/gpu/drm/i915/intel_atomic.c @@ -35,6 +35,7 @@ //#define FORCE_CACHE_FLUSH //#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) @@ -2258,6 +2270,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();