From patchwork Fri Nov 23 08:02:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Monk" X-Patchwork-Id: 10695201 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 E8E301709 for ; Fri, 23 Nov 2018 08:02:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE7002C451 for ; Fri, 23 Nov 2018 08:02:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D24C72C482; Fri, 23 Nov 2018 08:02:15 +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 91A1F2C453 for ; Fri, 23 Nov 2018 08:02:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74DED6E526; Fri, 23 Nov 2018 08:02: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-eopbgr750084.outbound.protection.outlook.com [40.107.75.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id BEB756E526 for ; Fri, 23 Nov 2018 08:02:12 +0000 (UTC) Received: from CY4PR1201MB0245.namprd12.prod.outlook.com (10.172.79.10) by CY4PR1201MB0136.namprd12.prod.outlook.com (10.172.78.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1361.14; Fri, 23 Nov 2018 08:02:11 +0000 Received: from CY4PR1201MB0245.namprd12.prod.outlook.com ([fe80::f1aa:26e2:d7c8:2a7e]) by CY4PR1201MB0245.namprd12.prod.outlook.com ([fe80::f1aa:26e2:d7c8:2a7e%11]) with mapi id 15.20.1361.016; Fri, 23 Nov 2018 08:02:11 +0000 From: "Liu, Monk" To: "dri-devel@lists.freedesktop.org" Subject: FW: [PATCH] drm: should break if already get the best size Thread-Topic: [PATCH] drm: should break if already get the best size Thread-Index: AQHUgl+MZnEVSWJV9UeNiwtRwErG6KVdAOeA Date: Fri, 23 Nov 2018 08:02:11 +0000 Message-ID: References: <1542889986-13261-1-git-send-email-Monk.Liu@amd.com> In-Reply-To: <1542889986-13261-1-git-send-email-Monk.Liu@amd.com> Accept-Language: en-US, zh-CN Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [116.228.147.241] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; CY4PR1201MB0136; 20:EBk3xALOlJnsui/D6NMmYOrzHPcGZ4JQr2zS2qRvy0QOzve7zFjBz57hbSmdSGEB1d29wYXBuJMyLk4hOs9/I6i7NoC1kE28Wh7wEqYJaV/0x72ziLcsZhbSSS9lDM7+Yxs8GVYP3PuBmvcqSEC+Gp2MQ5kgpn3LEsO7C0MM9thANMynxO1misqu9u4V0V0wWqk3unF6mRNwI2XxQ8EZWbnRIoWaWZiDauGDLFXAIGpjF1I3uvc7+n5m3wk0oRA5 x-ms-exchange-antispam-srfa-diagnostics: SOS; x-ms-office365-filtering-correlation-id: 3d151d9d-432f-4bbc-da1f-08d65119f906 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390098)(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:CY4PR1201MB0136; x-ms-traffictypediagnostic: CY4PR1201MB0136: x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231442)(944501410)(52105112)(3002001)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123558120)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(201708071742011)(7699051)(76991095); SRVR:CY4PR1201MB0136; BCL:0; PCL:0; RULEID:; SRVR:CY4PR1201MB0136; x-forefront-prvs: 086597191B x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(396003)(136003)(376002)(346002)(39860400002)(13464003)(189003)(199004)(966005)(229853002)(8936002)(2900100001)(8676002)(66066001)(6306002)(2473003)(9686003)(3846002)(97736004)(81156014)(55016002)(6116002)(5640700003)(5660300001)(53936002)(6916009)(478600001)(68736007)(316002)(6436002)(106356001)(76176011)(105586002)(7696005)(99286004)(2906002)(7736002)(26005)(305945005)(2351001)(74316002)(6506007)(53546011)(102836004)(72206003)(446003)(25786009)(186003)(2501003)(486006)(71200400001)(33656002)(71190400001)(81166006)(476003)(86362001)(11346002)(256004)(14454004)(28333003)(15583001); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR1201MB0136; H:CY4PR1201MB0245.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: f3xVc+XqCw/01mABipCBmqTQbhsgasO4KkztG8yoKblQ5JEwpRN7zx5J22ud6NQW8BWGgTTGG/ddYmIepxAkyEK/0KcunXQyhBHP9FkS5WyKN7DqhYh+xBQRajDPpCjRbXfbJNCDpH0l8oZePjVDVxbTjB6yPQ45NOF7q79+38LRqPgOPRYWJXn0SEuDrV3vvOemFQHOGnP2o/ZotQi0THB/Ag653yycZovnSCFpMRPzvD/g6jKqB63xEzcQI+BHDGWClPIRfuTQwzuAUDHf3n2d/JzqtBe2A1wFz8fIXCGvO55Zp/b4v94aoKfNo/Ypq/58PiPksBh030+4eeYGA0lk8lOtD40XsOx/q2/GA/w= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3d151d9d-432f-4bbc-da1f-08d65119f906 X-MS-Exchange-CrossTenant-originalarrivaltime: 23 Nov 2018 08:02:11.1940 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR1201MB0136 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP -----Original Message----- From: amd-gfx On Behalf Of Monk Liu Sent: Thursday, November 22, 2018 8:33 PM To: amd-gfx@lists.freedesktop.org Cc: Liu, Monk Subject: [PATCH] drm: should break if already get the best size Signed-off-by: Monk Liu --- drivers/gpu/drm/drm_mm.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.7.4 diff --git a/drivers/gpu/drm/drm_mm.c b/drivers/gpu/drm/drm_mm.c index 3cc5fbd..369fd9b 100644 --- a/drivers/gpu/drm/drm_mm.c +++ b/drivers/gpu/drm/drm_mm.c @@ -318,6 +318,8 @@ static struct drm_mm_node *best_hole(struct drm_mm *mm, u64 size) if (size <= node->hole_size) { best = node; rb = rb->rb_right; + if (size == node->hole_size) + break; } else { rb = rb->rb_left; }