From patchwork Tue Mar 7 10:48:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tvrtko Ursulin X-Patchwork-Id: 13163159 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 4558AC678D4 for ; Tue, 7 Mar 2023 10:49:20 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8A6E210E49F; Tue, 7 Mar 2023 10:48:56 +0000 (UTC) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5039910E4A0; Tue, 7 Mar 2023 10:48:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1678186134; x=1709722134; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rsTLryc6IfUvnPWE7k7B9yi3VVtvOkjvjdiIRVAT6H8=; b=KKGwCJg+YZAZ9uo7JCsQUhVUuPDvpxXg1aEAFUqSs2ER/E7wToH9C22R 7mJyZYvDGOuy9rYvoKGEDNjr838acUP54I8CSBPNqifZPuCn6CDwx3Mhk D3QuxI0MV4PPa9tLe9V5J4wLBHoPvLsrcjHNpqqgpPhhh8MULe9zwKiuY yq81v40+aM1T6bKzJL5SwMpUMlcgvFqMtMp1vOWaoHTaY3ytXVeC59SjF AmwDgY2zKu+Ltv6Zp3QPatbSCnk42ztxZSVqIEr2g/s9jhkivkcqmtvZV PIoPSZ2s2DhRIfyo+HbREFh5PF/Lz1x4zdxUR6s5WyGwKXPMtMdxewjbi Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="400643513" X-IronPort-AV: E=Sophos;i="5.98,240,1673942400"; d="scan'208";a="400643513" Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2023 02:48:53 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10641"; a="819712976" X-IronPort-AV: E=Sophos;i="5.98,240,1673942400"; d="scan'208";a="819712976" Received: from tanzeelu-mobl1.ger.corp.intel.com (HELO localhost.localdomain) ([10.213.205.53]) by fmsmga001-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Mar 2023 02:48:51 -0800 From: Tvrtko Ursulin To: Intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Date: Tue, 7 Mar 2023 10:48:24 +0000 Message-Id: <20230307104824.231094-13-tvrtko.ursulin@linux.intel.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20230307104824.231094-1-tvrtko.ursulin@linux.intel.com> References: <20230307104824.231094-1-tvrtko.ursulin@linux.intel.com> MIME-Version: 1.0 Subject: [Intel-gfx] [RFC 12/12] drm/i915: Wait boost requests waited upon by others 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: Matt Turner Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" 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 dd8a9045086a..c4adf34016d0 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -2041,7 +2041,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;