From patchwork Tue Sep 15 14:30:55 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: 11776753 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 7FE49139F for ; Tue, 15 Sep 2020 14:31:02 +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 4FB8423D37 for ; Tue, 15 Sep 2020 14:31:02 +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="WduzwhHW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4FB8423D37 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 EC36989FCC; Tue, 15 Sep 2020 14:30:58 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 209FA89FAC for ; Tue, 15 Sep 2020 14:30:58 +0000 (UTC) Received: by mail-ed1-x544.google.com with SMTP id ay8so3248195edb.8 for ; Tue, 15 Sep 2020 07:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=vHe59uaejVNgZd3egV7MKNyj+7/UHmN9U8gc88ERG54=; b=WduzwhHWVqoiE2hsg/+LmJB//nGEamLH5K69Egnu8fAOXwmcYC64zSwrD+ilXr1kd7 ycHEHueWK0OGPW6bnfEKhQ7sGKZV2L37uGX92GChVDxCguNjIUNWcQUv+vm2h6nlrD5+ W1AP+nHn53PPSbSSI4qru7zQYrNCYW/gU5dMuYM5KIJk/jOIffL0B/x4CY0MealpCToD O7Hx5FplDXgwBtRkRGc1WFDbw9/2YNCRTkdCOIq5I/rnAjiUEfmBiMKr/vl5IksVxEjm SxrlZXhVUPnyNq8uTW1BDThrO/8fBDALR9MifiZI0gUZWHD9VKJIOvFXyBTdISQi2lrf Zs/A== 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:mime-version :content-transfer-encoding; bh=vHe59uaejVNgZd3egV7MKNyj+7/UHmN9U8gc88ERG54=; b=D8NTWxZQeoQduAQIoLI8NiuxOl0dvY40SNojEYVRjDWjzcXGhdwVtoniZKKCvlrJdx WitQXdmp3AlWjCj/EI3IBZsKJVkUu0fr5uESoabkH/olW8CwGaTuWOou3bh4+XNxZTNm 7H/J/5OQ73jUJs6A2iyeWjgMhxHHfZtGagTfevWXyE7m75nluiOIkNVUwbZQqTxHtql1 VxOtFjwiyCs8QfTtJfg+hJM4vJdtK7YuCJBsentzt5aajpArc+8GpwVn5C/3WTF2seAL e0PJ4r9AAI+JIF60La2+QwN/xtfJP7vjNarn8r22gY4+PaXaa447CxooeEZcMI5SGrAy O1dA== X-Gm-Message-State: AOAM533GwBiahH16+tiuqQpDgrAhlDKzCgLU0PlymOb5W9F/Tyk3Soxc ldD71xWs7c5zW2LmH6+bvMfg0iBhEABuCA== X-Google-Smtp-Source: ABdhPJwQ+1n4xY7y0TnI9A3lgd5rysk5nt6hA0NM8YzoWY0GXvgMGW/5U48tf3uZy68LAy9RrV//AQ== X-Received: by 2002:a05:6402:138a:: with SMTP id b10mr22735135edv.113.1600180256540; Tue, 15 Sep 2020 07:30:56 -0700 (PDT) Received: from abel.fritz.box ([2a02:908:1252:fb60:486d:c4b9:3aa9:add9]) by smtp.gmail.com with ESMTPSA id j3sm1582420edy.7.2020.09.15.07.30.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 15 Sep 2020 07:30:55 -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: some cleanups Date: Tue, 15 Sep 2020 16:30:55 +0200 Message-Id: <20200915143055.56565-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.17.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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Unexport ttm_check_under_lowerlimit. Make ttm_bo_acc_size static and unexport it. Remove ttm_get_kernel_zone_memory_size. Signed-off-by: Christian König Reviewed-by: Michael J. Ruhl Reviewed-by: Dave Airlie --- drivers/gpu/drm/ttm/ttm_bo.c | 7 +++---- drivers/gpu/drm/ttm/ttm_memory.c | 7 ------- include/drm/ttm/ttm_bo_api.h | 12 ------------ include/drm/ttm/ttm_memory.h | 1 - 4 files changed, 3 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index ee2632128d3c..ffbdc20d8e8d 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1254,9 +1254,9 @@ int ttm_bo_init(struct ttm_bo_device *bdev, } EXPORT_SYMBOL(ttm_bo_init); -size_t ttm_bo_acc_size(struct ttm_bo_device *bdev, - unsigned long bo_size, - unsigned struct_size) +static size_t ttm_bo_acc_size(struct ttm_bo_device *bdev, + unsigned long bo_size, + unsigned struct_size) { unsigned npages = (PAGE_ALIGN(bo_size)) >> PAGE_SHIFT; size_t size = 0; @@ -1266,7 +1266,6 @@ size_t ttm_bo_acc_size(struct ttm_bo_device *bdev, size += ttm_round_pot(sizeof(struct ttm_tt)); return size; } -EXPORT_SYMBOL(ttm_bo_acc_size); size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev, unsigned long bo_size, diff --git a/drivers/gpu/drm/ttm/ttm_memory.c b/drivers/gpu/drm/ttm/ttm_memory.c index acd63b70d814..987aa32c4808 100644 --- a/drivers/gpu/drm/ttm/ttm_memory.c +++ b/drivers/gpu/drm/ttm/ttm_memory.c @@ -554,7 +554,6 @@ ttm_check_under_lowerlimit(struct ttm_mem_global *glob, return false; } -EXPORT_SYMBOL(ttm_check_under_lowerlimit); static int ttm_mem_global_reserve(struct ttm_mem_global *glob, struct ttm_mem_zone *single_zone, @@ -682,9 +681,3 @@ size_t ttm_round_pot(size_t size) return 0; } EXPORT_SYMBOL(ttm_round_pot); - -uint64_t ttm_get_kernel_zone_memory_size(struct ttm_mem_global *glob) -{ - return glob->zone_kernel->max_mem; -} -EXPORT_SYMBOL(ttm_get_kernel_zone_memory_size); diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 36ff64e2736c..fd8d29f5f370 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -352,18 +352,6 @@ void ttm_bo_unlock_delayed_workqueue(struct ttm_bo_device *bdev, int resched); bool ttm_bo_eviction_valuable(struct ttm_buffer_object *bo, const struct ttm_place *place); -/** - * ttm_bo_acc_size - * - * @bdev: Pointer to a ttm_bo_device struct. - * @bo_size: size of the buffer object in byte. - * @struct_size: size of the structure holding buffer object datas - * - * Returns size to account for a buffer object - */ -size_t ttm_bo_acc_size(struct ttm_bo_device *bdev, - unsigned long bo_size, - unsigned struct_size); size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev, unsigned long bo_size, unsigned struct_size); diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h index c78ea99c42cf..2d468d7c94e6 100644 --- a/include/drm/ttm/ttm_memory.h +++ b/include/drm/ttm/ttm_memory.h @@ -91,7 +91,6 @@ extern int ttm_mem_global_alloc_page(struct ttm_mem_global *glob, extern void ttm_mem_global_free_page(struct ttm_mem_global *glob, struct page *page, uint64_t size); extern size_t ttm_round_pot(size_t size); -extern uint64_t ttm_get_kernel_zone_memory_size(struct ttm_mem_global *glob); extern bool ttm_check_under_lowerlimit(struct ttm_mem_global *glob, uint64_t num_pages, struct ttm_operation_ctx *ctx); #endif