From patchwork Mon Oct 8 15:18:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lionel Landwerlin X-Patchwork-Id: 10630961 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 15D2D15E8 for ; Mon, 8 Oct 2018 15:18:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 071D928E57 for ; Mon, 8 Oct 2018 15:18:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EF64E28E72; Mon, 8 Oct 2018 15:18:33 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, 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 A6ADF28E57 for ; Mon, 8 Oct 2018 15:18:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 141E489D42; Mon, 8 Oct 2018 15:18:32 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7BDA589CCB for ; Mon, 8 Oct 2018 15:18:30 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Oct 2018 08:18:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,357,1534834800"; d="scan'208";a="76341048" Received: from delly.ld.intel.com ([10.103.239.197]) by fmsmga007.fm.intel.com with ESMTP; 08 Oct 2018 08:18:28 -0700 From: Lionel Landwerlin To: intel-gfx@lists.freedesktop.org Date: Mon, 8 Oct 2018 16:18:19 +0100 Message-Id: <20181008151822.10519-1-lionel.g.landwerlin@intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Subject: [Intel-gfx] [RFC PATCH 0/3] drm/i915: serialized performance queries X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Hi all, This is a early stage series on which I'm looking for feedback. Some background : Performance queries (sampling performance counters through MI_REPORT_PERF_COUNT instruction) commands requires the hardware to be programmed with the desired configuration to allow particular performance data to be recorded. Up to this series, an application querying performance data would have to close/reopen the i915/perf stream each time it wanted to gather different type of performance data. This series introduce a new mechanism through the execbuf parameters to specify what configuration should be used for the set of commands given into the execbuf's batchbuffer. Motivation : Giving the configuration needed to gather performance data at execbuf time together with holding preemption on the batchs of the same application allows data to be gathered using just MI_REPORT_PERF_COUNT instructions and also to go through all many configuration without slowing down the application. The application can now serialize many queries of different types and doesn't have to wait for completion of a previous query to submit a new one with a different configuration. These patches are in no way final, in particular the execbuf uapi changes is probably unworkable in production (it was just a quick way to prove things are working). I heard discussions about execbuf3, this could probably be tied into that. Looking forward to your comments. Thanks, Lionel Landwerlin (3): drm/i915/perf: allow holding preemption on filtered ctx drm/i915/perf: allow for CS OA configs to be created lazily drm/i915: add a new perf configuration execbuf parameter drivers/gpu/drm/i915/i915_drv.c | 4 + drivers/gpu/drm/i915/i915_drv.h | 22 +- drivers/gpu/drm/i915/i915_gem_context.c | 1 + drivers/gpu/drm/i915/i915_gem_context.h | 3 + drivers/gpu/drm/i915/i915_gem_execbuffer.c | 60 +++++- drivers/gpu/drm/i915/i915_perf.c | 227 ++++++++++++++++++--- drivers/gpu/drm/i915/i915_request.c | 4 + drivers/gpu/drm/i915/i915_request.h | 2 + drivers/gpu/drm/i915/intel_gpu_commands.h | 1 + drivers/gpu/drm/i915/intel_lrc.c | 15 +- drivers/gpu/drm/i915/intel_ringbuffer.c | 11 +- include/uapi/drm/i915_drm.h | 20 +- 12 files changed, 327 insertions(+), 43 deletions(-) --- 2.19.1