From patchwork Thu Sep 7 10:06:13 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sagar.a.kamble@intel.com X-Patchwork-Id: 9942015 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7338D602CC for ; Thu, 7 Sep 2017 10:03:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 85E3528600 for ; Thu, 7 Sep 2017 10:03:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7ACFD28608; Thu, 7 Sep 2017 10:03:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4669628600 for ; Thu, 7 Sep 2017 10:03:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 99D5F6E8BA; Thu, 7 Sep 2017 10:03:14 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6EE796E8BA for ; Thu, 7 Sep 2017 10:03:13 +0000 (UTC) Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Sep 2017 03:03:13 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.42,357,1500966000"; d="scan'208";a="126439782" Received: from sakamble-desktop.iind.intel.com ([10.223.26.118]) by orsmga004.jf.intel.com with ESMTP; 07 Sep 2017 03:03:12 -0700 From: Sagar Arun Kamble To: intel-gfx@lists.freedesktop.org Date: Thu, 7 Sep 2017 15:36:13 +0530 Message-Id: <1504778774-18117-14-git-send-email-sagar.a.kamble@intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504778774-18117-1-git-send-email-sagar.a.kamble@intel.com> References: <1504778774-18117-1-git-send-email-sagar.a.kamble@intel.com> Cc: Sourab Gupta Subject: [Intel-gfx] [PATCH 13/14] drm/i915: Async check for streams data availability with hrtimer rescheduling X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Sourab Gupta This patch ensures hrtimer is rescheduled immediately during cb by doing async call to check for streams data availability. Signed-off-by: Sourab Gupta Signed-off-by: Sagar Arun Kamble --- drivers/gpu/drm/i915/i915_perf.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 3a72705..630af3e 100644 --- a/drivers/gpu/drm/i915/i915_perf.c +++ b/drivers/gpu/drm/i915/i915_perf.c @@ -3465,12 +3465,10 @@ static ssize_t i915_perf_read(struct file *file, return ret; } -static enum hrtimer_restart poll_check_timer_cb(struct hrtimer *hrtimer) +static void wake_up_perf_streams(void *data, async_cookie_t cookie) { + struct drm_i915_private *dev_priv = data; struct i915_perf_stream *stream; - struct drm_i915_private *dev_priv = - container_of(hrtimer, typeof(*dev_priv), - perf.poll_check_timer); int idx; struct intel_engine_cs *engine; enum intel_engine_id id; @@ -3486,6 +3484,15 @@ static enum hrtimer_restart poll_check_timer_cb(struct hrtimer *hrtimer) } srcu_read_unlock(&engine->srcu, idx); } +} + +static enum hrtimer_restart poll_check_timer_cb(struct hrtimer *hrtimer) +{ + struct drm_i915_private *dev_priv = + container_of(hrtimer, typeof(*dev_priv), + perf.poll_check_timer); + + async_schedule(wake_up_perf_streams, dev_priv); hrtimer_forward_now(hrtimer, ns_to_ktime(POLL_PERIOD));