From patchwork Mon Jan 16 03:27:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "He, Hongbo" X-Patchwork-Id: 9518039 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 09FAB6020B for ; Mon, 16 Jan 2017 04:00:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 942A328384 for ; Mon, 16 Jan 2017 04:00:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 857932848F; Mon, 16 Jan 2017 04:00:16 +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=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 2A15D28384 for ; Mon, 16 Jan 2017 04:00:16 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2E0546E232; Mon, 16 Jan 2017 04:00:14 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-BL2-obe.outbound.protection.outlook.com (mail-bl2nam02on0071.outbound.protection.outlook.com [104.47.38.71]) by gabe.freedesktop.org (Postfix) with ESMTPS id 63A9F6E232; Mon, 16 Jan 2017 04:00:12 +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=MsxFz0TfhOnie+uMjKL4KhmdF1J1cGXYi6eIMslcRAQ=; b=e7WBZf41v/e+mCoQl2okIaUKiZ0B0gJOAL6pRi7nHXHmjluqeKHYHbtr/h42H5XuLCd/vykLOahsDSPkafK86R9D53sshB/oTWk6x1ru5JgKPMqnhvjNjitGT8803NKlCXVJ6faDMoyBmN/Z+L8lqxlnz4xXEORACWBSF7Hoavc= Received: from MWHPR1201MB0127.namprd12.prod.outlook.com (10.174.98.142) by MWHPR1201MB0126.namprd12.prod.outlook.com (10.174.98.141) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.845.12; Mon, 16 Jan 2017 03:27:26 +0000 Received: from MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) by MWHPR1201MB0127.namprd12.prod.outlook.com ([10.174.98.142]) with mapi id 15.01.0845.013; Mon, 16 Jan 2017 03:27:25 +0000 From: "He, Hongbo" To: =?utf-8?B?Q2hyaXN0aWFuIEvDtm5pZw==?= Subject: RE: [PATCH 6/6] drm/ttm: revert "add optional LRU removal callback v2" Thread-Topic: [PATCH 6/6] drm/ttm: revert "add optional LRU removal callback v2" Thread-Index: AQHSbYKbiN9Lq6NnwUSXrfCG0mXLT6E6dMGg Date: Mon, 16 Jan 2017 03:27:25 +0000 Message-ID: References: <1484301071-21703-1-git-send-email-deathsimple@vodafone.de> <1484301071-21703-7-git-send-email-deathsimple@vodafone.de> In-Reply-To: <1484301071-21703-7-git-send-email-deathsimple@vodafone.de> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Hongbo.He@amd.com; x-originating-ip: [116.228.147.241] x-ms-office365-filtering-correlation-id: bd2c371a-f6e0-4bfa-8726-08d43dbf97bc x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:MWHPR1201MB0126; x-microsoft-exchange-diagnostics: 1; MWHPR1201MB0126; 7:+Jsj26ofQREeLJzImja3pBEPz/5uniKh7fspf7Nznhgl0R3q7i43xV0nN1P+gAONxIP5QfxJCcIYPjWlIZRsuYznChLL49M5hGziu1FokmfqF+byD1IFwAK4Nc4C8Lfamax7Glpw1b9LN/6roZ/CwBhf7JUhf3V46VY3nkFlAEZlell6b3jZk/pc+vrbpVp/qHkclBSAIekAGCSLtE1IuUnSbehNtrwL7M5x7TuBQMQj/Rb/k9kZPgZz8PpLPQF0qZjxzoS4JOettrEmOvLOKQU2WLZ1a/sQSpPWf+iB1Ke+lWzGCFZJSfeT//x8lEDovAMv8nl25l5/KxX+JXz9d+DdDP2CSxs8Q+949yMQ4P3xbU8Ao1oo6C+Vn8BF2nTaWck9gdCy5RVAAgffxKKw2WbkQ+Y0rnOXE/bHcNyP7gQcrJ0u49DjD3s55HEL2h9a8u8WefYfH/mJEvCJPQQnJw==; 20:8IHapqXUb0v5IuR+Jqaz8YKUQgwELBVamQ06QhLoYYswAQuK0cO1pnemzVu93R95DAYB1Dpt1XbzbREiWqxaH9SruA5x3sggynL//nh7YUpHfsmNwqdJtbruYCeOykgH/s9duT4ttAL1yLVYWSC2bqd5nXHiDWpSmnHw79mkPDDXpHfB+9N9PACFI0DMTNEChNresWeCvUsiRl2PGq7O3Fq5P6hSsi6sUPFNYOyO43CKI4gkxtkxCFg/GYUEkmCR x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(217544274631240); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123562025)(20161123555025)(20161123564025)(20161123560025)(6072148)(6042181); SRVR:MWHPR1201MB0126; BCL:0; PCL:0; RULEID:; SRVR:MWHPR1201MB0126; x-forefront-prvs: 01894AD3B8 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(13464003)(377454003)(199003)(189002)(3846002)(3280700002)(102836003)(99286003)(6116002)(77096006)(6506006)(27001)(105586002)(6436002)(54906002)(4326007)(50986999)(55016002)(9686003)(3660700001)(68736007)(122556002)(229853002)(54356999)(106356001)(76176999)(25786008)(2906002)(106116001)(38730400001)(101416001)(86362001)(92566002)(97736004)(2900100001)(81156014)(81166006)(66066001)(7696004)(74316002)(7736002)(305945005)(8676002)(110136003)(189998001)(5660300001)(2950100002)(33656002)(6916009)(8936002); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR1201MB0126; H:MWHPR1201MB0127.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Jan 2017 03:27:25.8254 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR1201MB0126 Cc: "dri-devel@lists.freedesktop.org" , "amd-gfx@lists.freedesktop.org" 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 Good way to keep original idea and remove CPU overhead. Reviewed-by: Roger.He and Test-by Roger.He -----Original Message----- From: Christian König [mailto:deathsimple@vodafone.de] Sent: Friday, January 13, 2017 5:51 PM To: He, Hongbo Cc: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org Subject: [PATCH 6/6] drm/ttm: revert "add optional LRU removal callback v2" From: Christian König Without the custom LRU management the callback is not used any more. Signed-off-by: Christian König --- drivers/gpu/drm/ttm/ttm_bo.c | 12 +++++------- include/drm/ttm/ttm_bo_driver.h | 6 ------ 2 files changed, 5 insertions(+), 13 deletions(-) -- 2.7.4 diff --git a/drivers/gpu/drm/ttm/ttm_bo.c b/drivers/gpu/drm/ttm/ttm_bo.c index 59fac2f..dfaeac4 100644 --- a/drivers/gpu/drm/ttm/ttm_bo.c +++ b/drivers/gpu/drm/ttm/ttm_bo.c @@ -186,12 +186,8 @@ EXPORT_SYMBOL(ttm_bo_add_to_lru); int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) { - struct ttm_bo_device *bdev = bo->bdev; int put_count = 0; - if (bdev->driver->lru_removal) - bdev->driver->lru_removal(bo); - if (!list_empty(&bo->swap)) { list_del_init(&bo->swap); ++put_count; @@ -201,6 +197,11 @@ int ttm_bo_del_from_lru(struct ttm_buffer_object *bo) ++put_count; } + /* + * TODO: Add a driver hook to delete from + * driver-specific LRU's here. + */ + return put_count; } @@ -234,9 +235,6 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo) lockdep_assert_held(&bo->resv->lock.base); - if (bdev->driver->lru_removal) - bdev->driver->lru_removal(bo); - put_count = ttm_bo_del_from_lru(bo); ttm_bo_list_ref_sub(bo, put_count, true); ttm_bo_add_to_lru(bo); diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index a1235fa..4395db1 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h @@ -462,12 +462,6 @@ struct ttm_bo_driver { struct ttm_mem_reg *mem); void (*io_mem_free)(struct ttm_bo_device *bdev, struct ttm_mem_reg *mem); - - /** - * Optional driver callback for when BO is removed from the LRU. - * Called with LRU lock held immediately before the removal. - */ - void (*lru_removal)(struct ttm_buffer_object *bo); }; /**