From patchwork Fri Aug 10 11:55:55 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Huang Rui X-Patchwork-Id: 10562643 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 4B6E814C0 for ; Fri, 10 Aug 2018 11:56:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D0532B9C2 for ; Fri, 10 Aug 2018 11:56:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 312902B9C6; Fri, 10 Aug 2018 11:56:44 +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 DC1C52B9C2 for ; Fri, 10 Aug 2018 11:56:43 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D4F216E8B5; Fri, 10 Aug 2018 11:56:42 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0087.outbound.protection.outlook.com [104.47.37.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id C11FA6E855; Fri, 10 Aug 2018 11:56:41 +0000 (UTC) Received: from DM3PR12CA0072.namprd12.prod.outlook.com (2603:10b6:0:57::16) by DM2PR12MB0251.namprd12.prod.outlook.com (2a01:111:e400:50d1::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1038.21; Fri, 10 Aug 2018 11:56:39 +0000 Received: from DM3NAM03FT023.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::202) 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; Fri, 10 Aug 2018 11:56:39 +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 DM3NAM03FT023.mail.protection.outlook.com (10.152.82.205) 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; Fri, 10 Aug 2018 11:56:38 +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; Fri, 10 Aug 2018 06:56:36 -0500 From: Huang Rui To: , Subject: [PATCH v2 1/5] drm/ttm: add helper structures for bulk moves on lru list Date: Fri, 10 Aug 2018 19:55:55 +0800 Message-ID: <1533902159-14232-2-git-send-email-ray.huang@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1533902159-14232-1-git-send-email-ray.huang@amd.com> References: <1533902159-14232-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)(39860400002)(136003)(376002)(396003)(346002)(2980300002)(428003)(189003)(199004)(336012)(486006)(72206003)(426003)(476003)(2616005)(81156014)(8676002)(106466001)(11346002)(4326008)(81166006)(450100002)(305945005)(356003)(126002)(47776003)(2870700001)(446003)(2906002)(5820100001)(76176011)(478600001)(53416004)(105586002)(86362001)(36756003)(7696005)(5660300001)(23676004)(50226002)(6666003)(68736007)(8936002)(50466002)(26005)(110136005)(54906003)(77096007)(97736004)(316002)(186003)(53936002)(104016004); DIR:OUT; SFP:1101; SCL:1; SRVR:DM2PR12MB0251; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT023; 1:eZQ/JdMLluXopbeOnPsAvxTVVI5G9V5LL+sOPPVjAjaumrvvEmJOFWQ0ljpWbNjRdHhF8EbV48RrNkwXTf8bWD3w5+IPB2cakQ+5DV8Gk39/ybEbnSS7SiErY4zrovpr X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dd9e4801-5b6b-4fc1-6727-08d5feb8548a X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(2017052603328)(7153060); SRVR:DM2PR12MB0251; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 3:x/etb/iuCxcfbxqE/kHEcVxGxxmUkp8XnCR+qxU3S5en14RxTpul/gDBORgflpXgrvzwewQLpQKEsf7OCsU3mbVrcIXZZWvLKwKBCly9ZOJQYN2CStZUjpTtuAhT+GPybnE03mXmcYF90Y+VMdGp15xAC3CGmmxPYENDwLukGneCiUmlS5we0MNZaoUOSnwcRRpaeMlTzsBDrJ8N6pUuABi9R6fSLWNc9Y2f+HftOtyBQN1VCfclogaJIJoUbhLOo/F93lSOeGfin7OCuOTosbSx+dOkQTD8QHm2OBuV1ILTS9pHmVOOVZHOOePuaWiFcn6wdUfjFM8dIAijjcHiJ/eNpNWGNdIrnFlMJXgRz1k=; 25:r52n9BFb+dgid14ABVRhDHSGTKEl7x0tX4tXk70kG/2R2c+5pHgvLq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UEEONOQe8gKYO1lVhNZJ8tRUTKYk+EaePtRI8j4dlR2uI8VhqInYLX 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)(93006095)(93003095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:DM2PR12MB0251; BCL:0; PCL:0; RULEID:; SRVR:DM2PR12MB0251; X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 4:cuzHz4kiJg3U8ezNI4id6I8rchkyxA5ALtghMcct4yLMytKDagwmk41WtrzI2xBVg3SeXb7XX5++sGDrjigTqW7/aW3foCij7Se4bso6i62f2CYhj/0PFpG6bAK8u1C9fT4lXeVbBL71aDcO3Ft6048fH7csmcUWLexMUvtzb8uNTYoyGvX1cC9xxuJF+GvILJxdgYY6Nja078iaImhHIMy1OEVeomqbjGbhU0l7myJ2ju3c9YHrRQDH74+TSJCVjw8PyjxnLwIeAHFoCGySp+vSDZ/oUvX/+JxjTqLTmR+FAaagfrRLAvNLRYZ34hq1 X-Forefront-PRVS: 07607ED19A X-Microsoft-Exchange-Diagnostics: =?utf-8?q?1=3BDM2PR12MB0251=3B23=3A8BKPo8F?= =?utf-8?q?n42Zvov59Gnrb2DToESr2XS0Cb2LCYOBI7Tt+Utg+AvxCzuxfuzQeTLy7jsvqRdVT?= =?utf-8?q?bQK3npuVpCqj5hryWD82VKJMWhF9LxdRDqwtRv68pc5CaYLNBjAl9t7zJS0kvpNEP?= =?utf-8?q?T8adpJ60CDiXGLYqgGLY7+tJu2unS2L+jfUG+Oh3Y3kOme6HtCgt9eq9La5LcUn5i?= =?utf-8?q?c3dL03ysKF2EU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M9HLQ3fj55MLu3X6wisveywj3E6T0vfsEsoaCoH07jd9nSaDForlExWPIgDwci6d8vfUJC9CmnQobs=; 7:sH8u2X2hizQEHNg+AhgTBnCmybSOyz1sMrtLEAbFA2ix0wA1jI5sZ8f/cw03dkbtt5bU13X+59BQwUPPdu2g3e4uaZD+NtM1ZlX1C0hXP8s3IvtPTSjAM1LpI+Bm7U+EwCFib3aKd2FM3axh9GBKPV7+FDogg3PrFgLEQOEPm66uZTJeAOUz9GuGKgzMSGflcJ0Tt2dbC6jDY6SKprLRa3RRQFokaITvoBwDfOZnunouCKAIBDCm1RmxCLaZ8mlV SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DM2PR12MB0251; 20:0AUtJrTepDMxMPPzk5qNumqR2GeqknMj8vGX2NoG2rff4jlwuQKr/na1/CjDxcKlW8EDcYEmWJZlx80EbhmvJYE56IJqQcY7lIaGsy3oZGi9I1eFthGBqyv54EPrmBD2Ufs4SOqD60rPs9/bu30AxbKyiCE/R0kTERe7/9iPOkTTgE+iBw7DDSshYMAJgrh4ZMaXZJB8JPW5LR3mz6Gvgy8TM1P+Klm/GVviIRnrjkaQ0Tf1uA/1On8rhjzCAUCF X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Aug 2018 11:56:38.1087 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: dd9e4801-5b6b-4fc1-6727-08d5feb8548a 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: DM2PR12MB0251 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.