From patchwork Thu Feb 22 06:07:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 10234687 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 7C7FA60349 for ; Thu, 22 Feb 2018 06:07:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7B649286A8 for ; Thu, 22 Feb 2018 06:07:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6FC43286B7; Thu, 22 Feb 2018 06:07:46 +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 CA49C286A8 for ; Thu, 22 Feb 2018 06:07:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DDD66EBD7; Thu, 22 Feb 2018 06:07:44 +0000 (UTC) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mail-wr0-x242.google.com (mail-wr0-x242.google.com [IPv6:2a00:1450:400c:c0c::242]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4E15E6EBD7 for ; Thu, 22 Feb 2018 06:07:43 +0000 (UTC) Received: by mail-wr0-x242.google.com with SMTP id 34so9323725wre.13 for ; Wed, 21 Feb 2018 22:07:43 -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:in-reply-to:references; bh=U/2iqS/y4U3B4TLQwRdvUVdKFfBMP0Yuxf1TNFYM9Oc=; b=pfzP4jefDWLm0PKlxVu9nKuVqnZw8zpIowC+hFfYrgqqmSOPo5jQ7YHWiOXuEPHVal IAWpMS5vjROfv+RFS1Gya5PC3gGKymB4ZKaj7Ecy5H8UlQeEgx0TZKwkFC/0u/XPWfTj tXMz5CUvtQS3gZF8bH35brMmYTXnu4YrNAjG1j9Ho4ZkppS1NSaAa2X+cm6DLrJNCguW c5NcBbB9Jefe/Pgxcs3gJ21uwaPA5ls4ePpSMQepbOt3u1bx97VekKLE5gfSFA7czB30 l1pfshffr84E4w3atDwXyW3SudWu/WMFlb3JhD2IMqnTAhXD0jk84pxHfOU9GjLPPZN/ sI8g== 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:in-reply-to :references; bh=U/2iqS/y4U3B4TLQwRdvUVdKFfBMP0Yuxf1TNFYM9Oc=; b=chBqypQp4uRJnypSIjs+GmJnrMLOyK17mA/QMtLDfGJC9+yWTWmvY7ZKhr4JOfIGAZ PmOO40VwExtyEELXN23qX/iIgOu0rOvwXdZZlbntwVKQAWixCB2KWlZUuPgPeVhI3LDj HaZbhFHBWSWJxArqDdVgIwVoKfxExpwel88OJ1f//GimGfhndaibbC5QC6D12OUPLb5z Q4eZ4kfWDGyHow5popB0TZ4rsFcXuOhVQE5nGmDLmD0JoCNtfctMoqUFLYOCu9n920dO 93fw6M5WIT0+GS/YJu6HrxHzWgFwUOFnqPcqIGFNspbtxqkSJ/ESql9TV2NOv0JCbaYC rkEw== X-Gm-Message-State: APf1xPBOFMiji+AvMmF4uNqFOWf8vSqmWlkOQmmuV7RJcPE16tBYFueL VD7BTvfFukHGjhCJZYLUoTaW0yIp X-Google-Smtp-Source: AH8x226bLPa7vrIsJ1VJ0xLUvdeEpqjZ9xEYPzgeb8W7iKYQKHuhISN0GhajbWhrX0h7F6PQ3dv47Q== X-Received: by 10.223.190.15 with SMTP id n15mr5353350wrh.82.1519279661661; Wed, 21 Feb 2018 22:07:41 -0800 (PST) Received: from localhost.localdomain ([95.146.144.186]) by smtp.gmail.com with ESMTPSA id l17sm26524490wrh.67.2018.02.21.22.07.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Feb 2018 22:07:41 -0800 (PST) From: Tvrtko Ursulin X-Google-Original-From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org Date: Thu, 22 Feb 2018 06:07:32 +0000 Message-Id: <20180222060732.4381-1-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180221172510.761-1-tvrtko.ursulin@linux.intel.com> References: <20180221172510.761-1-tvrtko.ursulin@linux.intel.com> 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 649113c7a3c2..8e99f8fd6da2 100644 --- a/drivers/gpu/drm/i915/intel_guc_submission.c +++ b/drivers/gpu/drm/i915/intel_guc_submission.c @@ -673,6 +673,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 i915_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; @@ -718,8 +719,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++; } @@ -741,6 +747,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); } @@ -763,6 +771,7 @@ static void guc_submission_tasklet(unsigned long data) rq = port_request(&port[0]); while (rq && i915_request_completed(rq)) { + intel_engine_context_out(rq->engine); trace_i915_request_out(rq); i915_request_put(rq); @@ -1192,8 +1201,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;