From patchwork Mon Jun 22 09:55:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sourab.gupta@intel.com X-Patchwork-Id: 6654521 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id B528DC05AC for ; Mon, 22 Jun 2015 09:53:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DF3F4203C0 for ; Mon, 22 Jun 2015 09:53:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0043C203AE for ; Mon, 22 Jun 2015 09:53:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 771426E5D9; Mon, 22 Jun 2015 02:53:19 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id E33776E5D9 for ; Mon, 22 Jun 2015 02:53:18 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 22 Jun 2015 02:53:20 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,658,1427785200"; d="scan'208";a="732124347" Received: from sourabgu-desktop.iind.intel.com ([10.223.82.35]) by fmsmga001.fm.intel.com with ESMTP; 22 Jun 2015 02:53:16 -0700 From: sourab.gupta@intel.com To: intel-gfx@lists.freedesktop.org Date: Mon, 22 Jun 2015 15:25:05 +0530 Message-Id: <1434966909-4113-4-git-send-email-sourab.gupta@intel.com> X-Mailer: git-send-email 1.8.5.1 In-Reply-To: <1434966909-4113-1-git-send-email-sourab.gupta@intel.com> References: <1434966909-4113-1-git-send-email-sourab.gupta@intel.com> Cc: Insoo Woo , Peter Zijlstra , Jabin Wu , Sourab Gupta Subject: [Intel-gfx] [RFC 3/7] drm/i915: Introduce timestamp node for timestamp data collection 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-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Sourab Gupta This patch introduces data structures for holding the timestamp data, which can then be forwarded to userspace using Gen Perf PMU. Each timestamp node will have the timestamp value, alongwith additional metadata information such as ctx_id, pid, ring. Signed-off-by: Sourab Gupta --- drivers/gpu/drm/i915/i915_drv.h | 22 ++++++++++++++++++++++ include/uapi/drm/i915_drm.h | 18 ++++++++++++++++++ 2 files changed, 40 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 3491584..b6a897a 100644 --- a/drivers/gpu/drm/i915/i915_drv.h +++ b/drivers/gpu/drm/i915/i915_drv.h @@ -1701,6 +1701,28 @@ struct drm_i915_oa_async_node { struct drm_i915_oa_async_node_info node_info; __u32 report_perf[64]; /* Must be aligned to 64-byte boundary */ }; + +struct drm_i915_ts_queue_header { + __u64 size_in_bytes; + /* Byte offset, start of queue header to first node */ + __u64 data_offset; + __u32 node_count; + __u32 wrap_count; +}; + +struct drm_i915_ts_node_info { + __u32 ring; + __u32 pid; + __u32 ctx_id; + __u32 perftag; + struct drm_i915_gem_request *req; +}; + +struct drm_i915_ts_node { + /* ensure timestamp starts on a qword boundary */ + struct drm_i915_ts_data timestamp; + struct drm_i915_ts_node_info node_info; +}; #endif struct drm_i915_private { diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 4d99992..a7da421 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h @@ -131,6 +131,24 @@ struct drm_i915_oa_async_node_footer { __u32 pad; }; +struct drm_i915_ts_node_footer { + __u32 ring; + __u32 pid; + __u32 ctx_id; + __u32 perftag; +}; + +struct drm_i915_ts_data { + __u32 ts_low; + __u32 ts_high; +}; + +struct drm_i915_ts_usernode { + /* ensure timestamp starts on a qword boundary */ + struct drm_i915_ts_data timestamp; + struct drm_i915_ts_node_footer node_info; +}; + /* Each region is a minimum of 16k, and there are at most 255 of them. */ #define I915_NR_TEX_REGIONS 255 /* table size 2k - maximum due to use