From patchwork Fri May 11 05:27:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunming Zhou X-Patchwork-Id: 10393303 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 43B2260236 for ; Fri, 11 May 2018 05:28:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0E4F4286D5 for ; Fri, 11 May 2018 05:28:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id F3DC1286EC; Fri, 11 May 2018 05:28:07 +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.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,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 7D273286D5 for ; Fri, 11 May 2018 05:28:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CBE3E6F020; Fri, 11 May 2018 05:28:03 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BN3-obe.outbound.protection.outlook.com (mail-bn3nam01on0084.outbound.protection.outlook.com [104.47.33.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 08CD26F020; Fri, 11 May 2018 05:28:01 +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=3opygfFwrSfhchpBTtKoB2EWHp3GcHAwpiXslCZtoAY=; b=TEtGHVCKf3gz8e3VPVVrzi2z3Z8ngLMo+Vl66jSE4zrWBVmv3cvaWOQrA64mYlFdT6E6FNcB7S+P627yvPSTvytUiHNuy7MR0dnguGftQaxgTHHDYaDWyyDjSeEfKsRbbC5pHKNkQiJkf3uWMKaLZAcoq4rIaS2Vt88G7IhRka4= Received: from BY1PR12MB0502.namprd12.prod.outlook.com (10.162.147.154) by BY1PR12MB0405.namprd12.prod.outlook.com (10.162.146.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.755.16; Fri, 11 May 2018 05:27:59 +0000 Received: from BY1PR12MB0502.namprd12.prod.outlook.com ([fe80::39d9:8999:aca1:f06b]) by BY1PR12MB0502.namprd12.prod.outlook.com ([fe80::39d9:8999:aca1:f06b%13]) with mapi id 15.20.0755.012; Fri, 11 May 2018 05:27:56 +0000 From: "Zhou, David(ChunMing)" To: "Zhang, Jerry" , "amd-gfx@lists.freedesktop.org" , "dri-devel@lists.freedesktop.org" Subject: RE: [PATCH 2/2] drm/amdgpu: set ttm bo priority before initialization Thread-Topic: [PATCH 2/2] drm/amdgpu: set ttm bo priority before initialization Thread-Index: AQHT6OSvTls78IKu5ES5kuZzUAssEKQp/p5A Date: Fri, 11 May 2018 05:27:56 +0000 Message-ID: References: <1526014680-4644-1-git-send-email-Jerry.Zhang@amd.com> <1526014680-4644-2-git-send-email-Jerry.Zhang@amd.com> In-Reply-To: <1526014680-4644-2-git-send-email-Jerry.Zhang@amd.com> 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=David1.Zhou@amd.com; x-originating-ip: [116.228.147.241] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BY1PR12MB0405; 7:JhxcszU/ZheShG5i2J68TG13sJsyryYepw5I+hzJrJcgzxWOrge5x9HR84RLBiwuKk889Rgpwj4VH2CcRt5Z5ZKUJWPZa32zQ27qyHyomelB+jsOg49HyE//ce1Nwsu2zBVVX7kq+3uhrX39f+Bm475jmDLYglOvRzszy2abn9knD7GPMpKM3CctvbwaPSpKhrjvkhRbEAWfQbMode82x1wBGq72DH4ZQQ6kGgFZ4gfm2E8zF48dza6NhMeTH4QS; 20:jFMGzlu5IJStf47eEaTG64kb0yPQTOnNfMuo8GdrqSNFjgmYrAMqtbaB5P8yzwjbAPzQv2hCXYZOA4T55xa6fiK9+UOuma6Mv4wK47U1ACzJkSWlDRVARrp4ke/1kJfmo5S3BQniXKYGqoQn65lKf4Ds//RK9LY0aCeg0Gl1ertMVp3QRJQ442o+joh7N7cj2dqvpzJhIqhJHGZtxvVkP4ythP4L5eWJel9Ix41YsoEHGkKJs25NbfaUGet8158Q x-ms-exchange-antispam-srfa-diagnostics: SOS;SOR; x-forefront-antispam-report: SFV:SKI; SCL:-1; SFV:NSPM; SFS:(10009020)(39380400002)(39860400002)(396003)(346002)(366004)(376002)(189003)(13464003)(199004)(2201001)(68736007)(86362001)(33656002)(3280700002)(105586002)(14454004)(450100002)(8676002)(3660700001)(106356001)(4326008)(81166006)(81156014)(8936002)(305945005)(9686003)(99286004)(7736002)(6506007)(53936002)(6246003)(102836004)(53546011)(5660300001)(74316002)(7696005)(26005)(76176011)(2906002)(55016002)(446003)(11346002)(476003)(25786009)(2501003)(5250100002)(6436002)(3846002)(6116002)(486006)(478600001)(72206003)(2900100001)(110136005)(54906003)(316002)(66066001)(97736004)(229853002); DIR:OUT; SFP:1101; SCL:1; SRVR:BY1PR12MB0405; H:BY1PR12MB0502.namprd12.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(48565401081)(2017052603328)(7153060)(7193020); SRVR:BY1PR12MB0405; x-ms-traffictypediagnostic: BY1PR12MB0405: x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(767451399110)(217544274631240); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231254)(944501410)(52105095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(20161123558120)(20161123562045)(6072148)(201708071742011); SRVR:BY1PR12MB0405; BCL:0; PCL:0; RULEID:; SRVR:BY1PR12MB0405; x-forefront-prvs: 06691A4183 received-spf: None (protection.outlook.com: amd.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: 3zUXR4nCQ5Zz8jXa5CjdCHx7bE+i5bOZB7NlcUQ8RYUmqsEgjOl4pFyIM0+3KFmCUykn/MU01ZnHezjO6/pfm2AZpeZCSXK1KwLRObuvw01KD9SaNaY4IcMMnS9lDqkr9l/Bk2TasGY2IKYtt7ZQH5kZriQIKSjZI6YiROD2WIDxwWWFUcTrzrW3mRLwQAh7 spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-MS-Office365-Filtering-Correlation-Id: 0371ec29-b134-4a0a-417e-08d5b6fff3ce X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0371ec29-b134-4a0a-417e-08d5b6fff3ce X-MS-Exchange-CrossTenant-originalarrivaltime: 11 May 2018 05:27:56.4527 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY1PR12MB0405 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: "Zhang, Jerry" , "Koenig, Christian" Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP The series is OK to me, Reviewed-by: Chunming Zhou It is better to wait Christian to have a look before pushing patch. Regards, David Zhou -----Original Message----- From: Junwei Zhang [mailto:Jerry.Zhang@amd.com] Sent: Friday, May 11, 2018 12:58 PM To: amd-gfx@lists.freedesktop.org; dri-devel@lists.freedesktop.org Cc: Koenig, Christian ; Zhou, David(ChunMing) ; Zhang, Jerry Subject: [PATCH 2/2] drm/amdgpu: set ttm bo priority before initialization Signed-off-by: Junwei Zhang --- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) else amdgpu_cs_report_moved_bytes(adev, ctx.bytes_moved, 0); - if (bp->type == ttm_bo_type_kernel) - bo->tbo.priority = 1; - if (bp->flags & AMDGPU_GEM_CREATE_VRAM_CLEARED && bo->tbo.mem.placement & TTM_PL_FLAG_VRAM) { struct dma_fence *fence; -- 1.9.1 diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c index e62153a..6a9e46a 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_object.c @@ -419,6 +419,8 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev, bo->tbo.bdev = &adev->mman.bdev; amdgpu_ttm_placement_from_domain(bo, bp->domain); + if (bp->type == ttm_bo_type_kernel) + bo->tbo.priority = 1; r = ttm_bo_init_reserved(&adev->mman.bdev, &bo->tbo, size, bp->type, &bo->placement, page_align, &ctx, acc_size, @@ -434,9 +436,6 @@ static int amdgpu_bo_do_create(struct amdgpu_device *adev,