From patchwork Tue Jun 5 17:02:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 10448671 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 3437760284 for ; Tue, 5 Jun 2018 17:02:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2215F299E2 for ; Tue, 5 Jun 2018 17:02:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 15B05299F8; Tue, 5 Jun 2018 17:02:54 +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 63A60299E2 for ; Tue, 5 Jun 2018 17:02:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D32906EE9B; Tue, 5 Jun 2018 17:02:51 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-co1nam03on0042.outbound.protection.outlook.com [104.47.40.42]) by gabe.freedesktop.org (Postfix) with ESMTPS id 0A6196EE98; Tue, 5 Jun 2018 17:02:50 +0000 (UTC) Received: from CY4PR1201CA0012.namprd12.prod.outlook.com (2603:10b6:910:16::22) by SN1PR12MB2429.namprd12.prod.outlook.com (2603:10b6:802:26::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.820.12; Tue, 5 Jun 2018 17:02:48 +0000 Received: from DM3NAM03FT062.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e49::204) by CY4PR1201CA0012.outlook.office365.com (2603:10b6:910:16::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.841.14 via Frontend Transport; Tue, 5 Jun 2018 17:02:48 +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 DM3NAM03FT062.mail.protection.outlook.com (10.152.83.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.841.10 via Frontend Transport; Tue, 5 Jun 2018 17:02:47 +0000 Received: from agrodzovsky-All-Series.amd.com (10.34.1.3) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.382.0; Tue, 5 Jun 2018 12:02:46 -0500 From: Andrey Grodzovsky To: , Subject: [PATCH 1/2] drm/scheduler: Rename cleanup functions. Date: Tue, 5 Jun 2018 13:02:34 -0400 Message-ID: <1528218155-11638-1-git-send-email-andrey.grodzovsky@amd.com> X-Mailer: git-send-email 2.7.4 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)(396003)(376002)(346002)(39380400002)(39860400002)(2980300002)(428003)(199004)(189003)(50466002)(59450400001)(26005)(77096007)(44832011)(104016004)(54906003)(110136005)(50226002)(478600001)(2616005)(6666003)(47776003)(575784001)(336012)(5820100001)(486006)(8676002)(4326008)(5660300001)(97736004)(86362001)(68736007)(476003)(305945005)(81156014)(2870700001)(53936002)(105586002)(186003)(8936002)(81166006)(316002)(23676004)(2906002)(53416004)(72206003)(7696005)(356003)(426003)(36756003)(126002)(106466001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR12MB2429; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-Microsoft-Exchange-Diagnostics: 1; DM3NAM03FT062; 1:gETOKdJoG9nMIssHckwX0fjy1ovKl6icdWSmvQ6xDL9YL4CRNcTWB0N6SFhZPcZiLDsB8MywOPfYu5GO0ALiLQq7z8hTVo4PXz1dph0t0So199HHXZg0WqTLHAmlRMHN X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:SN1PR12MB2429; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2429; 3:HoKgE9EtypcibEkK7fkK77/ZwjDB7a6tLW7C/PAtSGQThIcWyr3yPIjlgpnP+WdLMlWyKrmmnZgRvMt+dHw2vhaWctiSUEICxMR0TgLz4pLA2HPfndpV3ASLFpfUQG9wmr1S5TgifHhUPD552C0ZBU+aMUM7qZHj1XYanTot0VBCBCav3cAu6AAeTrW7qQCQ/rSRCeqbr2cV/QISAoBKafi0I9P0C+8FtIE9rdTmEqtLrrIE+WTAvjvsjqI/vXGr5OXnMQCHKv0Wk4w3TV2q/WkZyQMxY91Cki95MqMq7/7xVp0jzvqAJ3DmsfTEun6iapFF2oeGelYv1mYT93njLSwJwNQO8TsTMABEev+HYwE=; 25:t/Dzelryl6JNg+bvaTfAsfIA3s59tbXyqfX+WOTcntesD09SO+HcqMw/e7GrgnKr9cFRClL90I0wGosKXF+leB5ZSTa8ooqWUgcibjKdzwxzEQT3eeGdJ1PP4xl3iFgrWqbH80JnhviMipG671ojD9EoFoTPOiTHqueqUjmcUY60jtoS9bzUVhwq8MA/REWPovMgH8g9CXGI7B+856Ssnuw2f4Syt9ZWTYbbLgrzrzh0Z0DAlREzijMG9Kz8S0YIFZ6BnTlKcnTIkkJG/a+3rjz9CkEJjbY6ODT7yx85bo3c1/k75e6Zk1PpY/D1zyNBdclY5AbBWRrL10BmPVDRHQ== X-MS-TrafficTypeDiagnostic: SN1PR12MB2429: X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2429; 31:mDM1gSl7ShteYZvrNPXRSXguAU975+XKcDVfd5/1xyAjkaAdP9O+VdmtE3CdwcUjQIyu+Zs3HjJYpGp62Ky4x9HJExA0aCG+6Q/tMrtXrqhVvQYcg0Q+jYJssbTRb2iQiaYoy1GRj5HNAwJMrVAaGKVNuhFafCt7U+93jjuaWPHl1U0hpS//lZ4txiLoQvuAGPCcwHpUw736nPIib52skTrVfQbrLT0j3tKLKJZ00ys=; 20:BDxHy2tnQc1AjFWBPlqc1aH2bYQFmOaLfmyNdGeqLh5sutd2plG2LyV/j/XL0c6NlkPXNlpSJTqWa4BSjKWIFWzUfudJq31VCYBCZnYw+DCcfB+kIBcpkI2x9muRFQ4WPH49b1fCWe9Dkieb4yGil4fO2H2hRs6nFKJeet/DMH1/bqlASv49z7jkCwW0gW7rLP4+mSDnIBSZslaOrJkTzSGv89kXTbkTt7w/e2nuI2LJ1di26C0d8Gb1hWNMKBsbJGQ+UyuHJoC3fzGcJPjYUspsV5YH8FQgzpq9Sgk1sFWWH1q0T6WVCfgOqJgj71YBYWcYHk29yqDtaSCrDJ2RtHGkTCSvkYHiB9R7lWIeuImj0yBSI8g3CN+ahvbDs9GI7DQXhgiGJ/jOBzcv19fSO9AVb15hCG5j9D/9usW3kMiBzzt0PL2q6AeF3adPuoh+WbrJjlpbBDBPwlE0XkzW5L13J/llWuqC4MsGpqgruJArL0/9Ws7ZAP+cLH6v6I+q X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(17755550239193); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(93006095)(93003095)(3231254)(944501410)(52105095)(10201501046)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123560045)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(6072148)(201708071742011)(7699016); SRVR:SN1PR12MB2429; BCL:0; PCL:0; RULEID:; SRVR:SN1PR12MB2429; X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2429; 4:jOec5kxtBIN6ojXvbxJ71bH/7aqnRMTot242QSJkpec5y6mq/RYg1iuZTmn4kdrL3ZTUKhc1qRh9+m5EwqUYYPgPaVaGZ7jf8wcDP72xPlvGUWVV2ULYE+CDyt42jSH5EUXeH6N8pzQ29m/BrOUOE0mJTTHxy53J80ORtmOtu5NBKzABSP/FHf3iWzypZsXv9tzyIr/rT5UBPYGi/q4f++FBXWPzyvTum2hVHLI8J7Wi3f1Faf0oTbxgOFWIJPX1ECiBZ7FWm56g66uE7fv6iJc+KbMqyJODi3STjeF9Ajx+c4/EQQi2mGIWC45xmpPR1yEf3xKJhB0fgYymrIae1w== X-Forefront-PRVS: 0694C54398 X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtTTjFQUjEyTUIyNDI5OzIzOlU2eXd3R0NpeXhzNkhZU1BiMS9Wa1lRMzRm?= =?utf-8?B?WEt2SnBmTlViTGJTVEdNOC9HKzBwUWVuMVY0RW1RdHloQm5IMk8rRTRDbEFs?= =?utf-8?B?eW91Vm5QcDA1N21GR295NkZxZFRmeXV1ei9YWjJNZW9UWVRZYU5FT1hlUUc5?= =?utf-8?B?STNxZldmVGFWb3doc1JyRnhPQW05TWF6T0s5Z0k1N0xxZzByb1kxdVNJM0J4?= =?utf-8?B?UDBwMENibys1U1hXM2VGdC80TUtUZ0ZrbW8ycmZIV2VaTllnVDlkdWxPaito?= =?utf-8?B?T3hSdnY3d3liMkN2UUV0amltMzdCS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GgYoexzL6JN9PfbgtwDNSxTiHAI98t3G0cfp6pSH0YSztFAywnHRFERkgoBu7NrPAh7EtgQTEDuYt/y8cmmyiqAJGP85Zr1RAFf19eImDZo3BA==; 5:jQCt9qB7wjfQghi7jkRM/fJl+AewQt0p7W/MlQEePFUykDMQEyiVchsf0sAspBXTXXx0l8aoM6a9kThae7Bv5Nwd8jf3RalmWKebZ62Utd0GlxAcWv3lP1z+odzZBIyltfMtir4yBtgU0Y0hdusTlDkdbYip1K8C2fX7WT/qL4s=; 24:/gdxpfU6S8kSulyCgaFJLv5IYpio3DV8suesYpi+MiGyFuvY8UJIDptO+qr3+95e0eXtY5CzaGCjOjTnduy6hyJ8ut0tHGEtyAGhUt0tGfU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR12MB2429; 7:knTtE2MDuLeQzm7hf1NOaM0rCFGb7RlpE3fhHeb822X/zoYtBBszV+UNx3iKgYh1c4YBbAt2sLkea69cHMHKq6JDj4njpTdClbTZag3wGAFgdd2cT0if432flaKpCGG9KKaJak6hSy4+q2n5r+dLcCy9kLRaSDUu6D3AWJ8WW9VODPaoEwrqaLRGEAcptmifF+KY+Sg4kq3MN3d/gR6xA6qmCeL6ypPzh9th7AIINUN9FxERDmLAsWn8vJAW1jxv; 20:rgp3Xj3pWMPFACPIxOLky3UaJEMrHUjJ5sOOzypRelhRDRD3Q6RdWEZtUmzd/9ulIP9t0OTWIf4Q7SrnsNgcPJJDX0Vf6GK9wnvmiSbmn3HvdmJiyFKXER+/Vz4N3N/3xZtQ8QFRyQwPYPoB+CnI/XLn2IL+yO5C8faGucX/veiixmVUU0uLK6eCRyFsaeyVu8tkGRD+Vv7yhH29McodM14aKY6D19ZRpRJN0FiLr5TuTAFurSa122+zXeqgCzSn X-MS-Office365-Filtering-Correlation-Id: 72e60348-d3d5-4e8f-6633-08d5cb0629f3 X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jun 2018 17:02:47.4352 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 72e60348-d3d5-4e8f-6633-08d5cb0629f3 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: SN1PR12MB2429 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: Christian.Koenig@amd.com, etnaviv@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Everything in the flush code path (i.e. waiting for SW queue to become empty) names with *_flush() and everything in the release code path names *_fini() This patch also effect the amdgpu and etnaviv drivers which use those functions. Signed-off-by: Andrey Grodzovsky Suggested-by: Christian König Acked-by: Lucas Stach --- drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 8 ++++---- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c | 2 +- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c | 2 +- drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c | 2 +- drivers/gpu/drm/etnaviv/etnaviv_drv.c | 2 +- drivers/gpu/drm/scheduler/gpu_scheduler.c | 18 +++++++++--------- include/drm/gpu_scheduler.h | 6 +++--- 10 files changed, 24 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index 64b3a1e..c0f06c0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -104,7 +104,7 @@ static int amdgpu_ctx_init(struct amdgpu_device *adev, failed: for (j = 0; j < i; j++) - drm_sched_entity_fini(&adev->rings[j]->sched, + drm_sched_entity_destroy(&adev->rings[j]->sched, &ctx->rings[j].entity); kfree(ctx->fences); ctx->fences = NULL; @@ -178,7 +178,7 @@ static void amdgpu_ctx_do_release(struct kref *ref) if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring) continue; - drm_sched_entity_fini(&ctx->adev->rings[i]->sched, + drm_sched_entity_destroy(&ctx->adev->rings[i]->sched, &ctx->rings[i].entity); } @@ -466,7 +466,7 @@ void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr) if (ctx->adev->rings[i] == &ctx->adev->gfx.kiq.ring) continue; - max_wait = drm_sched_entity_do_release(&ctx->adev->rings[i]->sched, + max_wait = drm_sched_entity_flush(&ctx->adev->rings[i]->sched, &ctx->rings[i].entity, max_wait); } } @@ -492,7 +492,7 @@ void amdgpu_ctx_mgr_entity_cleanup(struct amdgpu_ctx_mgr *mgr) continue; if (kref_read(&ctx->refcount) == 1) - drm_sched_entity_cleanup(&ctx->adev->rings[i]->sched, + drm_sched_entity_fini(&ctx->adev->rings[i]->sched, &ctx->rings[i].entity); else DRM_ERROR("ctx %p is still alive\n", ctx); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c index 57d4da6..a6e3191 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c @@ -162,7 +162,7 @@ static int amdgpu_ttm_global_init(struct amdgpu_device *adev) static void amdgpu_ttm_global_fini(struct amdgpu_device *adev) { if (adev->mman.mem_global_referenced) { - drm_sched_entity_fini(adev->mman.entity.sched, + drm_sched_entity_destroy(adev->mman.entity.sched, &adev->mman.entity); mutex_destroy(&adev->mman.gtt_window_lock); drm_global_item_unref(&adev->mman.bo_global_ref.ref); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index bcf68f8..d7ff39e 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c @@ -292,7 +292,7 @@ int amdgpu_uvd_sw_fini(struct amdgpu_device *adev) for (j = 0; j < adev->uvd.num_uvd_inst; ++j) { kfree(adev->uvd.inst[j].saved_bo); - drm_sched_entity_fini(&adev->uvd.inst[j].ring.sched, &adev->uvd.inst[j].entity); + drm_sched_entity_destroy(&adev->uvd.inst[j].ring.sched, &adev->uvd.inst[j].entity); amdgpu_bo_free_kernel(&adev->uvd.inst[j].vcpu_bo, &adev->uvd.inst[j].gpu_addr, diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c index 23d960e..b0dcdfd 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c @@ -222,7 +222,7 @@ int amdgpu_vce_sw_fini(struct amdgpu_device *adev) if (adev->vce.vcpu_bo == NULL) return 0; - drm_sched_entity_fini(&adev->vce.ring[0].sched, &adev->vce.entity); + drm_sched_entity_destroy(&adev->vce.ring[0].sched, &adev->vce.entity); amdgpu_bo_free_kernel(&adev->vce.vcpu_bo, &adev->vce.gpu_addr, (void **)&adev->vce.cpu_addr); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index b0eb2f5..0ab1440 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c @@ -2477,7 +2477,7 @@ int amdgpu_vm_init(struct amdgpu_device *adev, struct amdgpu_vm *vm, vm->root.base.bo = NULL; error_free_sched_entity: - drm_sched_entity_fini(&ring->sched, &vm->entity); + drm_sched_entity_destroy(&ring->sched, &vm->entity); return r; } @@ -2610,7 +2610,7 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags); } - drm_sched_entity_fini(vm->entity.sched, &vm->entity); + drm_sched_entity_destroy(vm->entity.sched, &vm->entity); if (!RB_EMPTY_ROOT(&vm->va.rb_root)) { dev_err(adev->dev, "still active bo inside vm\n"); diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c index bfddf97..1df1c61 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v6_0.c @@ -470,7 +470,7 @@ static int uvd_v6_0_sw_fini(void *handle) return r; if (uvd_v6_0_enc_support(adev)) { - drm_sched_entity_fini(&adev->uvd.inst->ring_enc[0].sched, &adev->uvd.inst->entity_enc); + drm_sched_entity_destroy(&adev->uvd.inst->ring_enc[0].sched, &adev->uvd.inst->entity_enc); for (i = 0; i < adev->uvd.num_enc_rings; ++i) amdgpu_ring_fini(&adev->uvd.inst->ring_enc[i]); diff --git a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c index 57d32f2..ba244d3 100644 --- a/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/uvd_v7_0.c @@ -491,7 +491,7 @@ static int uvd_v7_0_sw_fini(void *handle) return r; for (j = 0; j < adev->uvd.num_uvd_inst; ++j) { - drm_sched_entity_fini(&adev->uvd.inst[j].ring_enc[0].sched, &adev->uvd.inst[j].entity_enc); + drm_sched_entity_destroy(&adev->uvd.inst[j].ring_enc[0].sched, &adev->uvd.inst[j].entity_enc); for (i = 0; i < adev->uvd.num_enc_rings; ++i) amdgpu_ring_fini(&adev->uvd.inst[j].ring_enc[i]); diff --git a/drivers/gpu/drm/etnaviv/etnaviv_drv.c b/drivers/gpu/drm/etnaviv/etnaviv_drv.c index 23e73c2..3dff4d0 100644 --- a/drivers/gpu/drm/etnaviv/etnaviv_drv.c +++ b/drivers/gpu/drm/etnaviv/etnaviv_drv.c @@ -140,7 +140,7 @@ static void etnaviv_postclose(struct drm_device *dev, struct drm_file *file) gpu->lastctx = NULL; mutex_unlock(&gpu->lock); - drm_sched_entity_fini(&gpu->sched, + drm_sched_entity_destroy(&gpu->sched, &ctx->sched_entity[i]); } } diff --git a/drivers/gpu/drm/scheduler/gpu_scheduler.c b/drivers/gpu/drm/scheduler/gpu_scheduler.c index 6a31670..7d25606 100644 --- a/drivers/gpu/drm/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/scheduler/gpu_scheduler.c @@ -256,7 +256,7 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f, /** - * drm_sched_entity_do_release - Destroy a context entity + * drm_sched_entity_flush - Flush a context entity * * @sched: scheduler instance * @entity: scheduler entity @@ -267,7 +267,7 @@ static void drm_sched_entity_kill_jobs_cb(struct dma_fence *f, * * Returns the remaining time in jiffies left from the input timeout */ -long drm_sched_entity_do_release(struct drm_gpu_scheduler *sched, +long drm_sched_entity_flush(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity, long timeout) { long ret = timeout; @@ -294,7 +294,7 @@ long drm_sched_entity_do_release(struct drm_gpu_scheduler *sched, return ret; } -EXPORT_SYMBOL(drm_sched_entity_do_release); +EXPORT_SYMBOL(drm_sched_entity_flush); /** * drm_sched_entity_cleanup - Destroy a context entity @@ -306,7 +306,7 @@ EXPORT_SYMBOL(drm_sched_entity_do_release); * entity and signals all jobs with an error code if the process was killed. * */ -void drm_sched_entity_cleanup(struct drm_gpu_scheduler *sched, +void drm_sched_entity_fini(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity) { @@ -357,7 +357,7 @@ void drm_sched_entity_cleanup(struct drm_gpu_scheduler *sched, dma_fence_put(entity->last_scheduled); entity->last_scheduled = NULL; } -EXPORT_SYMBOL(drm_sched_entity_cleanup); +EXPORT_SYMBOL(drm_sched_entity_fini); /** * drm_sched_entity_fini - Destroy a context entity @@ -367,13 +367,13 @@ EXPORT_SYMBOL(drm_sched_entity_cleanup); * * Calls drm_sched_entity_do_release() and drm_sched_entity_cleanup() */ -void drm_sched_entity_fini(struct drm_gpu_scheduler *sched, +void drm_sched_entity_destroy(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity) { - drm_sched_entity_do_release(sched, entity, MAX_WAIT_SCHED_ENTITY_Q_EMPTY); - drm_sched_entity_cleanup(sched, entity); + drm_sched_entity_flush(sched, entity, MAX_WAIT_SCHED_ENTITY_Q_EMPTY); + drm_sched_entity_fini(sched, entity); } -EXPORT_SYMBOL(drm_sched_entity_fini); +EXPORT_SYMBOL(drm_sched_entity_destroy); static void drm_sched_entity_wakeup(struct dma_fence *f, struct dma_fence_cb *cb) { diff --git a/include/drm/gpu_scheduler.h b/include/drm/gpu_scheduler.h index 7c2dfd6..4214ceb 100644 --- a/include/drm/gpu_scheduler.h +++ b/include/drm/gpu_scheduler.h @@ -284,12 +284,12 @@ int drm_sched_entity_init(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity, struct drm_sched_rq *rq, atomic_t *guilty); -long drm_sched_entity_do_release(struct drm_gpu_scheduler *sched, +long drm_sched_entity_flush(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity, long timeout); -void drm_sched_entity_cleanup(struct drm_gpu_scheduler *sched, - struct drm_sched_entity *entity); void drm_sched_entity_fini(struct drm_gpu_scheduler *sched, struct drm_sched_entity *entity); +void drm_sched_entity_destroy(struct drm_gpu_scheduler *sched, + struct drm_sched_entity *entity); void drm_sched_entity_push_job(struct drm_sched_job *sched_job, struct drm_sched_entity *entity); void drm_sched_entity_set_rq(struct drm_sched_entity *entity,