From patchwork Wed Dec 13 05:17:56 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 10109213 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 B2660602C2 for ; Wed, 13 Dec 2017 05:18:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 912FB28B14 for ; Wed, 13 Dec 2017 05:18:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 85CB828CE7; Wed, 13 Dec 2017 05:18:11 +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 1865228B14 for ; Wed, 13 Dec 2017 05:18:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4282289C1A; Wed, 13 Dec 2017 05:18:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0054.outbound.protection.outlook.com [104.47.40.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 5B1B889BC2; Wed, 13 Dec 2017 05:18:06 +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=UWbhMmwh24hfU4DarNXX0TRF28Nkrr7LbP3FMdrgu98=; b=SS80y909leA/x4IKa5JfC2F2f6eJnVVTTXKhlsm444HaeBrryJ66UUI8CH6z2gVQSJLjBaFTdS4npve2xRnJe5q3uy/XDv+NPrON+SZjf0W95obGpSwbR+Pub0MD9yXk//r6LxiNPIf+Zj/vjD+snLlMCgIIl6ZcGHjY4oQZ0VE= Received: from DM3PR12CA0095.namprd12.prod.outlook.com (10.161.150.143) by DM5PR12MB1276.namprd12.prod.outlook.com (10.168.237.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.302.9; Wed, 13 Dec 2017 05:18:05 +0000 Received: from CO1NAM03FT060.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::202) by DM3PR12CA0095.outlook.office365.com (2603:10b6:0:55::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.302.9 via Frontend Transport; Wed, 13 Dec 2017 05:18:04 +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 CO1NAM03FT060.mail.protection.outlook.com (10.152.81.16) 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; Wed, 13 Dec 2017 05:18:04 +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 23:18:03 -0600 From: Roger He To: , Subject: [PATCH 1/3] drm/ttm: add allow_reserved_eviction and resv into ttm_operation_ctx Date: Wed, 13 Dec 2017 13:17:56 +0800 Message-ID: <1513142278-4294-1-git-send-email-Hongbo.He@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)(39860400002)(376002)(346002)(2980300002)(428003)(199004)(189003)(68736007)(6666003)(50226002)(50466002)(8676002)(97736004)(81156014)(478600001)(48376002)(72206003)(104016004)(4326008)(450100002)(7696005)(2906002)(86362001)(105586002)(106466001)(47776003)(81166006)(8936002)(53416004)(51416003)(36756003)(305945005)(316002)(5660300001)(54906003)(16586007)(110136005)(53936002)(77096006)(356003); DIR:OUT; SFP:1101; SCL:1; SRVR:DM5PR12MB1276; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT060; 1:y2F1szSP+FQycA8HNgckbtaLAGZR/9vbdvcoIxzHV/H7JuxsH3aVbobZXeTOj0HRFtCI43y1YNW84mAz5FlY3gICgeBM/SUIzwHNGAHBKEnNrm/S3ldaFb1o0jBYbMqA X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4771c51c-5140-4cc6-62f6-08d541e8e356 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307); SRVR:DM5PR12MB1276; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1276; 3:Kq1lkXP3VuEwLNwNZ+2e6Tnvn2DI3A0PLQVTIKzmXsU4x7fBIK7fTstzVhBlPxZdFkDeqE7VvffCBvSDscnkqciBGzEcsR6RHPxAyYorn8hongfmzBYMhKTR8OQB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GGOSqT98WyD5VQmxyzwM1uI/Lhp/HPNFJP0yzU7l2Mb5MtIzc5lAiJ42OJVglrNjTZ6IbWT0DZUS0LurdtBBlDmcQohoAN1/Efuztq545Ic8d0ojaBLYcYj5/uS0iObJgP1VaWfkXAe80CugAgA4g7kgshVhsExNXQMxOsJn7Z5IqddsDDfEr7QTvSJJzxualiriyMQs9cC7K1iBFhSpl2rTTT0W9g5vdV+mn8tn71WYE8OR4wYx1spPz0xeL/iaJwx5sFX2xajQbZ39+AjjnOlVdwIuK2y4AyZQyiHyMfR2K/xsweclBAtKSNckps+xlpqMvZKuo3XwgBOVtCi4urACmjDGQITS X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040450)(2401047)(5005006)(8121501046)(93006095)(93003095)(3231023)(10201501046)(3002001)(6055026)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123562025)(20161123558100)(20161123555025)(6072148)(201708071742011); SRVR:DM5PR12MB1276; BCL:0; PCL:0; RULEID:(100000803101)(100110400095); SRVR:DM5PR12MB1276; X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1276; 4:rnMeGh0/1ogSO4sFclSJ0ru12c3x7yo5j7pXcdtdfrt2raaXADd/Td71TjpmFCxRSljOUZaMV2gJJ/WqdJyQ9FfVeFZWLRAz5ifR5BqriOt+lrEFu5i0KhzaNjIHF11kdp801Z++/lclQy6xazKyKPJKkl6gh/Tmeo8I6U/AfkIgrvGMpqkOr3kgohaR0d40n1kUNYsAshylssQDGRBte2R3nhs1XyMIA0n1YCE1RT/qqgfl8M38pdPIQ+wRHWuojQegMrgjvZjpwnCjimfQbXqjvOoTWNSGxElIxg+HQzLwarZiGJKwHaWptr9Di6NQ X-Forefront-PRVS: 052017CAF1 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM5PR12MB1276; 23:E3F1kk8rp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kL6V SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM5PR12MB1276; 20:7OC/9xVqHNyGSYi0jlxMpYm7BBEQm5QXCHsTTy06fK0SKzh5+n1DO3WLk90ZSGaXOiKHr7ptO0HezRVeTlyRD9egOEMaFDFodm4Kka2nHkT6/eNEZ/oXFx5V+vMbxoOedqTRAobd+IYg0OxgkSO6OCvzrgluRPiuri1UzJDtCRzkcL/MdrV35R4iq9qbeBBGUKBGzDk9JA2HQ442EZEqGsZiYmTfJqfdFsb/r4/56CpWpxk/A7H0ra0crCpFthB4 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Dec 2017 05:18:04.3225 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4771c51c-5140-4cc6-62f6-08d541e8e356 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: DM5PR12MB1276 Cc: Roger He , Christian.Koenig@amd.com 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 allow_reserved_eviction: Allow eviction of reserved BOs resv: Reservation object to allow reserved evictions with Change-Id: I01ea482e8c7470014196eb218e2ff8913306eef0 Signed-off-by: Roger He Reviewed-by: Christian König --- include/drm/ttm/ttm_bo_api.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 368eb02..c126330 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h @@ -263,6 +263,8 @@ struct ttm_bo_kmap_obj { * * @interruptible: Sleep interruptible if sleeping. * @no_wait_gpu: Return immediately if the GPU is busy. + * @allow_reserved_eviction: Allow eviction of reserved BOs. + * @resv: Reservation object to allow reserved evictions with. * * Context for TTM operations like changing buffer placement or general memory * allocation. @@ -270,6 +272,8 @@ struct ttm_bo_kmap_obj { struct ttm_operation_ctx { bool interruptible; bool no_wait_gpu; + bool allow_reserved_eviction; + struct reservation_object *resv; uint64_t bytes_moved; };