From patchwork Tue Sep 26 10:42:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Wang, Zhi A" X-Patchwork-Id: 9971655 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 7A590602BD for ; Tue, 26 Sep 2017 10:42:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3FBD91FF0B for ; Tue, 26 Sep 2017 10:42:56 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 34B49289D7; Tue, 26 Sep 2017 10:42:56 +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 0D99B28F4C for ; Tue, 26 Sep 2017 10:42:54 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D771D6E4CF; Tue, 26 Sep 2017 10:42:53 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 557576E4BF for ; Tue, 26 Sep 2017 10:42:52 +0000 (UTC) Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga105.jf.intel.com with ESMTP; 26 Sep 2017 03:42:51 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,440,1500966000"; d="scan'208"; a="1175892352" Received: from fmsmsx103.amr.corp.intel.com ([10.18.124.201]) by orsmga001.jf.intel.com with ESMTP; 26 Sep 2017 03:42:51 -0700 Received: from fmsmsx114.amr.corp.intel.com (10.18.116.8) by FMSMSX103.amr.corp.intel.com (10.18.124.201) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 26 Sep 2017 03:42:51 -0700 Received: from shsmsx104.ccr.corp.intel.com (10.239.4.70) by FMSMSX114.amr.corp.intel.com (10.18.116.8) with Microsoft SMTP Server (TLS) id 14.3.319.2; Tue, 26 Sep 2017 03:42:50 -0700 Received: from shsmsx101.ccr.corp.intel.com ([169.254.1.159]) by SHSMSX104.ccr.corp.intel.com ([169.254.5.152]) with mapi id 14.03.0319.002; Tue, 26 Sep 2017 18:42:49 +0800 From: "Wang, Zhi A" To: Chris Wilson , "intel-gfx@lists.freedesktop.org" Thread-Topic: [PATCH 2/2] drm/i915/execlists: Distinguish the incomplete context notifies Thread-Index: AQHTNrCzhGTUa3uNZUaBjE9Xi26WvaLG+KMQ Date: Tue, 26 Sep 2017 10:42:48 +0000 Message-ID: References: <20170926101720.9479-1-chris@chris-wilson.co.uk> <20170926101720.9479-2-chris@chris-wilson.co.uk> In-Reply-To: <20170926101720.9479-2-chris@chris-wilson.co.uk> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-version: 11.0.0.116 dlp-reaction: no-action x-originating-ip: [10.239.127.40] MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH 2/2] drm/i915/execlists: Distinguish the incomplete context notifies 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP Thanks for the patch! :) I got a question: Will the re-scheduling of the request be handled by i915? Or the client has to re-submit the request by itself after it got preempted? :) Currently, we will call i915_wait_request() to wait the request. I guess the preemption will not wake up the i915_wait_request() with a EINTR? Thanks, Zhi. -----Original Message----- From: Chris Wilson [mailto:chris@chris-wilson.co.uk] Sent: Tuesday, September 26, 2017 1:17 PM To: intel-gfx@lists.freedesktop.org Cc: Chris Wilson ; Zhenyu Wang ; Wang, Zhi A ; Winiarski, Michal ; Mika Kuoppala ; Ursulin, Tvrtko Subject: [PATCH 2/2] drm/i915/execlists: Distinguish the incomplete context notifies Let the listener know that the context we just scheduled out was not complete, and will be scheduled back in at a later point. Signed-off-by: Chris Wilson Cc: "Zhenyu Wang" Cc: "Wang, Zhi A" Cc: MichaƂ Winiarski Cc: Mika Kuoppala Cc: Tvrtko Ursulin --- drivers/gpu/drm/i915/intel_lrc.c | 2 +- drivers/gpu/drm/i915/intel_lrc.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) -- 2.14.1 diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c index 61cac26a8b05..79fe5f807098 100644 --- a/drivers/gpu/drm/i915/intel_lrc.c +++ b/drivers/gpu/drm/i915/intel_lrc.c @@ -580,7 +580,7 @@ execlist_cancel_port_requests(struct intel_engine_execlists *execlists) while (num_ports-- && port_isset(port)) { struct drm_i915_gem_request *rq = port_request(port); - execlists_context_status_change(rq, INTEL_CONTEXT_SCHEDULE_OUT); + execlists_context_status_change(rq, +INTEL_CONTEXT_SCHEDULE_PREEMPTED); i915_gem_request_put(rq); memset(port, 0, sizeof(*port)); diff --git a/drivers/gpu/drm/i915/intel_lrc.h b/drivers/gpu/drm/i915/intel_lrc.h index 314adee7127a..689fde1a63a9 100644 --- a/drivers/gpu/drm/i915/intel_lrc.h +++ b/drivers/gpu/drm/i915/intel_lrc.h @@ -61,6 +61,7 @@ enum { INTEL_CONTEXT_SCHEDULE_IN = 0, INTEL_CONTEXT_SCHEDULE_OUT, + INTEL_CONTEXT_SCHEDULE_PREEMPTED, }; /* Logical Rings */