From patchwork Wed Aug 8 09:59:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 10559711 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 4788413B4 for ; Wed, 8 Aug 2018 10:00:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2F2352A903 for ; Wed, 8 Aug 2018 10:00:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2294D2A95A; Wed, 8 Aug 2018 10:00:02 +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 AA6632A903 for ; Wed, 8 Aug 2018 10:00:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7F1B16E50A; Wed, 8 Aug 2018 09:59:59 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM05-DM3-obe.outbound.protection.outlook.com (mail-dm3nam05on0602.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe51::602]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8E3116E50A; Wed, 8 Aug 2018 09:59:58 +0000 (UTC) Received: from BN6PR12CA0033.namprd12.prod.outlook.com (2603:10b6:405:70::19) by CY1PR12MB0245.namprd12.prod.outlook.com (2a01:111:e400:50f9::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1017.18; Wed, 8 Aug 2018 09:59:55 +0000 Received: from CO1NAM03FT054.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::208) by BN6PR12CA0033.outlook.office365.com (2603:10b6:405:70::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1038.19 via Frontend Transport; Wed, 8 Aug 2018 09:59:55 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT054.mail.protection.outlook.com (10.152.81.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.20.1038.3 via Frontend Transport; Wed, 8 Aug 2018 09:59:54 +0000 Received: from hr-intel.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Wed, 8 Aug 2018 04:59:53 -0500 From: Huang Rui To: , Subject: [PATCH 1/5] drm/ttm: add helper structures for bulk moves on lru list Date: Wed, 8 Aug 2018 17:59:33 +0800 Message-ID: <1533722377-27020-2-git-send-email-ray.huang@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533722377-27020-1-git-send-email-ray.huang@amd.com> References: <1533722377-27020-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)(376002)(136003)(39860400002)(346002)(396003)(2980300002)(428003)(199004)(189003)(36756003)(5820100001)(23676004)(7696005)(77096007)(76176011)(72206003)(2870700001)(68736007)(478600001)(476003)(11346002)(26005)(2906002)(86362001)(2616005)(426003)(305945005)(336012)(186003)(446003)(53936002)(97736004)(50466002)(126002)(486006)(50226002)(81166006)(8676002)(54906003)(356003)(104016004)(8936002)(105586002)(53416004)(6666003)(5660300001)(47776003)(106466001)(4326008)(316002)(81156014)(450100002)(110136005); DIR:OUT; SFP:1101; SCL:1; SRVR:CY1PR12MB0245; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; CO1NAM03FT054; 1:uPVpINNrPVLiTh1JWCKjuYLlh3AYt54KGBPwx6zSRPkKDq87T903NY1URk/n75DTmyizv0xZN0+2kBkLQiGkv7Qbz4aT7itmOjw/rV/WdUUOZFD+rWz1M/XRlZ0GHBGC X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3d6d573c-7fa0-4f5a-bb00-08d5fd15b129 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:CY1PR12MB0245; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0245; 3:D02a5FklOeiSdUSPRDvMaGDGEo+1ZKqYRZQdmRu+AN1cUpPNJ0fxxaHP5ARSfZMad3jZ4GRY3QiXHn9QzoL4S9KRSoOhDuO/HQIv0cDl8c/3GSXZWeEfB0u0I3F8Ipyqsu0zfamAZBnM7uW1hRcYPoCrp1bGzhc2rPM2x6cTvECnwIEHvxNAPSjYpx6h4cNBO96zprVBdx0OcwaMO7ZG6sC4spvE4uMPzVseDTMsgZAUwM8CoqcIl44W3K8/PQl0I2gSReu9eGUxPoESixLKY7YYSHJubNw7fMAkD9L9BhFk4MJ2bZkjYzCJPLJQnYeUobKHDz/M/D1tkUXu4xgxnvtC48J5CDbh26+UXyKIhh0=; 25:gzLuIO73lWRYyzmkWjLNEiTprJULJk42xwU132bD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BirydKsXcfUMxLQGdrHyWyRp8F/6e5FqdyApe8EFub1UNo++S/xC6Qy3q2YZn8n 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)(8121501046)(5005006)(10201501046)(3002001)(3231311)(944501410)(52105095)(93006095)(93003095)(6055026)(149027)(150027)(6041310)(20161123562045)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(6072148)(201708071742011)(7699016); SRVR:CY1PR12MB0245; BCL:0; PCL:0; RULEID:; SRVR:CY1PR12MB0245; X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0245; 4:Qk9i+nyJZMsiFjQwR/xDzhzVj6VzGDFHMIqisOx5eH9ie+vbPvYmWlZwNcDGlvNfmu92TBAfQARTvEIXL4R1q2ApYXPnFSbcM9KChNRvN43gdVWLNPImjlf1DlVlE5AAtxMTlSWdlnB3sVpzxCOArmAzU2sQR0f/nvZMOUHyK2yTGFMXv6FsjY8em03OS7QdCV+syGhieEHkTrI7Jvl0LUcVcbsK4Yhsp+k3T56hfs4imx6LnYjz39dmue6e1aJN3W0jf741ggz+qojx7p1WOFuErIxyyhWaLCpr4+xqqMarFOU7J2kPag8iPncy71w6 X-Forefront-PRVS: 07584EDBCD X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BCY1PR12MB0245=3B23=3A2ZhIfxu?= =?utf-8?q?/4UpQ+Muv3qL8eHh4gFxV8WnMy7ekjLLX9fuejX6LEi3k3ix9fTO0jsr94q70DYuN?= =?utf-8?q?29/lylutgGJIgUHM916YwXH7c5+QkK5gUdW7nPhwYinAkFsoDThi70llyNmPRTVpq?= =?utf-8?q?J2b6FhvJ5nOmS8hnr7ah+WwBABHc3X9Q2sdysGywSiqpxQlulA9IID5ycRSIhffA7?= =?utf-8?q?lzbpAmP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FNRo59cEmyPUnBDpTSMhtjVeSlvvfaUmLPYpZypxshIA14SL26efUBNAyOUjzsKZqP1tmojXqEDzUQ+w=; 7:mCj9EPWe3r0BqjFrLdqsAmoirEZdG2KAzQz7Clmu6IC9Oz5uRz7/43ZCoIuW9/c5RrSn5Pmc9U/+F/8F8TdYRPTNh6jTShF7FR4y6+My8+Rd01fubX1f92rK7im99C82LUs+5no/8LHeZfXDtUecx25o+Jo+T+XsY64GzRyK+9HfhJx7On/cpXRDMvALGc8LIGtkmvNSS9rPkRKETQN/6YtKUFzAHKGt9PkNuDe2R6iAWhkBNqto47Vf2sPde0Zu SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY1PR12MB0245; 20:y0uCFb1EHkZDmxsVrBymO523eS5gppQRcritEfSmtefvZkVgtw9QpYOUo3iGjBki72PHzA+UFeBjhin2gVGzgl3R6eYvVapBqhi98I7/mQOdJF7YO2MmYTLfuGisBecZOMVSS5vij4QtDo72UVZvYRJwENkLD7t1YBWJO6eh9a65i0RBALvUvpIfe1F8jVThdh0f7chpQpNlAjW5WxkKJNrWi/Ah4tgpUuukTF8U0VQJl2tAity/uPzU5SHAA3jw X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2018 09:59:54.9048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3d6d573c-7fa0-4f5a-bb00-08d5fd15b129 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: CY1PR12MB0245 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 --- 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.