From patchwork Wed Aug 15 07:41:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 10566371 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 199081510 for ; Wed, 15 Aug 2018 07:41:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0A5EB29DF3 for ; Wed, 15 Aug 2018 07:41:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F0DA129DFD; Wed, 15 Aug 2018 07:41:37 +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=-5.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 BDE9B29DF3 for ; Wed, 15 Aug 2018 07:41:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BF9D76E31B; Wed, 15 Aug 2018 07:41:33 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0046.outbound.protection.outlook.com [104.47.38.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 300976E318; Wed, 15 Aug 2018 07:41:32 +0000 (UTC) Received: from BN4PR12CA0005.namprd12.prod.outlook.com (2603:10b6:403:2::15) by MWHPR1201MB2508.namprd12.prod.outlook.com (2603:10b6:300:df::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.22; Wed, 15 Aug 2018 07:41:29 +0000 Received: from CO1NAM03FT044.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::202) by BN4PR12CA0005.outlook.office365.com (2603:10b6:403:2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1038.21 via Frontend Transport; Wed, 15 Aug 2018 07:41:29 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by CO1NAM03FT044.mail.protection.outlook.com (10.152.81.108) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.1059.14 via Frontend Transport; Wed, 15 Aug 2018 07:41:28 +0000 Received: from hr-intel.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.389.1; Wed, 15 Aug 2018 02:41:26 -0500 From: Huang Rui To: , Subject: [PATCH] drm/ttm: remove dead codes Date: Wed, 15 Aug 2018 15:41:20 +0800 Message-ID: <1534318880-31836-1-git-send-email-ray.huang@amd.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(396003)(376002)(136003)(39860400002)(346002)(2980300002)(428003)(199004)(189003)(53936002)(104016004)(356003)(8936002)(305945005)(186003)(126002)(2616005)(476003)(50226002)(51416003)(7696005)(426003)(336012)(72206003)(47776003)(1857600001)(486006)(77096007)(97736004)(14444005)(478600001)(26005)(105586002)(106466001)(48376002)(316002)(6666003)(68736007)(450100002)(4326008)(81166006)(86362001)(81156014)(5660300001)(50466002)(2906002)(8676002)(36756003)(16586007)(53416004)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB2508; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT044; 1:0GmBpop9EuRmsCIeYIVfNp6AnjOfDxvS8WqnZqs3pzL4v/b3FhVzfi3hoHkqwcdZDkQRURiVpmsI1yPdE54hyxjeXe+kqF4vYRj/cjb+vCHAlq17ooaZJiYCNcc/WW8+ X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: acbff5cc-29a1-488c-6e64-08d60282832c X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:MWHPR1201MB2508; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB2508; 3:2bj9T+tQHeBF747KHRLmVtSt6A8Qx7We0orq83IRphL9s2nNmoWUn9WByqtkkir9tIrBlRJDMUkcAw/KuB613f3G+xNSKg+icx5QLt5DZVt5OrCKzJWo9fOT4mUbDMjngIxCLU+2R+uO2H1LWIr5DvKupVu0WhuBLBqKH9BWacdvm4tIl4WgXkQniw56RuH3vicg443GDZiT8/i1zCPKOal+xM+KqeXQqlo4Znn0ByYbp3gI7DFklnAGWjaXm1pYe4xqMakkfT2jWMZDZBCjFDZFAHtWiXlZqja+lJ2MpyI0GWR40GOFQIkrh+MItkGCtEGzfWdM6Vw0Z8/meyoDz7f6xMwB/aXYtdxxaURvRKI=; 25:lTTFwvoMLy3DTZ1PVjEFXVeZIM6f03OhrsVNR5Dh7Otp5MKMQtXz74x2JIY2AlsE4yhL9/zUHfSzgk4NdybmOnecLsAOQ8jS6swaKXfO1xK2Ru1yp6ZSiINtSab/QOe0DUeD3ldcxuKYrQ32YrbGnnoP/JT5o0zRiroOTNbE+pKU2yadyUyLxpOg+SQFjmdxS4buu4hUok+tw0sPgGmQgxam70IcLaWQbHP4WMMfLhXmGrug0SVClieXrXCBeaXPJnMhDs1e4gSIO7AgSpaRLLQDx8lBnPIAzYTgjjOVBLCFTgShVDVcdnlgQ/KDtqzpLMRUKmFG0JVwzSRoq3awGg== X-MS-TrafficTypeDiagnostic: MWHPR1201MB2508: X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB2508; 31:00oW5GyrP6lpKiNa2hZmHVj1Kmr4HsCDXLWt9eXCAH02L8W7IDDY7GOWqs2mfo9Sg3vb3EOX4xBAuQcVHvOILP29bPFvzWLFc30u+hezlrSb10McixbMPUKeyI881l9LKVFQg0GKpYsZldcpE6ib588AHI826Wxbu7HcU7e0WKLF7m/Kx2kqNQuDnK4GIN8jC4AFdApCWMf4DBo2b9vwmbsp9gvRDiAFoXwxadi6f88=; 20:H+gMkeL7moI/KheFE2nBEWC9qN/Mt6SxBicz8uRqHl3va/EXMn8PgibWcmnmv/ak7UZj/3ac1V1A4ipBwX5npjF5wUBYRei06NXdqtiYRCBjx5yRpzZAMMQylJXQO0R2pYAgjflxlphKX6TzPnko8eZ7zbsj28SH8X/PMurlzv9D3olxN+vHqI5zRDK2anVgyElsVLRULzAamC8uyIoiiDAkjSxhI6LgIOEN+ptX8ThDoJZmJyRw2HAulC2yrVCXRuAMs2l3pQHq0SpZJHkSCDkljOYt/91VgPWhy3qsK27nReya2z+fO8ETi7wDVUdVdlAWb1TUDG0Z12YU2d0Ncf21y5cWr2PU7JWw37gvaNCCanvRFucOX94UtBeQ4BlNqnxjfp4jUyHLCvD5CiD7Bkdd0PRSkfO4e/Q0lKsGGEyool5AN1z3m98CjIHSm6PM4G5rUUyfONDAvPh8LVlhR64MWr5A5JW3p4WAohd6LTu3XBOcNHT6+PNY151CTKsb X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93003095)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:MWHPR1201MB2508; BCL:0; PCL:0; RULEID:; SRVR:MWHPR1201MB2508; X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB2508; 4:pNDQf97KMAEGP/kj4ulowDrY2RayLsCjDNwCHAejJb55lxL1EMZyNTYFdVuU7BjaAXnRxrlpsxscXLetKFrhqsK+4PLtZZm7/2c2+XU6Qzqe2AQRCXpJ6kJWx+MH8inaU8CQonVL1p5Id1/D9tBxTWmds5hxjYp5L/KuAbFdgJFh7ddm0LIEcvW0xGHvHifSz3/rUmsF9sB7UfaIxJyT/AkriXszzMvJfPVu8V1Ti3dF7PFh32OMcvKR0PnvCj+WUZGPKDX2LnS3KuqUSomV8RazlrfhRxmsOs9wkYv1IGoTxVoHgP9V/c+2LPwSRZoJ X-Forefront-PRVS: 07658B8EA3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR1201MB2508; 23:jQ3APmPCFP2hfeMH4+gCuKPP674gxtJf5tlZIhL?= 9vB1pUAwZZFv+C047kkxIz6NQeKBL05rWeH9vjLyuYZjTHAY7LTjQgDh7KIQ8zCp8d9HBfEvcr85llMfL7mQUVtEDF2Z/PVH3Ce+q3zAt82/6pXvAY9oQ1QehtFvRVRkmFYOZnDXgmtAs+Hkmop14nuqhvleIqJQJYyc6ifc/WU7Tv8vwb85DpZrFYkVMvZNj8Ryp46TGq7qjvc5WO7SXFEwdZpDGdM/Ly0tV+ESW3ZXyHOtHjxox7ZWsVoDffX5nK7gVXtMRxp9yw6kGKiRRr8iE64e3ISrEX6/dx6L4nmYJeLQH2hk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adata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR1201MB2508; 20:tzBI56buy0iSTFMksWyqwdJIcQ48iMl9Cb+b6+H8wrMMGLwnNTvPVvyoFuJWiPjjg0r0EUOe76toCqb58z8+/29dYV2+KT9fikoKvkXZX3eJZQnAPa0nmtZCfXJkaeBYnmRTDCWCdhUETbjK4bmxVnh4Bb8aJrAOkVyK6peR4wfAEthvg3AshpCqRCs/9yU1Rmc1vfAizpOZj+fAhsOzx+PiMr+NxycEpFfvyuFzcJcCXzIoQ4FBoblpbDkjX+8h X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2018 07:41:28.1266 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: acbff5cc-29a1-488c-6e64-08d60282832c X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV02.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB2508 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Huang Rui Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP These codes are not used. Signed-off-by: Huang Rui Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo_util.c | 5 +---- drivers/gpu/drm/ttm/ttm_page_alloc_dma.c | 8 +------- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/ttm/ttm_bo_util.c b/drivers/gpu/drm/ttm/ttm_bo_util.c index 046a6dd..ba80150 100644 --- a/drivers/gpu/drm/ttm/ttm_bo_util.c +++ b/drivers/gpu/drm/ttm/ttm_bo_util.c @@ -629,10 +629,7 @@ int ttm_bo_kmap(struct ttm_buffer_object *bo, return -EINVAL; if (start_page > bo->num_pages) return -EINVAL; -#if 0 - if (num_pages > 1 && !capable(CAP_SYS_ADMIN)) - return -EPERM; -#endif + (void) ttm_mem_io_lock(man, false); ret = ttm_mem_io_reserve(bo->bdev, &bo->mem); ttm_mem_io_unlock(man); diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c index 507be7a..d594f75 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc_dma.c @@ -410,13 +410,7 @@ static unsigned ttm_dma_page_pool_free(struct dma_pool *pool, unsigned nr_free, if (NUM_PAGES_TO_ALLOC < nr_free) npages_to_free = NUM_PAGES_TO_ALLOC; -#if 0 - if (nr_free > 1) { - pr_debug("%s: (%s:%d) Attempting to free %d (%d) pages\n", - pool->dev_name, pool->name, current->pid, - npages_to_free, nr_free); - } -#endif + if (use_static) pages_to_free = static_buf; else