From patchwork Thu Feb 16 10:59:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 13142947 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 55FA0C636CC for ; Thu, 16 Feb 2023 11:00:06 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6BA7910ED46; Thu, 16 Feb 2023 10:59:43 +0000 (UTC) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by gabe.freedesktop.org (Postfix) with ESMTPS id 14D0C10ED42; Thu, 16 Feb 2023 10:59:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676545179; x=1708081179; h=from:to:subject:date:message-id:in-reply-to:references: mime-version:content-transfer-encoding; bh=/CcC0aOeeAtqrOsPao/E+8cmDCKIM6s5J/aBXV6fZRc=; b=YOd5oEjHsZbpTwrSBFC34yseSXvmok4GErqCgzQySB8ubLtkB8ie/Kf5 De5QXzG1zWq60hnQ4a9oOAd3/MQKcyIENZFtPa27SCBTFTOcajczxZJje kh6qtQUXND9/KEAC48o2NDg5fqL/rcvf3knwbFlAlKCO67fwjvUdflyWY iBbVHhmMUAeBz5pFBtTlB0jmHW0UYI+8nHGzjuwAVddqLGcdmNVxAOvHX LeaFavkFZ/hPeNg5O828M468+ixDEKHvzDKX5cGmR7qzezCmV9idFA1fq KSSzj2CXEfLE6zrEPGQGXQu0uCU5Z2WUb1rBAW01EIsqkcJ+PYgWRx75S A==; X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="311317620" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="311317620" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2023 02:59:38 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10622"; a="812917926" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="812917926" Received: from murrayal-mobl.ger.corp.intel.com (HELO localhost.localdomain) ([10.213.229.164]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2023 02:59:37 -0800 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [RFC 9/9] drm/i915: Wait boost requests waited upon by others Date: Thu, 16 Feb 2023 10:59:21 +0000 Message-Id: <20230216105921.624960-10-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230216105921.624960-1-tvrtko.ursulin@linux.intel.com> References: <20230216105921.624960-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Tvrtko Ursulin Use the newly added dma-fence API to apply waitboost not only requests which have been marked with I915_WAIT_PRIORITY by i915, but which may be waited upon by others (such as for instance buffer sharing in multi-GPU scenarios). Signed-off-by: Tvrtko Ursulin --- drivers/gpu/drm/i915/i915_request.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 488b180f8821..e24fac5c1567 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -2042,7 +2042,8 @@ long i915_request_wait_timeout(struct i915_request *rq, * but at a cost of spending more power processing the workload * (bad for battery). */ - if (flags & I915_WAIT_PRIORITY && !i915_request_started(rq)) + if (((flags & I915_WAIT_PRIORITY) || dma_fence_wait_count(&rq->fence)) + && !i915_request_started(rq)) intel_rps_boost(rq); wait.tsk = current;