From patchwork Fri Nov 25 10:21:35 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christian_K=C3=B6nig?= X-Patchwork-Id: 13055728 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 4C685C4332F for ; Fri, 25 Nov 2022 10:22:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E8CA610E66E; Fri, 25 Nov 2022 10:22:04 +0000 (UTC) Received: from mail-wm1-x32c.google.com (mail-wm1-x32c.google.com [IPv6:2a00:1450:4864:20::32c]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6F1A510E614; Fri, 25 Nov 2022 10:21:47 +0000 (UTC) Received: by mail-wm1-x32c.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso3067981wmo.1; Fri, 25 Nov 2022 02:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=WANO23gI2Zg38u80cknASIYETE8/F7wtFNyAR3nQEls=; b=dFbHJ2qyTCJCLmjuuI+/TZKwaHPRMNcqZl6D6o+fFN19OaBDUhdbHT6uQSGt+izI/f 2H3AY+gYu+E5eErzFlgeV2mhm44F7R86Fj2xrpC1wPJRgiuiZwxCkojnyT89PDc0bxQn ZcMM+hrLLV7BBQexFX0i0qDYb8MKvhRQKJvIEI19FZGtuB2NfgCwjg/iDBxFM8H+rRmE iaVWBPRulMF9FGy9y+CSlMx+/NWTE+4w9rT5CJV/XO7tnMpoVyebAmdS9WeXrqcQM3i8 vd0u7D2clfl97a6aCp8Hgf7CXLd0w/nTDv4KhoDBv5AH25I/xY+cXuhuFm3JmFoxhgYk AgSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=WANO23gI2Zg38u80cknASIYETE8/F7wtFNyAR3nQEls=; b=ahEbI64LjNkAkISd5i2ZdL7pXjvweNaG9+v5qDolIp9Z8m43DAlA3b6pLWjt6srqfT nGeWfUK5Tp5/TMooL2yrIABmH2M3sXaVk1aQyIxiEDh1X9kTPJ/V++6KAQcSK1jMspWj q5tl0/nCjEAdT5/ebdOELk1kOYtgzd9CRwMIufgiKjo8kMYPOCfeCt7TkoCLvyS1oI72 suGc2BXvzYuTljBNvk1+NIVNF+J9ZXOf5EjrWjJA4sJfis1cLbWjUgSk0TZGqTvWDe+h qi1rPaGLe/Wj6jtg2iYqaI34WNluQYS4lXCNgcK1jJ+pwaTakucPJ8AcKXmUTesll50i 1Gqg== X-Gm-Message-State: ANoB5plorJbdisWz2idEaFoELi/DKaRd7/jl5jRHuOrYSn0Cx+BnVcf4 1OxB5H0QbVHvIo5goqqovkd3UY7cWP0= X-Google-Smtp-Source: AA0mqf5XHgbIhWUnVE90w1tR3HG6xBZyGA/AlQWOACiC4mOeibO8aASN2xyR9IyGhKg4V1HBkEsI6A== X-Received: by 2002:a05:600c:1e0f:b0:3cf:e9a4:3261 with SMTP id ay15-20020a05600c1e0f00b003cfe9a43261mr31053035wmb.41.1669371705443; Fri, 25 Nov 2022 02:21:45 -0800 (PST) Received: from able.fritz.box (p5b0ea229.dip0.t-ipconnect.de. [91.14.162.41]) by smtp.gmail.com with ESMTPSA id u2-20020a056000038200b00241cfe6e286sm3351193wrf.98.2022.11.25.02.21.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Nov 2022 02:21:45 -0800 (PST) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: Intel Graphics Development , dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Date: Fri, 25 Nov 2022 11:21:35 +0100 Message-Id: <20221125102137.1801-7-christian.koenig@amd.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20221125102137.1801-1-christian.koenig@amd.com> References: <20221125102137.1801-1-christian.koenig@amd.com> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 7/9] drm/i915: stop using ttm_bo_wait 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: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" TTM is just wrapping core DMA functionality here, remove the mid-layer. No functional change. Signed-off-by: Christian König Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 5247d88b3c13..d409a77449a3 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -599,13 +599,16 @@ i915_ttm_resource_get_st(struct drm_i915_gem_object *obj, static int i915_ttm_truncate(struct drm_i915_gem_object *obj) { struct ttm_buffer_object *bo = i915_gem_to_ttm(obj); - int err; + long err; WARN_ON_ONCE(obj->mm.madv == I915_MADV_WILLNEED); - err = ttm_bo_wait(bo, true, false); - if (err) + err = dma_resv_wait_timeout(bo->base.resv, DMA_RESV_USAGE_BOOKKEEP, + true, 15 * HZ); + if (err < 0) return err; + if (err == 0) + return -EBUSY; err = i915_ttm_move_notify(bo); if (err)