From patchwork Wed Feb 21 17:25:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10233621 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 AEF49602A7 for ; Wed, 21 Feb 2018 17:25:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 97ED023B32 for ; Wed, 21 Feb 2018 17:25:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C2AE2465D; Wed, 21 Feb 2018 17:25: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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID 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 E980623B32 for ; Wed, 21 Feb 2018 17:25:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D26EF6E8A2; Wed, 21 Feb 2018 17:25:27 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 1C9E96E8A2 for ; Wed, 21 Feb 2018 17:25:25 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id 34so6658657wre.13 for ; Wed, 21 Feb 2018 09:25:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ursulin-net.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=m5feFAq9WckjUfh27VXsffSxmb/JZijPiXX9JrG/2uE=; b=D+8OUSgrBf/8yfkBehKCcAIX5OdJd9DHt8EheiVI9ibbUS+H96xB0vt2ftHffx1t2T G36WKeIn99zmj1hBsxkUF73sWvOR3tizNlJ0FcAOGj8mH6C29DlaTb0Fsw6C8UuFwbT/ vf7i7Jfvo+0fb95/qU9qgxos9ba73ghZn6k6V45NfvKEwQwpC3GKeYxuoxPCjKk1fRwb LFfzP7oQJekcbPg832jAqrAsWhggQ9JgURn56UKZWaNVD0We7UJE4PX+QPP783LKd4Yj u5PhVV0PWPog3dTU1QLLd4K50EenQRwuueO4OeKNVakRHL4o0yWD1JAOKDIflkOl23UJ m6NQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=m5feFAq9WckjUfh27VXsffSxmb/JZijPiXX9JrG/2uE=; b=MpUn8XlUwl6mFE8xWj2nBYpKrTWb9D4aeyYku+ywNQgffDPVTXuUFzVXcTh3B1yDTT PdFNp9g2Cmdnd67nltarrIBnUmNe2haUJRoaUqwyoXPDk/St1a3DoX+el9X7bjtiO5e3 Mwswg3CqP7/06aECelQNEvjaRnhENjUphtSHoEoIpvGiH03R58jYyfqmIplgsQId3/kq 3AGn2e1DWdHj0TX2RuEOSDUPkW6hHLK9NoYZx/c1c2CYFClas6yji3OJACFd66m7U5yX GhdmLGrCL0DOAEI/b5g3zt5B6LgsQz8QcbxgfDY1JJ3/u1deWXU5Djllz6O50HB+BFBS IrtQ== X-Gm-Message-State: APf1xPC70rg/qPv4pWahJaX9kMBze1L84roNWBuilMiXNxzkbdOnQWyJ z3UY8vM2nUlDKGtgRuP4gxw7yuvm X-Google-Smtp-Source: AH8x225gQsErg/QNqGzZrvEfEoUQ3K1RzVkkaA+2kH87rs+s7UGIM5ZsYo3jwuh0YZEB99sGRVMvYg== X-Received: by 10.223.133.140 with SMTP id 12mr3532436wrt.192.1519233924215; Wed, 21 Feb 2018 09:25:24 -0800 (PST) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id d63sm20796533wmh.16.2018.02.21.09.25.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 09:25:23 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Wed, 21 Feb 2018 17:25:09 +0000 Message-Id: <20180221172510.761-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 Subject: [Intel-gfx] [PATCH 1/2] drm/i915/guc: Support engine busy stats 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP From: Tvrtko Ursulin Place context in/out hooks into the GuC backend, when contexts are assigned to ports, and removed from them, in order to be able to provide engine busy stats in GuC mode. Signed-off-by: Tvrtko Ursulin Testcase: igt/perf_pmu/busy-accuracy-*-* --- drivers/gpu/drm/i915/intel_guc_submission.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_guc_submission.c b/drivers/gpu/drm/i915/intel_guc_submission.c index 946766b62459..fab5033b9987 100644 --- a/drivers/gpu/drm/i915/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/intel_guc_submission.c @@ -675,6 +675,7 @@ static void guc_dequeue(struct intel_engine_cs *engine) struct intel_engine_execlists * const execlists = &engine->execlists; struct execlist_port *port = execlists->port; struct drm_i915_gem_request *last = NULL; + struct i915_gem_context *last_ctx = NULL; const struct execlist_port * const last_port = &execlists->port[execlists->port_mask]; bool submit = false; @@ -720,8 +721,13 @@ static void guc_dequeue(struct intel_engine_cs *engine) goto done; } - if (submit) + if (submit) { port_assign(port, last); + if (last->ctx != last_ctx) { + intel_engine_context_in(last->engine); + last_ctx = last->ctx; + } + } port++; } @@ -744,6 +750,8 @@ static void guc_dequeue(struct intel_engine_cs *engine) execlists->first = rb; if (submit) { port_assign(port, last); + if (last->ctx != last_ctx) + intel_engine_context_in(last->engine); execlists_set_active(execlists, EXECLISTS_ACTIVE_USER); guc_submit(engine); } @@ -766,6 +774,7 @@ static void guc_submission_tasklet(unsigned long data) rq = port_request(&port[0]); while (rq && i915_gem_request_completed(rq)) { + intel_engine_context_out(rq->engine); trace_i915_gem_request_out(rq); i915_gem_request_put(rq); @@ -1195,8 +1204,6 @@ int intel_guc_submission_enable(struct intel_guc *guc) execlists->tasklet.func = guc_submission_tasklet; engine->park = guc_submission_park; engine->unpark = guc_submission_unpark; - - engine->flags &= ~I915_ENGINE_SUPPORTS_STATS; } return 0;