From patchwork Tue Jun 14 18:43:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ramalingam C X-Patchwork-Id: 12881369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 92420CCA47A for ; Tue, 14 Jun 2022 18:42:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1A85F10FE67; Tue, 14 Jun 2022 18:42:31 +0000 (UTC) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTPS id 885A810FC9A; Tue, 14 Jun 2022 18:42:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1655232146; x=1686768146; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=d9BrXaQdih6hNr6yEHkTJeQhLqRwUaHrERctslSo+mI=; b=LsRBDUA7FUowldAHKsBb1gUObBgfXDItfRIopg5BiJowpESPGjlWTkxY lEPy/qLlBJgbtDxdM2ihmmfKlS0/8z9i6AUkMz2gUrOT39vt8xqA2IKb6 IA1kfkKqDRI1Ns1Nj52l43+Uch4a/JMz5BvYCt9dnS532AZs79bWrzedl 2ffVHx5B5k6YiKYlKqhaqk7Zrw/NkmUQvxuIS9XGHyMAtG9Ko7KAqZjrK X5YlA7LMeuFdCkYdFCE17a0EebhOS+jD2hM5XML2ohRzmkrzWBZCXyORP FDP/hDbgKxi/DKpaP/4b25QBLB1vCduwYnbzW6RaMkc50vhP1Jqc1E3ls w==; X-IronPort-AV: E=McAfee;i="6400,9594,10378"; a="279426483" X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="279426483" Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 11:42:26 -0700 X-IronPort-AV: E=Sophos;i="5.91,300,1647327600"; d="scan'208";a="588627311" Received: from ramaling-i9x.iind.intel.com ([10.203.144.108]) by fmsmga007-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Jun 2022 11:42:23 -0700 From: Ramalingam C To: intel-gfx , dri-devel Date: Wed, 15 Jun 2022 00:13:48 +0530 Message-Id: <20220614184348.23746-4-ramalingam.c@intel.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20220614184348.23746-1-ramalingam.c@intel.com> References: <20220614184348.23746-1-ramalingam.c@intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 3/3] drm/i915: Do not use reserved requests for virtual engines X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hellstrom Thomas , Matthew Auld Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" Do not use reserved requests for virtual engines as this is only needed for kernel contexts. Signed-off-by: Ramalingam C Suggested-by: Matthew Brost Reviewed-by: Matthew Brost --- drivers/gpu/drm/i915/i915_request.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index c71905d8e154..f0392b053bca 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -135,6 +135,8 @@ static void i915_fence_release(struct dma_fence *fence) /* * Keep one request on each engine for reserved use under mempressure + * do not use with virtual engines as this really is only needed for + * kernel contexts. * * We do not hold a reference to the engine here and so have to be * very careful in what rq->engine we poke. The virtual engine is @@ -164,7 +166,8 @@ static void i915_fence_release(struct dma_fence *fence) * know that if the rq->execution_mask is a single bit, rq->engine * can be a physical engine with the exact corresponding mask. */ - if (is_power_of_2(rq->execution_mask) && + if (!intel_engine_is_virtual(rq->engine) && + is_power_of_2(rq->execution_mask) && !cmpxchg(&rq->engine->request_pool, NULL, rq)) return;