From patchwork Thu Feb 11 13:16:58 2021 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: 12083233 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D88AC433DB for ; Thu, 11 Feb 2021 13:17:14 +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 AE76564E7A for ; Thu, 11 Feb 2021 13:17:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AE76564E7A 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 E9DC46EE28; Thu, 11 Feb 2021 13:17:06 +0000 (UTC) Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by gabe.freedesktop.org (Postfix) with ESMTPS id 017556EE27 for ; Thu, 11 Feb 2021 13:17:03 +0000 (UTC) Received: by mail-ej1-x62d.google.com with SMTP id sa23so10044631ejb.0 for ; Thu, 11 Feb 2021 05:17:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=WMPOtCBxs2H9TjKbXHVExhNj7fMc+PCRUAafVs4cBgM=; b=pPaIgRGy71t6f4VObcK93VV62qexhAV4/U8KPjgUBzW5v9RvUt89yqsQCnsEJ8SJbj GCcaDUEI6z8PtPCDfzGWlZ64WDZ4iAu6/L9froTSZy33MVIlxLy0vXeW5BMQud7Kgtkg BpHtSpGgYc1H2FX0OhTdGfGCsMs0Bd5Zg+X27VhaENaDj7uS9frwHEoLzNp4zSicmZ96 oF7DDXfOGc++bxZBG5E2wbuJfqNW2ekXFUNetD6WL5ghk8Xz4axXH8wRHb31oR5f2U3D TzOqFIqQ4ZIMi1JGWSYC8qHUiXVR4koKIUmsLDkyc2QQLuY1+KXdmxzdzgdkTNRy/OdR ZIzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=WMPOtCBxs2H9TjKbXHVExhNj7fMc+PCRUAafVs4cBgM=; b=nQWzIxbmoE+NIGaLNbLL0NioLpFIHB0OA/oVYK3IE79xkVYLZGOG2u1BzBBr/Wc4r7 XnAefVEfLNSRzqRnYEcOoMdR7iQ57rk26EoXNAyMJzHJ5UquUge3OQ7JFgAoI7EL+eas K1ZHGbwk+H3kOaEDNoP3G+30YKy4EWmEHHmkCNzsrIk+8JJmOc2y1rtSXZZleW6kx/XP /Srj9Gi7acNs+izmDo3YVr+0C08u1JCt0XjUSaq1xyrGLqKEsYkQfMO+Rss6gtMxk76I 3iakiA0KzndrMs2EU6OMK93VF+1U7l7MZ3/kTF9jzlt/9NfDXk+Ie3pKiFKkYw5QQAoL xtUw== X-Gm-Message-State: AOAM533ciVOi0/rm3kHnhrMjxhdAC5TaZlGcnM7wnCYw0tFVTHcmNARG NXIqiP+FOs/kQruIZA36Bxw= X-Google-Smtp-Source: ABdhPJzv4brBX+YQBn3IyWR6tV1wQfHX6Q/cqHQaZF+x6wx3ohXlgWc5Hgih3cNU6bb4D0OwYekbRA== X-Received: by 2002:a17:906:71d5:: with SMTP id i21mr8699781ejk.232.1613049422619; Thu, 11 Feb 2021 05:17:02 -0800 (PST) Received: from abel.fritz.box ([2a02:908:1252:fb60:820:5af6:9146:2c9f]) by smtp.gmail.com with ESMTPSA id l1sm4168614eje.12.2021.02.11.05.17.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Feb 2021 05:17:02 -0800 (PST) From: " =?utf-8?q?Christian_K=C3=B6nig?= " X-Google-Original-From: =?utf-8?q?Christian_K=C3=B6nig?= To: tzimmermann@suse.de, airlied@linux.ie, daniel@ffwll.ch, kraxel@redhat.com, zackr@vmware.com, dri-devel@lists.freedesktop.org Subject: [PATCH 3/4] drm/nouveau: clean up nouveau_bo_move_ntfy Date: Thu, 11 Feb 2021 14:16:58 +0100 Message-Id: <20210211131659.276275-3-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210211131659.276275-1-christian.koenig@amd.com> References: <20210211131659.276275-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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Just another leftover from a TTM cleanup. Signed-off-by: Christian König --- drivers/gpu/drm/nouveau/nouveau_bo.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c index ca2a8ae1938e..9bb8cee3df40 100644 --- a/drivers/gpu/drm/nouveau/nouveau_bo.c +++ b/drivers/gpu/drm/nouveau/nouveau_bo.c @@ -861,9 +861,8 @@ nouveau_bo_move_init(struct nouveau_drm *drm) NV_INFO(drm, "MM: using %s for buffer copies\n", name); } -static void -nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, bool evict, - struct ttm_resource *new_reg) +static void nouveau_bo_move_ntfy(struct ttm_buffer_object *bo, + struct ttm_resource *new_reg) { struct nouveau_mem *mem = new_reg ? nouveau_mem(new_reg) : NULL; struct nouveau_bo *nvbo = nouveau_bo(bo); @@ -949,7 +948,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, return ret; } - nouveau_bo_move_ntfy(bo, evict, new_reg); + nouveau_bo_move_ntfy(bo, new_reg); ret = ttm_bo_wait_ctx(bo, ctx); if (ret) goto out_ntfy; @@ -1014,9 +1013,7 @@ nouveau_bo_move(struct ttm_buffer_object *bo, bool evict, } out_ntfy: if (ret) { - swap(*new_reg, bo->mem); - nouveau_bo_move_ntfy(bo, false, new_reg); - swap(*new_reg, bo->mem); + nouveau_bo_move_ntfy(bo, &bo->mem); } return ret; } @@ -1290,7 +1287,7 @@ nouveau_bo_fence(struct nouveau_bo *nvbo, struct nouveau_fence *fence, bool excl static void nouveau_bo_delete_mem_notify(struct ttm_buffer_object *bo) { - nouveau_bo_move_ntfy(bo, false, NULL); + nouveau_bo_move_ntfy(bo, NULL); } struct ttm_device_funcs nouveau_bo_driver = {