From patchwork Mon Apr 26 17:58:24 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: 12224835 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,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 277C6C433ED for ; Mon, 26 Apr 2021 17:58:30 +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 CCF7861007 for ; Mon, 26 Apr 2021 17:58:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org CCF7861007 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 19B5489E98; Mon, 26 Apr 2021 17:58:29 +0000 (UTC) Received: from mail-ej1-x630.google.com (mail-ej1-x630.google.com [IPv6:2a00:1450:4864:20::630]) by gabe.freedesktop.org (Postfix) with ESMTPS id 43A8289E98 for ; Mon, 26 Apr 2021 17:58:27 +0000 (UTC) Received: by mail-ej1-x630.google.com with SMTP id u17so85842475ejk.2 for ; Mon, 26 Apr 2021 10:58:27 -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:mime-version :content-transfer-encoding; bh=ywul3QoLQPIrhQlLZSU4d5QNhbrOkU7VHmvSXIsElvY=; b=UVw/TD/K9+dqww1ZGpuiFnw2PH6ALpi1u7UPh0amWt0RdAw7a/OVDK/ksYmd8haJDv pUeUHRAnnrFoaHJSFyZsavrEc4ITgC8YWv+4Feq4S2Y0ZOQ+qVi0pX3o6JUY4V7t6INJ I/vsyFC3ezVOiz2mHQHZIipUTYqjn5+nIxvwuFr9yiL+6SvpbaFKpL/e47F7RBpwW5/l ds4JBpH817VFkzAVPuz9OrgPrmEwg0EgYRNK12Fy1QomZJwMIrqJlwGfLpIpIVdZBPhW Ka5I/ooDYRuawXz6hXMH6sDSn4lLSRhAALPcYZrbTfXwvoALVrW//3Bk7mIfw0T/S9p2 qOCQ== 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:mime-version :content-transfer-encoding; bh=ywul3QoLQPIrhQlLZSU4d5QNhbrOkU7VHmvSXIsElvY=; b=T0nPT9TX3wTEFGCxEWK20GArIrZ8vITgF6cxs0WbOM/p8q2FdSUTgS4GrRdumM6969 juNadRs+GuCw0zbsLAKZSy8Dpax1NKNtWfxUnk+/XpuYdMIsIWC9EgbsGi5MTZTmfylE KqmZ8xK2jBliz3K3yIpwEfY4gnoe4tWRaUNp9ZfCKTfksvgow/ZgFjPTm2R/97wbv+wG GrAlwwX2oz8LKWpEyOmba/ZRyIufPpdifaaucddqNgru4Ad7TX5XlO2tDyUzSMOi/zdW UWX/Bf5fAQEXJtHuXP6+XrktdvALbagP5j3VRgRZwrn2ptJYgXalBg5A6INuU9PkzfdI EgPA== X-Gm-Message-State: AOAM531MA6x8Eg18WZZzwYqmHf4T6X00wQXAYLFglLn0RxzNP8BY2K9L LWDiCB4OPi1xsl1qRBJfne9IIvOqDyI= X-Google-Smtp-Source: ABdhPJxOe4DelTFwUCwmcbSCZp8aFwgmXcRdzFSDRkelHm7RCN0Gzqfd0j+UWmJKa4y3rANGGa+Umw== X-Received: by 2002:a17:907:7b9f:: with SMTP id ne31mr4292994ejc.139.1619459906035; Mon, 26 Apr 2021 10:58:26 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:2d9a:6314:c432:32a0]) by smtp.gmail.com with ESMTPSA id b8sm11841982ejc.29.2021.04.26.10.58.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Apr 2021 10:58:25 -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] drm/ttm: cleanup ttm_agp_backend Date: Mon, 26 Apr 2021 19:58:24 +0200 Message-Id: <20210426175824.122557-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.25.1 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: bskeggs@redhat.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Audit the includes and stop accessing the internal drm_mm_node. The ttm_resource::start should be the same value as the drm_mm_node::start. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_agp_backend.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_agp_backend.c b/drivers/gpu/drm/ttm/ttm_agp_backend.c index 0226ae69d3ab..6ddc16f0fe2b 100644 --- a/drivers/gpu/drm/ttm/ttm_agp_backend.c +++ b/drivers/gpu/drm/ttm/ttm_agp_backend.c @@ -32,8 +32,9 @@ #define pr_fmt(fmt) "[TTM] " fmt -#include -#include +#include +#include +#include #include #include #include @@ -50,7 +51,6 @@ int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem) { struct ttm_agp_backend *agp_be = container_of(ttm, struct ttm_agp_backend, ttm); struct page *dummy_read_page = ttm_glob.dummy_read_page; - struct drm_mm_node *node = bo_mem->mm_node; struct agp_memory *mem; int ret, cached = ttm->caching == ttm_cached; unsigned i; @@ -76,7 +76,7 @@ int ttm_agp_bind(struct ttm_tt *ttm, struct ttm_resource *bo_mem) mem->is_flushed = 1; mem->type = (cached) ? AGP_USER_CACHED_MEMORY : AGP_USER_MEMORY; - ret = agp_bind_memory(mem, node->start); + ret = agp_bind_memory(mem, bo_mem->start); if (ret) pr_err("AGP Bind memory failed\n");