From patchwork Thu Oct 12 11:26:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "StDenis, Tom" X-Patchwork-Id: 10001701 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 2308760325 for ; Thu, 12 Oct 2017 11:41:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 148FF28D69 for ; Thu, 12 Oct 2017 11:41:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 093A728D74; Thu, 12 Oct 2017 11:41:44 +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=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, 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 7985828D69 for ; Thu, 12 Oct 2017 11:41:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7DD1A6E80A; Thu, 12 Oct 2017 11:41:42 +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-bl2nam02on0044.outbound.protection.outlook.com [104.47.38.44]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88B936E80A for ; Thu, 12 Oct 2017 11:41:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=roheU8Jimn6C0m0HHrjtbIsS53dU/raxclksdyY1tVk=; b=4uWaCuK6H++li/BlOuDTR3XTJvYn1DJGGC0ZP//LHZ9LSBVVabjk8D2mxh3PSWlwwUx6BMiLMwhkNGIuEpu0ihixF+Q2m7J+sKODCWA29X7uYiL1suVMExNWFS5vDLZXI3pVaft/Nky/kYFuk0Rmy7HAiErm8cvJMPNydCmDv28= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Tom.StDenis@amd.com; Received: from fx8.amd.com (165.204.55.251) by BN6PR1201MB0068.namprd12.prod.outlook.com (10.174.114.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 12 Oct 2017 11:26:55 +0000 From: Tom St Denis To: amd-gfx@lists.freedesktop.org Subject: [PATCH] drm/ttm: Fix unused variables with huge page support Date: Thu, 12 Oct 2017 07:26:42 -0400 Message-Id: <20171012112642.26350-1-tom.stdenis@amd.com> X-Mailer: git-send-email 2.12.0 MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: MWHPR0201CA0060.namprd02.prod.outlook.com (10.167.160.37) To BN6PR1201MB0068.namprd12.prod.outlook.com (10.174.114.18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5da5ee55-1695-4e8a-5e9e-08d511642506 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR1201MB0068; X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0068; 3:k/ncxVU78HtIf6N8u7sty2PDsdqActDO4U8TdUyQvQUN4MGCJNFK3gWSFd4Z6rPkiAqF0J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dooo+UgLdWDQYRCTirJAUZLNfGoz+ju6XET32rgorh6cAK/INVN6spqgY9TRVqe5746Laluk8P7NC7I2B142Fi40f85VNDM6MH9+EAjLygguOEzvICJUCu7Eng55rfyt1kgr/s6eRe9Nca21X88fbqqGYC+kk3NBhlakgx7qsm9ZnOxcXJNcFRkPmqqsNnHMg6FOhOwsNBt5gKejaSSe6gc/Tq4Q0HJ1iBgQKKanXWQrFWZuh79qjsLwNjkzreuIkqvmT2bgJsZrkfc5duZXZqLL94TnMKTXn8kfsiMfRXzzeUCSa339xR; 4:Uu9jI+ff1wEEzr5oRbrK1qnmuFsNYNk68edUULksHBFWcH72scoEtbTJi8uiACfheldfb/S4hmqrJ8EoyPTS+Z0R0KzkdqsngBw4H7lP6Dve+xFz9nzrvPy7bzZttNJuX+9sBZn4CZttOMDivtvhz9/ytIF9PQ3L3aRDOrsroAj13ntsu/PqXttHHtVz7XMVhCrhj29RiFmY2C0ZkGmhuch+dwauLfGR8kErmAOLdM0m/HqMF6MJ1GVp04ydjXZjSaJ2uEkZomUC90QPEvI3bWbVh6FCGTcKlsFmbpo1iow= X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(3002001)(6055026)(6041248)(20161123558100)(20161123564025)(20161123562025)(20161123555025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR1201MB0068; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR1201MB0068; X-Forefront-PRVS: 04583CED1A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(199003)(189002)(47776003)(86362001)(8676002)(189998001)(4326008)(3846002)(36756003)(5660300001)(66066001)(6116002)(68736007)(101416001)(305945005)(6916009)(50226002)(1076002)(72206003)(50986999)(6666003)(97736004)(478600001)(50466002)(8936002)(53936002)(316002)(7736002)(48376002)(33646002)(2906002)(16586007)(81166006)(81156014)(2361001)(2351001)(450100002)(16526018)(25786009)(6486002)(106356001)(53416004)(5003940100001)(105586002)(14583001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR1201MB0068; H:fx8.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR1201MB0068; 23:ZlUoERoJq8/CU/NlKUUJMjEO+5An/Y+v5WV15Ff?= =?us-ascii?Q?c6vA+PILOAIfieSOjkCjag6NClDr9DMPzw9PZk12Oj1nRbig+kmKREJfhIR1?= =?us-ascii?Q?A6eEz5MXhVeC6QIv7Rddw7KcvszJfu9ET+UPkJsPtVQDSiOOikdP7Y9p0iK/?= =?us-ascii?Q?HgxhfWJLfoje8YKGjjIZYWCs5GTIfuje7Ek9EjJgyJFvwr7qMu2UvvXF3G71?= =?us-ascii?Q?PmBOdiGcdqV/nn0hT+qEuZhoSJjifAHl9kEGiVGPubZLJaQ2cdMhDFVVXstp?= =?us-ascii?Q?pH/7I258EiaSkNiSjblRthJul9AL+gaAWEAYpmX2pKfqNxjeF6oS2wpTFVjA?= =?us-ascii?Q?RU6/yjPugoz3Fcr8paJ/vjgpeNqaZ/WntpVRutgkdH6ARQbPhRVrWFhc4u+D?= =?us-ascii?Q?iopXsi1t619dObBreAIVxRiJdy4y8ogwR9MhGebdFwalgNE8djonGct06ylX?= =?us-ascii?Q?ZEJqrBNLQmDEcV3tDSyzfJ2asAGvR3OwKKrU4W0jW6VsgEKtbkWfieuOVKX7?= =?us-ascii?Q?IgjIkScc9/7yt+acFR09YGmQHhM8f+vDqkUli+yhaZy5vAksSIDEdgN4b1tm?= =?us-ascii?Q?K4MQ2PR5jqJ2kbsaEOroShh1ZJ5uSbAk74V+unLDSr0aBQ39DNRewoA966lP?= =?us-ascii?Q?koYbW+nUD1G0WdnyM2Jx15/P71wLAXRuF32904ldKjI/AmUCgX4A5gwtEXWr?= =?us-ascii?Q?lXYUxp1s/kvHnbBtiUYYIj8zG5eQs4Ed43eLaXbE265PEwCA43xV8hAT3oS/?= =?us-ascii?Q?BaDuE5rVvXCb1CbBHO5uO04QsaMW9TPJI41ZKL0W7spytxkAATNtfG4Cca1h?= =?us-ascii?Q?1+UjtWaXXRgiwxIYlbIpPiKFC9EkhygQb7NJ2Ic0BxvXzFvYjrC0m4LqEXzA?= =?us-ascii?Q?nfihrggwnhN5sRqHg358/o79pDcoCw8I5pCWqzECiiD5ELOFUFWH83XmVQCR?= =?us-ascii?Q?897tGjruuDvAcOyddiEcTMz2E62i1eIBmy9lHPihna0qsLWeP4PchGpBbjmg?= =?us-ascii?Q?SpwrTAWYIMVs6rqBMSZCFMNZmNH5+Ub4p64+r1DcQEri1ESE9lQ7hCrnrhJI?= =?us-ascii?Q?qOFqBNkzgC8btHGDqvh4iY9YWmuabC05MKIle1UP5byb8IW4Sw6Dxxq5vWxV?= =?us-ascii?Q?x1NJit8WQyeHWIJWk+POZDPO5P1+opXrf?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0068; 6:YAd/fqtiq76gj9rZPzET4o4ifCyJ665dlGlpnkR6cGDPv/IrSzd2Q/3TNwizr2bcEJg6ieHHK5h9QtEom8W71rcKRgvHp2M4r0HQrxXEOLRIb4EUx6zBkm59s5IC4zw96oTPKO2PfopFEieP0rMEIxIwN+9U5oyb2gKCKRvQhs9DpiLggjbU7HwMOHuPiDT5PbKqNVugh8nvX9hAAolpuUTHVcCcbcvKlrCGFgiOHWb9+DNq7y/G7q8QcnIidOGsDj9TmUYTGSsMg9VmM9gIBExvrUjdfPlBfQm9cX++VlQip4ERYy4pyg8pjYZFSHKwyDWbh1BP0mmap9B351zMFA==; 5:euAUbKH+JTNRG6igQc4YwEBx5GnC0U2BgSSETxnhpkadxmfdmkv2MglSC+wHwf9VPeMcBRVVjFHWJJRa3NtDYoT3Sw6DNDEkfjrItwk7MXkV30ht5C6+I9Wjx8Cm0aIIqMvt/efRA3mjrQKshvHHkON7Pwgmdl9s7NwqYxbRzBs=; 24:E7JUQIcj02Iji+mH3gsEEYnF9O2kxRfKjigflFTLGMHG+n1hUxKgKwnQ1YPrGVBoJOvn4f3x7+WX0ehwC3S4isfZtQLPoZXggdEwTlQFVQE=; 7:w+Ikg/2As4rI0/Zvkw4hv52s3kl464CWq+0AAIMeNye6E7Uwhqo7fgdesg+3ZwlA/oDJrtwPQv9k5zSOKE8WAHURrGuf+5rkhwmcZkMU6vBSWv6VOrc5+D3Hq0t1cNKxdwrxBYlCftvmoShFzCpR1YW/uZqSqqNCr+3skXmhFpGlFnfqf758QQJMYGxO68Qn3ZK9GP1JttwFp1Y/X8VvtNGu5dffnCE5mHP5JiDVXRs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR1201MB0068; 20:pD1ZuEH+QdcQk6FWfzdPXzceMFul54QPbTEp8gjqlxSB6/aNLeIflIRYaDAVAc9UKc+G8hCswszTWAg4g/Qg6IeYkqxWie0+HgCv+Cift0AwMAyFPg3THWu6Wq7GVRiJT3UavIBfUKSvvuiUyNs+JX31NSyqfZvaeFjKfgxIH0o35QPhvmEIAX1JDkuGTq/2UCbE2ywXr3nWhyCw0ZfExjtymoQqbYgcrKcDmMnuAiOaIeVsEkA4r9TTzAUESwqQ X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2017 11:26:55.0713 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR1201MB0068 Cc: Tom St Denis , dri-devel@lists.freedesktop.org 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 Signed-off-by: Tom St Denis Reviewed-by: Christian König --- drivers/gpu/drm/ttm/ttm_page_alloc.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ttm/ttm_page_alloc.c b/drivers/gpu/drm/ttm/ttm_page_alloc.c index b6f16e7ffff3..95022473704b 100644 --- a/drivers/gpu/drm/ttm/ttm_page_alloc.c +++ b/drivers/gpu/drm/ttm/ttm_page_alloc.c @@ -723,7 +723,9 @@ static void ttm_put_pages(struct page **pages, unsigned npages, int flags, enum ttm_caching_state cstate) { struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate); +#ifdef CONFIG_TRANSPARENT_HUGEPAGE struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate); +#endif unsigned long irq_flags; unsigned i; @@ -825,7 +827,9 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, enum ttm_caching_state cstate) { struct ttm_page_pool *pool = ttm_get_pool(flags, false, cstate); +#ifdef CONFIG_TRANSPARENT_HUGEPAGE struct ttm_page_pool *huge = ttm_get_pool(flags, true, cstate); +#endif struct list_head plist; struct page *p = NULL; unsigned count; @@ -834,7 +838,10 @@ static int ttm_get_pages(struct page **pages, unsigned npages, int flags, /* No pool for cached pages */ if (pool == NULL) { gfp_t gfp_flags = GFP_USER; - unsigned i, j; + unsigned i; +#ifdef CONFIG_TRANSPARENT_HUGEPAGE + unsigned j; +#endif /* set zero flag for page allocation if required */ if (flags & TTM_PAGE_FLAG_ZERO_ALLOC)