Message ID | 20180412100940.25039-3-david1.zhou@amd.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <dri-devel-bounces@lists.freedesktop.org> 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 4D0A060134 for <patchwork-dri-devel@patchwork.kernel.org>; Thu, 12 Apr 2018 10:10:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 38BF42875B for <patchwork-dri-devel@patchwork.kernel.org>; Thu, 12 Apr 2018 10:10:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D62728760; Thu, 12 Apr 2018 10:10:14 +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.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, 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 A50C02875C for <patchwork-dri-devel@patchwork.kernel.org>; Thu, 12 Apr 2018 10:10:13 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 5053E6E6D7; Thu, 12 Apr 2018 10:10:12 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-SN1-obe.outbound.protection.outlook.com (mail-sn1nam01on0073.outbound.protection.outlook.com [104.47.32.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 20C956E6A9; Thu, 12 Apr 2018 10:10:11 +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=8HBJlxzeAWsvznb+fc+J48Ok1o4NipPPSYKS5uIsc/w=; b=I/PME7XWzUvC69WUdV+R2916CRG5B88r23+qBQBxVrbksUYgItt7+ADQbXCmin/Rq/KkEVGjE8D+NA3wgfq4ekFxPvAPvk/VUBK9dTc4p8xIhpPLDGZ60BWSrm9vgZm+d/YnuIUmJw83nPT0qQwAdM2F8/qEn7mB6biUgdt3l1Y= Received: from DM3PR12CA0057.namprd12.prod.outlook.com (2603:10b6:0:56::25) by SN1PR12MB0765.namprd12.prod.outlook.com (2a01:111:e400:c45b::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.675.11; Thu, 12 Apr 2018 10:10:09 +0000 Received: from DM3NAM03FT016.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::200) by DM3PR12CA0057.outlook.office365.com (2603:10b6:0:56::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.675.10 via Frontend Transport; Thu, 12 Apr 2018 10:10:09 +0000 Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none;lists.freedesktop.org; dmarc=permerror action=none header.from=amd.com; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV02.amd.com (165.204.84.17) by DM3NAM03FT016.mail.protection.outlook.com (10.152.82.198) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.653.8 via Frontend Transport; Thu, 12 Apr 2018 10:10:08 +0000 Received: from zhoucm1.amd.com (10.34.1.3) by SATLEXCHOV02.amd.com (10.181.40.72) with Microsoft SMTP Server id 14.3.382.0; Thu, 12 Apr 2018 05:10:08 -0500 From: Chunming Zhou <david1.zhou@amd.com> To: <amd-gfx@lists.freedesktop.org>, <dri-devel@lists.freedesktop.org> Subject: [PATCH 02/11] drm/amdgpu: use ttm process in amdgpu vm Date: Thu, 12 Apr 2018 18:09:31 +0800 Message-ID: <20180412100940.25039-3-david1.zhou@amd.com> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20180412100940.25039-1-david1.zhou@amd.com> References: <20180412100940.25039-1-david1.zhou@amd.com> 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)(979002)(376002)(396003)(39860400002)(346002)(39380400002)(2980300002)(428003)(189003)(199004)(36756003)(8676002)(6666003)(97736004)(59450400001)(77096007)(26005)(51416003)(7696005)(76176011)(104016004)(186003)(53416004)(478600001)(72206003)(356003)(105586002)(53936002)(450100002)(2906002)(5660300001)(50226002)(106466001)(4326008)(81156014)(47776003)(81166006)(8936002)(1076002)(48376002)(305945005)(50466002)(54906003)(110136005)(16586007)(68736007)(2616005)(426003)(11346002)(86362001)(446003)(316002)(486006)(476003)(126002)(336012)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB0765; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT016; 1:VvwHuOIn1Vy6TKwlm+qipLxCVrGUNcfqjkIRJJqy1MD2bpMPgAmSKI8ND7eeClb0tGTBHmi2GMc84wsD6CAK5Gh06nyd9TNuP19U/IezEefiSBhZ5+G9TTt6pRFi/ZDG X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:SN1PR12MB0765; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0765; 3:ex5UsrN/uO4aXiQRVH32OlUF2zMiz1674TMDX4aLoVau7wEX+8SqttiM2ZnxwZ8bvjlLung+jaxfvWSNYTb9XnNG8QhI9vseID/8hprSFTdcYU6zJ3+Yr1WSDJxZFvFkkCHQsUfsn4arARoXMpf2FFz4seEjS+ZKXx15RmKJIgP/pk4Chsu4JacR3ck8cKVln7KtQYrGGr2sqINc/ehI5MC7AZjWlVxaDg5rkOaupjdu5d7BasJQ7OzYaSoIMA1q5jZ+tfDH98abvIbHKb/bWcG3JT1uju/C+VFMMEt0LUUS3+pvekMy78ZjPQCS1yRKYxmYqWQEyaGlfFupngSRsDSbPwa4+LOFOaqp4gtOtLM=; 25:UsNJcR51BYkDWD2RrHETgeFSnEwmxr97AyJmmGYBTl1bUWRYQRFDar9x/KLTwAiGdS8QQMKG8WZ2HZeXrqESBZ484P6EqHhfbvC8VHRlDrg0hFh1YZgleXkI2YLmCk5UktnOHkU2/wEwscDaMOJBM1EphY69UgjfvNOsofidLeivKkvI96wcx20YnRB4Bi9oPUw7Gt91ipKmQWk/5VSi+OPY6NU0AlOGgvVpEfG1PRHsZDRb2T3V6zD1FJ3vGwBlVf1Y2ZnnMRc2uPGgyKR9nO4B3+gCmjoRIapAS2ZnvVOl6fTkgUBNJt5/MRyYfAJ2fNQwOMwqBDKeGncv9ejvYH0Qyf9+z02JDFeABosPCks= X-MS-TrafficTypeDiagnostic: SN1PR12MB0765: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0765; 31:IjcYf/ndhtTDUzL6I5Xr5GesioGwLY3GyKQba1pUYCvN7Uh1q+d0gEhqFBXL12t0CESMH+UlF9bcnqlSqXllb+PKkFyA9qfz1Rn5u7wtLFGyw4nJHmWn33jeA11C5qGEb2Ive/UNYGyNN/vUD7c+PrqzB8uo/vXbAjj+C7ImGoOKbe3QPRJJrZ0QrmNoZ4JwFinlPxUoLl8NK7VfyK8GVCFtfHYS22jHwa0JNVgguas=; 20:q7GlXtmw8IGpY+LH+K00a3Na3s2OD6D/bDpXsA//ttI3IAN5psHFA6V1ZgClPTXJaoZicHtUZCL4JLUUkjvIl3lDnrsHCCa+0nSySh+61pr7I/BnCaI3ot+545C1pDzJLoRnMZLTmnkpd/NNiB/ewXArYIhl3zLuuRgf/PUula/8GmFi5Zfmoxa0GB+3qHUuSqUpWW6rxofJef99Yo6Kxl7G1i8SFw09VLE+dolJDHYGeFs+LpMs/i5BFyXycy/cdbm5AxifBuiQmWG5sdKlg/tloVsCixNB//SI0RGzUgOAnOkfrgOuNC+AstInjQ1CndLj82pub3/4YD+77FwigbbinvAPqTF/09lEk7BN07VlU1szMkf8NYJ4PHUHZtyFwiWR9xQKbU+vLg/3x60W3SnqjgsSLDyKPuSXtd3Lurvusi4prKurBP8fNtg/jd43FVVCDN5F5kUOCjn7j/NpRKadSQOWlXbFX88L0yOC80k5BHX6mMgo8Yug3ZPC/oD5 X-Microsoft-Antispam-PRVS: <SN1PR12MB0765B1979B3C19A5524D9636B4BC0@SN1PR12MB0765.namprd12.prod.outlook.com> X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93003095)(3231221)(944501327)(52105095)(10201501046)(3002001)(6055026)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123562045)(6072148)(201708071742011); SRVR:SN1PR12MB0765; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB0765; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB0765; 4:8ZKO7iQ7IuitdU6YdcegVcFU4iLdalr8c1YXO2Qo0ABqjH2abq51cUnR3REOLuigl4GhsyT98G3mMD0mrMYh1oFzthhgdKw/0Nd8WkRoerO6UsfOJhO4nlTY5OncK4n0yejO6u1O5PrkWPI2gdeoha6UnbV/T3C732GtI45d2ZhkQnNtibttdFEI7riOAUopcHPOsM1alSI0S+3TFx/WXvCmZQ3aAfAOGsohrqHr6y7sY6JWgLQSV3QQldoM/OTuJlA0YdtDT+iK+Z07QjPlytPTxPd30+YcjxYWqVlVQfoteWuYljP1thJR9n3T04+9 X-Forefront-PRVS: 06400060E1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR12MB0765; 23:2JaPyHHVT4jqDuuep21qLv5CNv7Cs6+qNHvf9FhT9?= =?us-ascii?Q?YKhbEz7DE86kCnHrIugmlBOufQZCTZ8BhZR4h21AjFBBmLbN/NtGI17hyDnJ?= =?us-ascii?Q?Qlle19dAjkB0S9E33vGGG8tUoJ0kVrgSrrpHiVwjLMUhSDd+OuGcowM23Fkx?= =?us-ascii?Q?fu1yMse2G0vc8ja18AgDmvf3WJL31QA1ygJn/YFGy6u0aPEoqBiKNw1W91mB?= =?us-ascii?Q?/8l+lsOf5MqsMxznbwjS5POscPdXzmmK8EcP+t9A7cPALgTl1a6T2D8iys1z?= =?us-ascii?Q?6tEftU2vN2cAxTxTLYMX56ljlq4y0MtoueHxuUKvbzkcVuydlMgVJX6fGwyl?= =?us-ascii?Q?+UWt3LZ10aB0ynyjzBFjI7+H2my9qdq8fabjf12zmXlTI++OFihD7q/UE9bp?= =?us-ascii?Q?xzhnz+DM/Zn1F+GAj/fdziDdzOKBaQWrEmhHFXX2o5ShEGt31rqpb+4P6+F+?= =?us-ascii?Q?/00Fb9scUng9UwXtYQfQMa8s9oyDorUoKJtUF75H1Afp0u52bPgRiMbw97IG?= =?us-ascii?Q?MeLWsfPkP+wNEWHgbuKAMKpdCwjrPGdJ3txMQ2ewA0eUh049kiC88Sv+ujhj?= =?us-ascii?Q?alK+Yw5eA/foIrmg7xXSG9FSxFWFDHy3V3V+U3pgeJFVzRVSo+vXkiKsH7ry?= =?us-ascii?Q?2ElrLAo8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h8OI8cj8+2LMmN7Y5r0qhpnA1R3jL/XduGPi8HVMQMvxgCTm; 20:ijL/PEXxldq/whv3tyMoaq8WllwFO04AUKZNT7l50efe4wUxBOm0DHTfE7nbVcstZEhZYmra0QN3PyKpdIBbi5HuAZNomq6HV5A35kpHrCk0XWcs/3etRo2u5k2PpFe97fF8t6kZdVBESHptApeDVZbplIlbPvlPswtl56vD0BhsRMBFlX2UsqwyMx/grvWHDk1Y5MJ2n13Ygxp05ntFQT3jX/vTGs/Gg1hsaFjm+u1ZtgHYbhaLS6TYNoMZOGab X-MS-Office365-Filtering-Correlation-Id: 1e94dfa2-32b3-4575-8a0c-08d5a05d921e X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Apr 2018 10:10:08.5577 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1e94dfa2-32b3-4575-8a0c-08d5a05d921e 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: SN1PR12MB0765 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development <dri-devel.lists.freedesktop.org> List-Unsubscribe: <https://lists.freedesktop.org/mailman/options/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=unsubscribe> List-Archive: <https://lists.freedesktop.org/archives/dri-devel> List-Post: <mailto:dri-devel@lists.freedesktop.org> List-Help: <mailto:dri-devel-request@lists.freedesktop.org?subject=help> List-Subscribe: <https://lists.freedesktop.org/mailman/listinfo/dri-devel>, <mailto:dri-devel-request@lists.freedesktop.org?subject=subscribe> Cc: Kai.Guo@amd.com, christian.koenig@amd.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" <dri-devel-bounces@lists.freedesktop.org> X-Virus-Scanned: ClamAV using ClamSMTP |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index da55a78d7380..6ef449ea8d07 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2429,6 +2429,8 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, list_add_tail(&vm->root.base.vm_status, &vm->evicted); amdgpu_bo_unreserve(vm->root.base.bo); + ttm_process_init(&vm->ttm_vm, &adev->mman.bdev, + vm->root.base.bo->tbo.resv); if (pasid) { unsigned long flags; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h index 30f080364c97..61b89642fa3d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h @@ -29,6 +29,7 @@ #include <linux/rbtree.h> #include <drm/gpu_scheduler.h> #include <drm/drm_file.h> +#include <drm/ttm/ttm_bo_driver.h> #include "amdgpu_sync.h" #include "amdgpu_ring.h" @@ -166,6 +167,7 @@ struct amdgpu_vm_pt { struct amdgpu_vm { /* tree of virtual addresses mapped */ struct rb_root_cached va; + struct ttm_process ttm_vm; /* protecting invalidated */ spinlock_t status_lock;
Change-Id: I2cf802e641d8b2cdb2bf8bdf1957f3f4f27afaba Signed-off-by: Chunming Zhou <david1.zhou@amd.com> --- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_vm.h | 2 ++ 2 files changed, 4 insertions(+)