From patchwork Mon Aug 13 09:58:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 10563965 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 1A18F1390 for ; Mon, 13 Aug 2018 09:59:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 062CB28E22 for ; Mon, 13 Aug 2018 09:59:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EE2AF28E50; Mon, 13 Aug 2018 09:59:36 +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=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 F046B28E22 for ; Mon, 13 Aug 2018 09:59:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7E3C289CF8; Mon, 13 Aug 2018 09:59:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690051.outbound.protection.outlook.com [40.107.69.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id 21F0C89CE2; Mon, 13 Aug 2018 09:59:33 +0000 (UTC) Received: from DM3PR12CA0072.namprd12.prod.outlook.com (2603:10b6:0:57::16) by BY2PR12MB0242.namprd12.prod.outlook.com (2a01:111:e400:585d::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.15; Mon, 13 Aug 2018 09:59:30 +0000 Received: from CO1NAM03FT052.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::203) by DM3PR12CA0072.outlook.office365.com (2603:10b6:0:57::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1038.21 via Frontend Transport; Mon, 13 Aug 2018 09:59:30 +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 CO1NAM03FT052.mail.protection.outlook.com (10.152.81.213) 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; Mon, 13 Aug 2018 09:59:29 +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; Mon, 13 Aug 2018 04:59:28 -0500 From: Huang Rui To: , Subject: [PATCH v3 1/5] drm/ttm: add helper structures for bulk moves on lru list Date: Mon, 13 Aug 2018 17:58:47 +0800 Message-ID: <1534154331-11810-2-git-send-email-ray.huang@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1534154331-11810-1-git-send-email-ray.huang@amd.com> References: <1534154331-11810-1-git-send-email-ray.huang@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)(136003)(39860400002)(346002)(376002)(396003)(2980300002)(428003)(199004)(189003)(53936002)(11346002)(50226002)(53416004)(4326008)(5820100001)(450100002)(72206003)(336012)(186003)(97736004)(426003)(77096007)(486006)(446003)(68736007)(86362001)(478600001)(81166006)(81156014)(8936002)(2906002)(8676002)(7696005)(23676004)(6666003)(104016004)(2870700001)(126002)(476003)(26005)(2616005)(50466002)(76176011)(36756003)(305945005)(316002)(106466001)(47776003)(105586002)(110136005)(54906003)(356003)(5660300001); DIR:OUT; SFP:1101; SCL:1; SRVR:BY2PR12MB0242; H:SATLEXCHOV02.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT052; 1:5GI1L4zddtklNwgC3joWWqfUYpMaMwnoi9iM8wDHeGBmqN6109kfywBohEjO9jbbC9G9BwZ2r9DSpvqaBHGmBTGVktVI2Zz0QzzKwyDy1PGHLeXXuJhVdrH0y2tu2oTi X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0b8202dc-dacc-4eaf-75d8-08d601037661 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:BY2PR12MB0242; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0242; 3:RVCM9E6/BeaP9nbHY0a4EIZZi+IoKKUG2A2fruSElG//YPgN/xaAOCaOB4y6OQI1r5pXo8fBwRA8gTPAcoKbM5BSkG5Gkqo8EIWjfaQiQKv0A4YJ/18O0MoN0unFZvBkaenuZJmZYcbmqZ5eP+tvOSuP5KeL14SSWXKKvQHyOaq5A2vo/qlTQUU0qj8QgUUeqplss2EsqKxIz3mD/MPpzH9WJZONrSDEOtygU7NQtzQuTZ0fBl+1GUxM6dmEUq23+siPrnOa0qyPioP5iP8kihtgI2KvZVctxLQMnByIEFWWs6hA86kvn8ZphIhd2uofXTZz6ba6VvwykIYsY3AsgVJ6z6oXJ9aSlXX3YX6KHEs=; 25:Gi2tD6/DxMk1UE3qRJmFCiXa8Whn+DTXXBFKABNPyxC040OKzfyf4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wm3kfDVlWwIbMjzauTi0A9+qsCakcWvORf 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)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:BY2PR12MB0242; BCL:0; PCL:0; RULEID:; SRVR:BY2PR12MB0242; X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0242; 4:z1nSs/t3Zl9HDADmB6/fxFfBtIKK6T2SPSKwAuf1AWesciFylyzgu0J4pWGEGRQLSMuCmMUmwB9Z5Twq0DSztDolLL1wDIQyINz7jr1aaZ2YUA4bi+8x4+W0XtY0XrfkTvOCjn/x2IirZ/lW7+zeh45mPZmpA+nFYY8D7jsW4mA5CZnVfpFmQEtTO5u29wHKfubJ7sgZFEGlMm/pg5qu6Rwg9ZbmSiPy6RciPJzw/Qj7zN2KQaX4hOrgfWEH1EVvROdi60ALEucRdzjLQhF5ysugYoG2Y1yr0Dx37u/WrCqO2o4PoTavs1mVZ5cOd1ZS X-Forefront-PRVS: 07630F72AD X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BBY2PR12MB0242=3B23=3AKCQ16aR?= =?utf-8?q?ay6yYrWYQXwu4IazFdd8wifnF8cmwuC1aU2Mdi/ncpubOo7Foa4SsSoKXQrOvuNuH?= =?utf-8?q?6IVqY4G2E9PBjAjsT+r6iFiPvbB77WWT/8Iz98qS1vJ6EnM0+w0q2XbY94cBHOoV7?= =?utf-8?q?xdbbc4VAesc4qhfB3bwLkOgrcmp/si10a0jkHJsgIbLaesaCItVCfLmArH0sDZH15?= =?utf-8?q?N2Cw3ZjNT/zEvyA1g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6SI/zUMIEmtF39jUKEn4R5g0fvggeZmsLPQ4lLCCVB7pz9KeoFSd9d4PAYfFA=; 7:HcPKWLEHm4zAUtyEBPP+W8zRkMfMVOdEfavUokvwxW2qyS6xH3vPI7xI4fWZG7cp0kG8sqdV6kx98biOIQhGrRqy9FafVd/ykU+E0fW5w2AKsZYSkmNEZWrwrtw5uVUu1GtG0FjHqlVhFQI/BIkSQ0zZuM+kMJWIVT13kBQKcu+0CCr+rRTtwhOPx9/YTycB30to+Jw4y1nA+urrGYnglLQ1c546L6jzYRsRckegUU/YmWkukv2LaJimGItJ5A9M SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BY2PR12MB0242; 20:zuTKKCI9yEdpYyHVmhoSqH9vdreJyBVjuN9D5MIEpKh2cMf4IcaC0Z9gzRAUUgAsZZd2PJWCdcdDR5gwSD7XCWpY/WK1e97M2ng99mZ4/HgcjQMYi8vbpDOvqeMGVGL0dCs+hZUnsLnjYuAzjuYSSnz2AY7h+H4IAj04r2Pp+HwNxwGnB8Rmgaj4ZEPEroG5keCZ4nSRSEP+Ony1AJeiV2o3ZfqrcDSWgVmXbETkYouOCwLIiInIdhcvyRmrtKOf X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2018 09:59:29.9931 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b8202dc-dacc-4eaf-75d8-08d601037661 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: BY2PR12MB0242 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 , =?utf-8?q?Christian_K=C3=B6nig?= Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Christian König Add bulk move pos to store the pointer of first and last buffer object. The list in between will be bulk moved on lru list. Signed-off-by: Christian König Signed-off-by: Huang Rui Tested-by: Mike Lothian Acked-by: Chunming Zhou Reviewed-by: Junwei Zhang --- include/drm/ttm/ttm_bo_driver.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index 3234cc3..e4fee8e 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -491,6 +491,34 @@ struct ttm_bo_device { }; /** + * struct ttm_lru_bulk_move_pos + * + * @first: first BO in the bulk move range + * @last: last BO in the bulk move range + * + * Positions for a lru bulk move. + */ +struct ttm_lru_bulk_move_pos { + struct ttm_buffer_object *first; + struct ttm_buffer_object *last; +}; + +/** + * struct ttm_lru_bulk_move + * + * @tt: first/last lru entry for BOs in the TT domain + * @vram: first/last lru entry for BOs in the VRAM domain + * @swap: first/last lru entry for BOs on the swap list + * + * Helper structure for bulk moves on the LRU list. + */ +struct ttm_lru_bulk_move { + struct ttm_lru_bulk_move_pos tt[TTM_MAX_BO_PRIORITY]; + struct ttm_lru_bulk_move_pos vram[TTM_MAX_BO_PRIORITY]; + struct ttm_lru_bulk_move_pos swap[TTM_MAX_BO_PRIORITY]; +}; + +/** * ttm_flag_masked * * @old: Pointer to the result and original value.