From patchwork Fri Dec 1 16:04:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Lucas Stach X-Patchwork-Id: 10087391 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 B65916035E for ; Fri, 1 Dec 2017 16:04:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A739029BF2 for ; Fri, 1 Dec 2017 16:04:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9B0712A19E; Fri, 1 Dec 2017 16:04:19 +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.2 required=2.0 tests=BAYES_00, 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 124D529BF2 for ; Fri, 1 Dec 2017 16:04:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 974236ED90; Fri, 1 Dec 2017 16:04:17 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.ORG Delivered-To: dri-devel@lists.freedesktop.ORG Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by gabe.freedesktop.org (Postfix) with ESMTPS id 763A36ED91 for ; Fri, 1 Dec 2017 16:04:16 +0000 (UTC) Received: from weser.hi.pengutronix.de ([2001:67c:670:100:fa0f:41ff:fe58:4010]) by metis.ext.pengutronix.de with esmtp (Exim 4.84_2) (envelope-from ) id 1eKnnP-00042w-20; Fri, 01 Dec 2017 17:04:11 +0100 Message-ID: <1512144250.17442.41.camel@pengutronix.de> Subject: Re: [PATCH 0/2] Move scheduler out of AMDGPU From: Lucas Stach To: Christian =?ISO-8859-1?Q?K=F6nig?= , Alex Deucher Date: Fri, 01 Dec 2017 17:04:10 +0100 In-Reply-To: <7a884709-8717-cf45-152d-60bf8cb0f7e2@amd.com> References: <20171201152901.3626-1-l.stach@pengutronix.de> <7a884709-8717-cf45-152d-60bf8cb0f7e2@amd.com> X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 X-SA-Exim-Connect-IP: 2001:67c:670:100:fa0f:41ff:fe58:4010 X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: dri-devel@lists.freedesktop.org Cc: David Airlie , amd-gfx@lists.freedesktop.org, patchwork-lst@pengutronix.de, dri-devel@lists.freedesktop.org, kernel@pengutronix.de 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 Am Freitag, den 01.12.2017, 16:55 +0100 schrieb Christian König: > Am 01.12.2017 um 16:28 schrieb Lucas Stach: > > Hi all, > > > > so this is the first step to make the marvelous AMDGPU scheduler > > useable > > for other drivers. I have a (mostly) working prototype of Etnaviv > > using > > the scheduler, but those patches need to keep baking for a while. > > > > I'm sending this out as I want to avoid rebasing this change too > > much > > and don't want to take people by surprise when the Etnaviv > > implementation > > surfaces. Also this might need some coordination between AMDGPU and > > Etnaviv, which might be good to get going now. > > > > Please speak up now if you have any objections or comments. > > Looks good to me, but question is what is this based upon? > > I strongly assume drm-next, so question is now if we have any > patches  > inside amd branches we should apply before doing this. For now this is based on 4.15-rc1, where the only difference to drm- next in the scheduler code is currently this: ------------------------------------>8------------------------------ --------------------------------------->8------------------------------ I'm fine with rebasing this on whatever AMDGPU guys prefer, but this requires a stable branch with all relevant patches included, so we can use this as a synchronization point for the move. > CCing Andrey as well cause he has some tasks assigned around the  > scheduler as well. Thanks, Lucas diff --git a/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h b/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h index 8bd38102b58e..283a0dc25e84 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h +++ b/drivers/gpu/drm/amd/scheduler/gpu_sched_trace.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0 */ #if !defined(_GPU_SCHED_TRACE_H) || defined(TRACE_HEADER_MULTI_READ) #define _GPU_SCHED_TRACE_H_ diff --git a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c index e4d3b4ec4e92..92ec663fdada 100644 --- a/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c +++ b/drivers/gpu/drm/amd/scheduler/gpu_scheduler.c @@ -188,7 +188,7 @@ static bool amd_sched_entity_is_ready(struct amd_sched_entity *entity) if (kfifo_is_empty(&entity->job_queue)) return false; - if (ACCESS_ONCE(entity->dependency)) + if (READ_ONCE(entity->dependency)) return false; return true;