From patchwork Tue Dec 12 09:33:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10106557 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 2BEEF602B3 for ; Tue, 12 Dec 2017 09:34:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2531029B66 for ; Tue, 12 Dec 2017 09:34:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1A09129B69; Tue, 12 Dec 2017 09:34:01 +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=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, 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 C3CE029B67 for ; Tue, 12 Dec 2017 09:34:00 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A01C589FCA; Tue, 12 Dec 2017 09:33:59 +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-sn1nam01on0052.outbound.protection.outlook.com [104.47.32.52]) by gabe.freedesktop.org (Postfix) with ESMTPS id A80BF89FCA; Tue, 12 Dec 2017 09:33:58 +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=8vx1wHEIIA4hQZvs8Ahene+iegoTXAZ/AmFqIgILmN8=; b=UquTrSYv6LVse1tH95NDxHema8wbgNTKk6Ts/1zavVl9+LL27kYY5BST3FNejJbLXhzjfOWiIj44dHcmrBqRVqeXDIMrB4XOhCfDeGZpBC2QojAyvzxnO5BbAuJzcRQ9c9Vau3/DUGX6mdU+d1FN58IqEE3wdubcZvEW2n06x84= Received: from MWHPR12CA0066.namprd12.prod.outlook.com (10.175.47.156) by CY4PR1201MB0056.namprd12.prod.outlook.com (10.172.77.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Tue, 12 Dec 2017 09:33:56 +0000 Received: from DM3NAM03FT045.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::203) by MWHPR12CA0066.outlook.office365.com (2603:10b6:300:103::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Tue, 12 Dec 2017 09:33:56 +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 SATLEXCHOV01.amd.com (165.204.84.17) by DM3NAM03FT045.mail.protection.outlook.com (10.152.82.208) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.302.6 via Frontend Transport; Tue, 12 Dec 2017 09:33:56 +0000 Received: from roger-build-server.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.361.1; Tue, 12 Dec 2017 03:33:55 -0600 From: Roger He To: , Subject: [PATCH 2/6] drm/ttm: when create a new ttm bo init on_alloc_stage and resv for ttm_operation_ctx Date: Tue, 12 Dec 2017 17:33:44 +0800 Message-ID: <1513071228-29551-2-git-send-email-Hongbo.He@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1513071228-29551-1-git-send-email-Hongbo.He@amd.com> References: <1513071228-29551-1-git-send-email-Hongbo.He@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)(7966004)(376002)(346002)(39860400002)(2980300002)(428003)(189003)(199004)(104016004)(8676002)(50226002)(16586007)(53416004)(2906002)(2950100002)(50466002)(110136005)(68736007)(47776003)(5660300001)(53936002)(7696005)(59450400001)(575784001)(86362001)(316002)(8936002)(48376002)(6666003)(36756003)(76176011)(51416003)(356003)(72206003)(97736004)(305945005)(508600001)(106466001)(450100002)(81166006)(77096006)(81156014)(4326008)(105586002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0056; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT045; 1:dS6gWd1HIJRuZgJSBHCMt1LOHMxtTtQ4hPGbbGQ9aXzdLOiAWkTe9aF80MMX32K7CrG8FB19uWRpDCkftP4yQeq9zoRlIXNnr1hTbfCkDP+xGuAwE84NV7zjs/8M/D2i X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 5aaee5f6-878d-4901-36fc-08d541437757 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:CY4PR1201MB0056; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0056; 3:EOTvh++oUHU7vWET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85/5/dAfwSZWaHeG+pxGp/I2pA4BjHfDRwwGdTF8Lcqouq/i+UTj9JuJnFY8WzZ4fnqQhV1u2g8n3J3Edyl3T/8OKER03DHCrCUsnsj4rA5JooVHk5pnn2CVdGSeCsan9m1W4kisL7cr6FRbOh0BDDOSaZrPbMngTDoHXqkQjGntombqFXgEeNrFYv5uuCw93craDYM5gU1tIvmFQlxWB2dG9AVayjK7omMx6lPORyx/YnIK+Ti9Z+4mNWVBFwoYt38p3uL2KKo64m3acbtGhFWgdXyLwmxwhNZTnz5sZGFgHljX7DDa/WWM2qz24r6SAwBtOQRW9HHLD/aEtzrteKEYzE5BkB2rxPbrHR5BG0KbWDG/KI19DS1RU/2qGRSRH4D+9bXfYluFDoz/hKpO6Ae1ptCC6jFV/EfF/M7kvExGgsPYwV40+RfrMVk6xlVo3c7x7 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(8121501046)(5005006)(93006095)(93003095)(3002001)(3231023)(10201501046)(6055026)(6041248)(20161123558100)(20161123560025)(201703131423075)(201703011903075)(201702281528075)(201703061421075)(20161123562025)(20161123555025)(20161123564025)(6072148)(201708071742011); SRVR:CY4PR1201MB0056; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:CY4PR1201MB0056; X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0056; 4:1NhiCj6WrnYTUsZsgulRwylRI6krg9i4XWcBYwBD1/Ht1lvsPtn1/MPxzpGsjIUZ2kcRj1HygoHyZeFxnL73CrpGNvSFNcQcyitMiY9cRx6JHPUGH93m8CL+kcaZERBZ3BPNbARiqSKIgatg9JCMXSpOubYLMw4gtL8Hl9DfCrGY5nb/TQxQjeBu6sjc73GXDMIIiictu8kYKxUF1Al62N+6pJShbvezoPjNxdWBiVaI3iqZSg5njHXdh02bvVemG1r6BMW1k9MxL+1dwF8IvnramJ376OWjn59JZ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vE2dbQeGrwDJw2/rny6r/8Sz/jMIk/Hkb76lfzd/Rnzd02sYHb8p6qTKeLdvUcah7uTMBg4cGLg+GT2ixN7xC+upC0QUlq9V1GoErZ5hxVe12cnTE97yf4eLDjHmG5AJR4RJI6/cl/DN2Em74vA8ohBKUNN5BLcaev2J7Woe/+MN3kb5mFvibASvuJYBm6Ipq/6HpDO8L0FZ+YCZH2ZKz SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR1201MB0056; 20:Le0CYH9B0hVRTyLz1as86i4MZP4yKE/17nyd1eATKEttf1ZZEcJuN1WZfTbqaCjtLfk4MyGSzmULDL6kTgedMLLfl0+b4BS1/qTydXQ7HGxyd7YCxaysxtkIvHXMOWHuADIhh/wdJJEmlC4INXfdWOsROKN5AOrxYVaL8h0p7kGfId1R93ncPerTI2H4hkcMby/XDe8+vq7IAPRZfTMOiPwEHeRruiGbNfay8v0hHZK/JZ5OgboaIlFZuU+frJwG X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2017 09:33:56.2361 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5aaee5f6-878d-4901-36fc-08d541437757 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=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0056 Cc: Roger He 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 Change-Id: I0c6571c2a64e6c5bdad80ccbcccb40eba1c20b4e Signed-off-by: Roger He --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 2 +- drivers/gpu/drm/ttm/ttm_bo.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index dc0a8be..eb42782 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -327,7 +327,7 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev, uint64_t init_value, struct amdgpu_bo **bo_ptr) { - struct ttm_operation_ctx ctx = { !kernel, false }; + struct ttm_operation_ctx ctx = { !kernel, false, true }; struct amdgpu_bo *bo; enum ttm_bo_type type; unsigned long page_align; diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 97c3da6..70b2673 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -1208,6 +1208,7 @@ int ttm_bo_init_reserved(struct ttm_bo_device *bdev, WARN_ON(!locked); } + ctx->resv = resv; if (likely(!ret)) ret = ttm_bo_validate(bo, placement, ctx);