From patchwork Sat Jun 11 13:52:29 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrey Grodzovsky X-Patchwork-Id: 9171037 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 18E2A60573 for ; Sat, 11 Jun 2016 13:52:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E7B8F2766D for ; Sat, 11 Jun 2016 13:52:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB95127C0C; Sat, 11 Jun 2016 13:52:40 +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=-3.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C2F522766D for ; Sat, 11 Jun 2016 13:52:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0537A6E285; Sat, 11 Jun 2016 13:52:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from na01-bl2-obe.outbound.protection.outlook.com (mail-bl2on0099.outbound.protection.outlook.com [65.55.169.99]) by gabe.freedesktop.org (Postfix) with ESMTPS id 658846E285 for ; Sat, 11 Jun 2016 13:52:32 +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=PVt90XIvPbJ2y0RZHZQ1FJM+yKT4gB3hny4/3a+/xB8=; b=pfRqC6RHBw0AcQdtnQ2nqMcZmEPT1+8enzMAkNwnfe6GKW1MjgWfOgapmLM08NgwLlEWye5JjrQqyxf83DL2g+kB7SdJ/nvh9u6DPLLRmffQGnK993CF9hJkNTjP5bMhX42Msy6daeVHB7XoTotzG1+k50tYg3Sny+3lnXf9THs= Received: from BLUPR12MB0401.namprd12.prod.outlook.com (10.162.91.26) by BLUPR12MB0402.namprd12.prod.outlook.com (10.162.91.27) with Microsoft SMTP Server (TLS) id 15.1.511.8; Sat, 11 Jun 2016 13:52:29 +0000 Received: from BLUPR12MB0401.namprd12.prod.outlook.com ([10.162.91.26]) by BLUPR12MB0401.namprd12.prod.outlook.com ([10.162.91.26]) with mapi id 15.01.0517.009; Sat, 11 Jun 2016 13:52:29 +0000 From: "Grodzovsky, Andrey" To: "dri-devel@lists.freedesktop.org" Subject: drm/dp/mst: Always clear proposed vcpi table for port. reminder. Thread-Topic: drm/dp/mst: Always clear proposed vcpi table for port. reminder. Thread-Index: AdHD6HxmY4CNw7xYTNu9Rgknsj4I1g== Date: Sat, 11 Jun 2016 13:52:29 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Andrey.Grodzovsky@amd.com; x-originating-ip: [165.204.55.251] x-ms-office365-filtering-correlation-id: e077d63b-4d7b-4fdc-c822-08d391ffa117 x-microsoft-exchange-diagnostics: 1; BLUPR12MB0402; 5:HuR2HLzkQBxngSPKbVLt3cJC0VuKiGIpgFIbtHo/9ZUnWOhc2nzwPymnlzQqAAXYiwtYGj+RxNBaR3H8C6B4Gq+c66UKgz6RX8VVeZPRIBX6w8G5yF5h3WwVIpbrbk2/guqO1+pjSWwK20pXZutajg==; 24:upUEb42UhfPmuIEZGDcmzqhuHJhmpKFBDUvps+WSbQe/XGwlAfTdQe5aNpNv88iCdhydHAEAFyr6zuJgHL3A69iQTYv+oQhN/yOKqPasY4I=; 7:7AGrSlr9DRWP6QdfuPiEPKmYz9GlPBikrycyVbCJd3qSIQ6MZNtJE/rQEUAXWgjhj+MAPqu6qqt9M0UfkYY22ILIzJ6Rgm3XVD+Fre/WXluzGk6kHA7u9xagFqYG3uQ7UsAzNLbXNDli+JsESpEG2kK/VxwDoVBclGCORgCNeWUjS+bXNklyDp+rvv8vRGaRpYsg7PbFjyr7Xshh2kcmuw==; 20:l66Uzzgc3S+FJELSXqiaiWV4bkSQoekxX2w4/x2MWuwpJJjg80Nkj8HATB0kLeVUvWY6SjRT9IxutqP6757WKfTaSl1dVZuEZwQfauuQIIJbxBR5ukggSIW/0475aHR5LP6p/FLwyt8CBisxuWaPxXhu/xTVnVSNnN4nuqxefhWGigxMUey00/XWNxauZJG2yUuJoIyVkBvddsPhNJQBTHdvgw57xUt23xSEzvR9Lh983aJBaYE+n9fq+i/rPqg5 x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR12MB0402; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(9452136761055)(767451399110)(217544274631240); x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(10201501046)(3002001)(6055026); SRVR:BLUPR12MB0402; BCL:0; PCL:0; RULEID:; SRVR:BLUPR12MB0402; x-forefront-prvs: 0970508454 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(6009001)(7916002)(377424004)(12213003)(27574002)(53434003)(13464003)(377454003)(189002)(199003)(11100500001)(33656002)(66066001)(99286002)(5008740100001)(450100001)(8676002)(4326007)(81166006)(81156014)(74316001)(105586002)(10400500002)(106356001)(5004730100002)(122556002)(229853001)(2351001)(97736004)(110136002)(189998001)(3660700001)(86362001)(3280700002)(9686002)(2501003)(87936001)(5003600100002)(575784001)(2900100001)(2906002)(101416001)(5002640100001)(50986999)(68736007)(6116002)(102836003)(3846002)(586003)(8936002)(54356999)(76576001)(77096005)(19580395003)(19580405001)(15975445007)(92566002); DIR:OUT; SFP:1101; SCL:1; SRVR:BLUPR12MB0402; H:BLUPR12MB0401.namprd12.prod.outlook.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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: 11 Jun 2016 13:52:29.1781 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR12MB0402 Cc: "Deucher, Alexander" , "Lysenko, Mykola" 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 Hi. Just a reminder with regard to this patch. Please comment if any changes are required. Thanks. -----Original Message----- From: dri-devel [mailto:dri-devel-bounces@lists.freedesktop.org] On Behalf Of dri-devel-request@lists.freedesktop.org Sent: Wednesday, May 25, 2016 5:05 PM To: dri-devel@lists.freedesktop.org Subject: dri-devel Digest, Vol 74, Issue 400 Send dri-devel mailing list submissions to dri-devel@lists.freedesktop.org To subscribe or unsubscribe via the World Wide Web, visit https://lists.freedesktop.org/mailman/listinfo/dri-devel or, via email, send a message with subject or body 'help' to dri-devel-request@lists.freedesktop.org You can reach the person managing the list at dri-devel-owner@lists.freedesktop.org When replying, please edit your Subject line so it is more specific than "Re: Contents of dri-devel digest..." Today's Topics: 1. [PATCH] drm/dp/mst: Always clear proposed vcpi table for port. (Andrey Grodzovsky) 2. [pull] amdgpu drm-next-4.7 (Alex Deucher) 3. [PATCH 0/8] scheduler code cleanup (Alex Deucher) 4. [PATCH 6/8] drm/amdgpu: properly abstract scheduler timeout handling (Alex Deucher) 5. [PATCH 2/8] drm/amdgpu: remove begin_job/finish_job (Alex Deucher) ---------------------------------------------------------------------- Message: 1 Date: Wed, 25 May 2016 16:45:43 -0400 From: Andrey Grodzovsky To: Cc: Alex Deucher , Andrey Grodzovsky , Mykola Lysenko , stable@vger.kernel.org Subject: [PATCH] drm/dp/mst: Always clear proposed vcpi table for port. Message-ID: <1464209143-2148-1-git-send-email-Andrey.Grodzovsky@amd.com> Content-Type: text/plain Not clearing mst manager's proposed vcpis table for destroyed connectors when the manager is stopped leaves it pointing to unrefernced memory, this causes pagefault when the manager is restarted when plugging back a branch. Fixes: 91a25e463130 ("drm/dp/mst: deallocate payload on port destruction") Signed-off-by: Andrey Grodzovsky Reviewed-by: Lyude Cc: stable@vger.kernel.org Cc: Mykola Lysenko Cc: Alex Deucher --- drivers/gpu/drm/drm_dp_mst_topology.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) -- 2.5.5 ------------------------------ Subject: Digest Footer _______________________________________________ dri-devel mailing list dri-devel@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/dri-devel ------------------------------ End of dri-devel Digest, Vol 74, Issue 400 ****************************************** diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c index 9971c46..cd6014b 100644 --- a/drivers/gpu/drm/drm_dp_mst_topology.c +++ b/drivers/gpu/drm/drm_dp_mst_topology.c @@ -2881,11 +2881,9 @@ static void drm_dp_destroy_connector_work(struct work_struct *work) drm_dp_port_teardown_pdt(port, port->pdt); if (!port->input && port->vcpi.vcpi > 0) { - if (mgr->mst_state) { - drm_dp_mst_reset_vcpi_slots(mgr, port); - drm_dp_update_payload_part1(mgr); - drm_dp_mst_put_payload_id(mgr, port->vcpi.vcpi); - } + drm_dp_mst_reset_vcpi_slots(mgr, port); + drm_dp_update_payload_part1(mgr); + drm_dp_mst_put_payload_id(mgr, port->vcpi.vcpi); } kref_put(&port->kref, drm_dp_free_mst_port); -- 1.9.1 ------------------------------ Message: 2 Date: Wed, 25 May 2016 17:01:13 -0400 From: Alex Deucher To: airlied@gmail.com, dri-devel@lists.freedesktop.org Cc: Alex Deucher Subject: [pull] amdgpu drm-next-4.7 Message-ID: <1464210073-2816-1-git-send-email-alexander.deucher@amd.com> Hi Dave, A few fixes and cleanups for amdgpu for 4.7 The following changes since commit 3b59c344ab6e2d00b0f4ad946024572618c87502: drm/amd/powerplay: fix bugs of checking if dpm is running on Tonga (2016-05-18 09:22:30 -0400) are available in the git repository at: git://people.freedesktop.org/~agd5f/linux drm-next-4.7 for you to fetch changes up to 425c452b547622fb728c9ed4fe99c3f2f51d816d: drm/amd: add Kconfig dependency for ACP on DRM_AMDGPU (2016-05-25 09:44:15 -0400) ---------------------------------------------------------------- Jeff Mahoney (1): drm/amd: add Kconfig dependency for ACP on DRM_AMDGPU Mario Kleiner (1): drm/amdgpu: Fix hdmi deep color support. Monk Liu (1): drm/amdgpu: fix bug in fence driver fini Muhammad Falak R Wani (3): drm/amd/powerplay/hwmgr: use kmemdup drm/amd/powerplay/hwmgr: use kmemdup drm/amd/powerplay/hwmgr: use kmemdup drivers/gpu/drm/amd/acp/Kconfig | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c | 10 +++++----- drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c | 2 +- drivers/gpu/drm/amd/powerplay/hwmgr/fiji_hwmgr.c | 6 +++--- drivers/gpu/drm/amd/powerplay/hwmgr/polaris10_hwmgr.c | 6 +++--- drivers/gpu/drm/amd/powerplay/hwmgr/tonga_hwmgr.c | 6 +++--- 6 files changed, 16 insertions(+), 15 deletions(-) ------------------------------ Message: 3 Date: Wed, 25 May 2016 17:04:14 -0400 From: Alex Deucher To: dri-devel@lists.freedesktop.org Cc: Alex Deucher Subject: [PATCH 0/8] scheduler code cleanup Message-ID: <1464210262-2912-1-git-send-email-alexander.deucher@amd.com> Content-Type: text/plain; charset=UTF-8 Just some general cleanup in the GPU scheduler. Christian König (8): drm/amdgpu: fix coding style in the scheduler v2 drm/amdgpu: remove begin_job/finish_job drm/amdgpu: remove duplicated timeout callback drm/amdgpu: fix coding style in amdgpu_job_free drm/amdgpu: remove use_shed hack in job cleanup drm/amdgpu: properly abstract scheduler timeout handling drm/amdgpu: move locking into the functions who need it drm/amdgpu: fix and cleanup job destruction drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 - drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 49 +++++++-------- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 89 ++++++++++++++------------- drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 42 ++++--------- drivers/gpu/drm/amd/scheduler/sched_fence.c | 19 ++---- 6 files changed, 86 insertions(+), 119 deletions(-) -- 2.5.5 ------------------------------ Message: 4 Date: Wed, 25 May 2016 17:04:20 -0400 From: Alex Deucher To: dri-devel@lists.freedesktop.org Cc: Alex Deucher , Christian König Subject: [PATCH 6/8] drm/amdgpu: properly abstract scheduler timeout handling Message-ID: <1464210262-2912-7-git-send-email-alexander.deucher@amd.com> Content-Type: text/plain; charset=UTF-8 From: Christian König The driver shouldn't mess with the scheduler internals. Signed-off-by: Christian König Reviewed-by: Monk.Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 - drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 3 +-- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 15 ++++++++------- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 11 +++++++++-- drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 2 +- 5 files changed, 19 insertions(+), 13 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 6c5ec32..ec42dd5 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -759,7 +759,6 @@ void amdgpu_job_free_func(struct kref *refcount); int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, struct amd_sched_entity *entity, void *owner, struct fence **f); -void amdgpu_job_timeout_func(struct work_struct *work); struct amdgpu_ring { struct amdgpu_device *adev; diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 2bbeeb0..d8cac31 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -839,8 +839,7 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p, p->job = NULL; r = amd_sched_job_init(&job->base, &ring->sched, - entity, amdgpu_job_timeout_func, - amdgpu_job_free_func, + entity, amdgpu_job_free_func, p->filp, &fence); if (r) { amdgpu_job_free(job); diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index be4698b..32132f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -34,13 +34,14 @@ static void amdgpu_job_free_handler(struct work_struct *ws) amd_sched_job_put(&job->base); } -void amdgpu_job_timeout_func(struct work_struct *work) +static void amdgpu_job_timedout(struct amd_sched_job *s_job) { - struct amdgpu_job *job = container_of(work, struct amdgpu_job, base.work_tdr.work); + struct amdgpu_job *job = container_of(s_job, struct amdgpu_job, base); + DRM_ERROR("ring %s timeout, last signaled seq=%u, last emitted seq=%u\n", - job->base.sched->name, - (uint32_t)atomic_read(&job->ring->fence_drv.last_seq), - job->ring->fence_drv.sync_seq); + job->base.sched->name, + atomic_read(&job->ring->fence_drv.last_seq), + job->ring->fence_drv.sync_seq); amd_sched_job_put(&job->base); } @@ -126,8 +127,7 @@ int amdgpu_job_submit(struct amdgpu_job *job, struct amdgpu_ring *ring, return -EINVAL; r = amd_sched_job_init(&job->base, &ring->sched, - entity, amdgpu_job_timeout_func, - amdgpu_job_free_func, owner, &fence); + entity, amdgpu_job_free_func, owner, &fence); if (r) return r; @@ -197,4 +197,5 @@ err: const struct amd_sched_backend_ops amdgpu_sched_ops = { .dependency = amdgpu_job_dependency, .run_job = amdgpu_job_run, + .timedout_job = amdgpu_job_timedout, }; diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index e8ee90f..f2ed8c5 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -362,6 +362,14 @@ static void amd_sched_job_begin(struct amd_sched_job *s_job) } } +static void amd_sched_job_timedout(struct work_struct *work) +{ + struct amd_sched_job *job = container_of(work, struct amd_sched_job, + work_tdr.work); + + job->sched->ops->timedout_job(job); +} + /** * Submit a job to the job queue * @@ -384,7 +392,6 @@ void amd_sched_entity_push_job(struct amd_sched_job *sched_job) int amd_sched_job_init(struct amd_sched_job *job, struct amd_gpu_scheduler *sched, struct amd_sched_entity *entity, - void (*timeout_cb)(struct work_struct *work), void (*free_cb)(struct kref *refcount), void *owner, struct fence **fence) { @@ -397,7 +404,7 @@ int amd_sched_job_init(struct amd_sched_job *job, return -ENOMEM; job->s_fence->s_job = job; - INIT_DELAYED_WORK(&job->work_tdr, timeout_cb); + INIT_DELAYED_WORK(&job->work_tdr, amd_sched_job_timedout); job->free_callback = free_cb; if (fence) diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h index 7e333fa..f0de46c 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h @@ -108,6 +108,7 @@ static inline struct amd_sched_fence *to_amd_sched_fence(struct fence *f) struct amd_sched_backend_ops { struct fence *(*dependency)(struct amd_sched_job *sched_job); struct fence *(*run_job)(struct amd_sched_job *sched_job); + void (*timedout_job)(struct amd_sched_job *sched_job); }; enum amd_sched_priority { @@ -153,7 +154,6 @@ void amd_sched_fence_signal(struct amd_sched_fence *fence); int amd_sched_job_init(struct amd_sched_job *job, struct amd_gpu_scheduler *sched, struct amd_sched_entity *entity, - void (*timeout_cb)(struct work_struct *work), void (*free_cb)(struct kref* refcount), void *owner, struct fence **fence); static inline void amd_sched_job_get(struct amd_sched_job *job) -- 2.5.5 ------------------------------ Message: 5 Date: Wed, 25 May 2016 17:04:16 -0400 From: Alex Deucher To: dri-devel@lists.freedesktop.org Cc: Alex Deucher , Christian König Subject: [PATCH 2/8] drm/amdgpu: remove begin_job/finish_job Message-ID: <1464210262-2912-3-git-send-email-alexander.deucher@amd.com> Content-Type: text/plain; charset=UTF-8 From: Christian König Completely pointless and confusing to use a callback to call into the same code file. Signed-off-by: Christian König Reviewed-by: Monk.Liu Signed-off-by: Alex Deucher --- drivers/gpu/drm/amd/amdgpu/amdgpu_job.c | 2 -- drivers/gpu/drm/amd/scheduler/gpu_scheduler.c | 13 +++++++++---- drivers/gpu/drm/amd/scheduler/gpu_scheduler.h | 6 ------ drivers/gpu/drm/amd/scheduler/sched_fence.c | 10 ---------- 4 files changed, 9 insertions(+), 22 deletions(-) diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c index f0dafa5..001030b 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_job.c @@ -193,6 +193,4 @@ err: const struct amd_sched_backend_ops amdgpu_sched_ops = { .dependency = amdgpu_job_dependency, .run_job = amdgpu_job_run, - .begin_job = amd_sched_job_begin, - .finish_job = amd_sched_job_finish, }; diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index f5ac01db2..821bc89 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -329,7 +329,7 @@ static void amd_sched_free_job(struct fence *f, struct fence_cb *cb) { /* job_finish is called after hw fence signaled, and * the job had already been deleted from ring_mirror_list */ -void amd_sched_job_finish(struct amd_sched_job *s_job) +static void amd_sched_job_finish(struct amd_sched_job *s_job) { struct amd_sched_job *next; struct amd_gpu_scheduler *sched = s_job->sched; @@ -351,7 +351,7 @@ void amd_sched_job_finish(struct amd_sched_job *s_job) } } -void amd_sched_job_begin(struct amd_sched_job *s_job) +static void amd_sched_job_begin(struct amd_sched_job *s_job) { struct amd_gpu_scheduler *sched = s_job->sched; @@ -461,7 +461,7 @@ static void amd_sched_process_job(struct fence *f, struct fence_cb *cb) /* remove job from ring_mirror_list */ spin_lock_irqsave(&sched->job_list_lock, flags); list_del_init(&s_fence->s_job->node); - sched->ops->finish_job(s_fence->s_job); + amd_sched_job_finish(s_fence->s_job); spin_unlock_irqrestore(&sched->job_list_lock, flags); amd_sched_fence_signal(s_fence); @@ -475,6 +475,7 @@ static int amd_sched_main(void *param) { struct sched_param sparam = {.sched_priority = 1}; struct amd_gpu_scheduler *sched = (struct amd_gpu_scheduler *)param; + unsigned long flags; int r, count; sched_setscheduler(current, SCHED_FIFO, &sparam); @@ -499,7 +500,11 @@ static int amd_sched_main(void *param) s_fence = sched_job->s_fence; atomic_inc(&sched->hw_rq_count); - amd_sched_job_pre_schedule(sched, sched_job); + spin_lock_irqsave(&sched->job_list_lock, flags); + list_add_tail(&sched_job->node, &sched->ring_mirror_list); + amd_sched_job_begin(sched_job); + spin_unlock_irqrestore(&sched->job_list_lock, flags); + fence = sched->ops->run_job(sched_job); amd_sched_fence_scheduled(s_fence); if (fence) { diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h index 690ae4b..69840d7 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.h @@ -110,8 +110,6 @@ static inline struct amd_sched_fence *to_amd_sched_fence(struct fence *f) struct amd_sched_backend_ops { struct fence *(*dependency)(struct amd_sched_job *sched_job); struct fence *(*run_job)(struct amd_sched_job *sched_job); - void (*begin_job)(struct amd_sched_job *sched_job); - void (*finish_job)(struct amd_sched_job *sched_job); }; enum amd_sched_priority { @@ -160,10 +158,6 @@ int amd_sched_job_init(struct amd_sched_job *job, void (*timeout_cb)(struct work_struct *work), void (*free_cb)(struct kref* refcount), void *owner, struct fence **fence); -void amd_sched_job_pre_schedule(struct amd_gpu_scheduler *sched , - struct amd_sched_job *s_job); -void amd_sched_job_finish(struct amd_sched_job *s_job); -void amd_sched_job_begin(struct amd_sched_job *s_job); static inline void amd_sched_job_get(struct amd_sched_job *job) { if (job) diff --git a/drivers/gpu/drm/amd/scheduler/sched_fence.c b/drivers/gpu/drm/amd/scheduler/sched_fence.c index 6bdc9b7..71931bc 100644 --- a/drivers/gpu/drm/amd/scheduler/sched_fence.c +++ b/drivers/gpu/drm/amd/scheduler/sched_fence.c @@ -58,16 +58,6 @@ void amd_sched_fence_signal(struct amd_sched_fence *fence) FENCE_TRACE(&fence->base, "was already signaled\n"); } -void amd_sched_job_pre_schedule(struct amd_gpu_scheduler *sched , - struct amd_sched_job *s_job) -{ - unsigned long flags; - spin_lock_irqsave(&sched->job_list_lock, flags); - list_add_tail(&s_job->node, &sched->ring_mirror_list); - sched->ops->begin_job(s_job); - spin_unlock_irqrestore(&sched->job_list_lock, flags); -} - void amd_sched_fence_scheduled(struct amd_sched_fence *s_fence) { struct fence_cb *cur, *tmp;