From patchwork Tue Jul 21 07:32:37 2020 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: 11675067 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D0D3113A4 for ; Tue, 21 Jul 2020 07:33:00 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id AF9EC2080D for ; Tue, 21 Jul 2020 07:33:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="CSvEz0xx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF9EC2080D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0690B6E49A; Tue, 21 Jul 2020 07:32:53 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) by gabe.freedesktop.org (Postfix) with ESMTPS id 49F746E497 for ; Tue, 21 Jul 2020 07:32:51 +0000 (UTC) Received: by mail-wm1-x341.google.com with SMTP id g10so1565325wmc.1 for ; Tue, 21 Jul 2020 00:32:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=QTHId/4DZw2DyrgHhwndQR+AVdmKWq3oetK9woNSGJw=; b=CSvEz0xxD2Uuqs7wuN4XoTyg6J+rDNZ1lNNvS3EgEp28/K2kYyqayvbSj7tEv1NUZ8 +VPRM+iLVMsTfLaNofk4Ra3/JTDbIT12rEDAfuEUpxfgtTuK46748RzP1zhe1O1+y8by 2feE/Bn7W5b+N1F7W+o9+Z63PQvaN3NW1jrEpIjZo3JiOJ9QSQv0VWcgDXr6xJgQ3IAy KZghQdkM0FW9kVubO25wVNii4s/TncWW1+AeaHK58n/L2Y8TEGqAsfcWyiQFuHx75sAj 8B11aFGPeplgCBpoH6jYX00cwskatc0b6o7KdIQX8M1RCCJWntLGTcFl1IoFQ/Yk+kxl rJhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=QTHId/4DZw2DyrgHhwndQR+AVdmKWq3oetK9woNSGJw=; b=VRUv8uuDOQ/VnaFad9tGTejjvCcizq9+hvMCWR7WwreOTMoXOtzdQKrhvHXys8X0Uq cPue4MDuh5gvPTIB5m1/13W69JvzcIycNQxUH7yRCgdTm25DBfZd+M1AZTcwm/V2hLzB zPSbHrmshI5PwUwkaVaR65953uWsZ9uEVfNPO2qN3fbIrPmHzv/pPKjzlOAPNupgoImm /iC2tww7CzWNoRyJk05lOsqYJJyQVtL7sH/0vW4nxfakrp2zdAy/SLOJH0pYnTFvvflt UIgHNj7FTYvjouCMcTecbLyum6i2NP+FgNCGbAcAEV2/+UI4eSrAwqS0FKLwZO9UA+j/ g2MQ== X-Gm-Message-State: AOAM533NCtG3KGDLhkAslx3eUhSA9wu9+9ITzLrvkT+/Q8jddFk++Axw f8zIsv6qIS+Z4v2t64I/a1erEcAb X-Google-Smtp-Source: ABdhPJwD3LFUNUSpeIDV+JBuEz89DRf79STmaI+NSClwqq5wnaY41LjeffTOpl6IBHpMFdxiIbvIlw== X-Received: by 2002:a1c:b188:: with SMTP id a130mr1265904wmf.125.1595316769417; Tue, 21 Jul 2020 00:32:49 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:5eb1:eb29:dadc:7fc5]) by smtp.gmail.com with ESMTPSA id s4sm29740896wre.53.2020.07.21.00.32.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 00:32:48 -0700 (PDT) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH 03/11] drm/ttm: remove io_reserve_fastpath flag Date: Tue, 21 Jul 2020 09:32:37 +0200 Message-Id: <20200721073245.2484-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721073245.2484-1-christian.koenig@amd.com> References: <20200721073245.2484-1-christian.koenig@amd.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: , Cc: Madhav.Chauhan@amd.com, michael.j.ruhl@intel.com, tzimmermann@suse.de Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Just use the use_io_reserve_lru flag. It doesn't make much sense to have two flags. Signed-off-by: Christian König Reviewed-by: Daniel Vetter --- drivers/gpu/drm/nouveau/nouveau_bo.c | 1 - drivers/gpu/drm/ttm/ttm_bo.c | 1 - drivers/gpu/drm/ttm/ttm_bo_util.c | 8 ++++---- include/drm/ttm/ttm_bo_driver.h | 2 -- 4 files changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index a48652826f67..a1037478fa3f 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -675,7 +675,6 @@ nouveau_bo_init_mem_type(struct ttm_bo_device *bdev, uint32_t type, } man->func = &nouveau_vram_manager; - man->io_reserve_fastpath = false; man->use_io_reserve_lru = true; } else { man->func = &ttm_bo_manager_func; diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 7be36b9996ed..8b9e7f62bea7 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1521,7 +1521,6 @@ int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type, BUG_ON(type >= TTM_NUM_MEM_TYPES); man = &bdev->man[type]; BUG_ON(man->has_type); - man->io_reserve_fastpath = true; man->use_io_reserve_lru = false; mutex_init(&man->io_reserve_mutex); spin_lock_init(&man->move_lock); diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 7d2c50fef456..6c05f4fd15ae 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -93,7 +93,7 @@ EXPORT_SYMBOL(ttm_bo_move_ttm); int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible) { - if (likely(man->io_reserve_fastpath)) + if (likely(!man->use_io_reserve_lru)) return 0; if (interruptible) @@ -105,7 +105,7 @@ int ttm_mem_io_lock(struct ttm_mem_type_manager *man, bool interruptible) void ttm_mem_io_unlock(struct ttm_mem_type_manager *man) { - if (likely(man->io_reserve_fastpath)) + if (likely(!man->use_io_reserve_lru)) return; mutex_unlock(&man->io_reserve_mutex); @@ -136,7 +136,7 @@ int ttm_mem_io_reserve(struct ttm_bo_device *bdev, if (!bdev->driver->io_mem_reserve) return 0; - if (likely(man->io_reserve_fastpath)) + if (likely(!man->use_io_reserve_lru)) return bdev->driver->io_mem_reserve(bdev, mem); if (bdev->driver->io_mem_reserve && @@ -157,7 +157,7 @@ void ttm_mem_io_free(struct ttm_bo_device *bdev, { struct ttm_mem_type_manager *man = &bdev->man[mem->mem_type]; - if (likely(man->io_reserve_fastpath)) + if (likely(!man->use_io_reserve_lru)) return; if (bdev->driver->io_mem_reserve && diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 732167cad130..45522e4fbd6b 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -155,7 +155,6 @@ struct ttm_mem_type_manager_func { * @use_io_reserve_lru: Use an lru list to try to unreserve io_mem_regions * reserved by the TTM vm system. * @io_reserve_lru: Optional lru list for unreserving io mem regions. - * @io_reserve_fastpath: Only use bdev::driver::io_mem_reserve to obtain * @move_lock: lock for move fence * static information. bdev::driver::io_mem_free is never used. * @lru: The lru list for this memory type. @@ -184,7 +183,6 @@ struct ttm_mem_type_manager { void *priv; struct mutex io_reserve_mutex; bool use_io_reserve_lru; - bool io_reserve_fastpath; spinlock_t move_lock; /*