From patchwork Mon Nov 27 12:21:06 2017 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: 10076733 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 9FF4E60353 for ; Mon, 27 Nov 2017 12:21:13 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9DE5528D5E for ; Mon, 27 Nov 2017 12:21:13 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 922F828D81; Mon, 27 Nov 2017 12:21:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1064C28D5E for ; Mon, 27 Nov 2017 12:21:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6DC136E2BE; Mon, 27 Nov 2017 12:21:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-wr0-x241.google.com (mail-wr0-x241.google.com [IPv6:2a00:1450:400c:c0c::241]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0B0E16E2BE for ; Mon, 27 Nov 2017 12:21:10 +0000 (UTC) Received: by mail-wr0-x241.google.com with SMTP id z75so24834040wrc.5 for ; Mon, 27 Nov 2017 04:21:10 -0800 (PST) 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=Pyc9aIz+s3/4G40e1+wKuctyUCQS3Ipnv84SpZYTI/8=; b=p0InO/3pI5p2+UdQh86eXQeqTJ/D5XcxSW2UouGoymYLad6v5fOyU2Ez0Mq0HETux0 yY4HQf9mpmHnjGq4yS8cY16PhcVjHInINLIr6dkxqRW6sNPL+7ixNZsbshruxlJ4A/aH 1Saw9grgS/iWTvZ2+wvrQjn5med5RmnDyhviwhoXOKUgXur4NsSfwt5RC0ryueCfwjFb lMEYRWv4v8vIhoPMr0IQaycKzCzPomGcZR7ZxH61+E4Y1fOpJE0hfsmK0jSun6FowL9y onFPcaQsx5AUyztFxo/nxvhcjUwzDnxZwznwMN2GlJWndwy8MW4AoPv0d96ZY2ekpkND HV2Q== 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=Pyc9aIz+s3/4G40e1+wKuctyUCQS3Ipnv84SpZYTI/8=; b=qsYky3dNmRXuTy1YVQQ2dyC9HfouEGwmhyT8OgGop/If7e1eEbMgrOEyvVlUim6rQj p/4lLGg8wZ0zxOHhiuWviG7iFPVhfZgAei8q/GvaKp7W+qHeQrTnFCUeYIyuOb/LK5gh RKqgInWC2Gj/3f3I5cBYh2FFwsXXu5ZSZbQKdZQ2JEJW9C39K8AIdaM7rnp+7Qkbr5mW M0OqoVR1q4VdX1R9QKEBtMUBrN9wuoLmJwGkHGU2JNqyhRc9LEe+i3T4m+d9NOps4DYp W0C6e+YnSBGNCN4E9Amq6XB5EucVYms6IKUwmgQmk6YQkU7LWp927WLGgyZe2vBVBIMZ s9ZA== X-Gm-Message-State: AJaThX4K2UCseQFzE9ymPLJRaDgnUQJm9AKpwL8DLG2m/QcbzVVD/1pQ rXBsUJKQDlmY2isJ8kMTRaoUPQ== X-Google-Smtp-Source: AGs4zMbhGVTpXNhDG4QUE3Mk4i2UICoWSWjI/w5OcUqUJQUaGNW0D57G8/2qSSnSk3YrdhV1pz8k5g== X-Received: by 10.223.135.243 with SMTP id c48mr28871108wrc.140.1511785269390; Mon, 27 Nov 2017 04:21:09 -0800 (PST) Received: from localhost.localdomain ([2a02:908:1251:7981:c107:d5ed:1e56:a793]) by smtp.gmail.com with ESMTPSA id k30sm51397780wrf.63.2017.11.27.04.21.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Nov 2017 04:21:08 -0800 (PST) From: "=?UTF-8?q?Christian=20K=C3=B6nig?=" X-Google-Original-From: =?UTF-8?q?Christian=20K=C3=B6nig?= To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/ttm: fix populate_and_map() functions once more Date: Mon, 27 Nov 2017 13:21:06 +0100 Message-Id: <20171127122106.17608-1-christian.koenig@amd.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 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" X-Virus-Scanned: ClamAV using ClamSMTP This reverts "drm/ttm: Fix configuration error around populate_and_map() functions". This fix has gone into the wrong direction. Those helpers should be available even when neither CONFIG_INTEL_IOMMU nor CONFIG_SWIOTLB are set. Signed-off-by: Christian König Acked-by: Alex Deucher --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 2 -- include/drm/ttm/ttm_page_alloc.h | 32 ++++++++++---------------------- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index 1543532b8740..c82d94cbbabc 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -1096,7 +1096,6 @@ void ttm_pool_unpopulate(struct ttm_tt *ttm) } EXPORT_SYMBOL(ttm_pool_unpopulate); -#if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU) int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt) { unsigned i, j; @@ -1167,7 +1166,6 @@ void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt) ttm_pool_unpopulate(&tt->ttm); } EXPORT_SYMBOL(ttm_unmap_and_unpopulate_pages); -#endif int ttm_page_alloc_debugfs(struct seq_file *m, void *data) { diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h index 38a2b4770c35..593811362a91 100644 --- a/include/drm/ttm/ttm_page_alloc.h +++ b/include/drm/ttm/ttm_page_alloc.h @@ -59,11 +59,20 @@ int ttm_pool_populate(struct ttm_tt *ttm); void ttm_pool_unpopulate(struct ttm_tt *ttm); /** + * Populates and DMA maps pages to fullfil a ttm_dma_populate() request + */ +int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt); + +/** + * Unpopulates and DMA unmaps pages as part of a + * ttm_dma_unpopulate() request */ +void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt); + +/** * Output the state of pools to debugfs file */ int ttm_page_alloc_debugfs(struct seq_file *m, void *data); - #if defined(CONFIG_SWIOTLB) || defined(CONFIG_INTEL_IOMMU) /** * Initialize pool allocator. @@ -83,17 +92,6 @@ int ttm_dma_page_alloc_debugfs(struct seq_file *m, void *data); int ttm_dma_populate(struct ttm_dma_tt *ttm_dma, struct device *dev); void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev); - -/** - * Populates and DMA maps pages to fullfil a ttm_dma_populate() request - */ -int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt); - -/** - * Unpopulates and DMA unmaps pages as part of a - * ttm_dma_unpopulate() request */ -void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt); - #else static inline int ttm_dma_page_alloc_init(struct ttm_mem_global *glob, unsigned max_pages) @@ -116,16 +114,6 @@ static inline void ttm_dma_unpopulate(struct ttm_dma_tt *ttm_dma, struct device *dev) { } - -static inline int ttm_populate_and_map_pages(struct device *dev, struct ttm_dma_tt *tt) -{ - return -ENOMEM; -} - -static inline void ttm_unmap_and_unpopulate_pages(struct device *dev, struct ttm_dma_tt *tt) -{ -} - #endif #endif