From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7BD18C7EE29 for ; Tue, 13 Jun 2023 09:46:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id CC94110E362; Tue, 13 Jun 2023 09:46:17 +0000 (UTC) Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by gabe.freedesktop.org (Postfix) with ESMTPS id C89B710E357 for ; Tue, 13 Jun 2023 09:46:15 +0000 (UTC) Received: from localhost (unknown [IPv6:2a01:e0a:2c:6930:5cf4:84a1:2763:fe0d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bbrezillon) by madras.collabora.co.uk (Postfix) with ESMTPSA id 269196606F02; Tue, 13 Jun 2023 10:46:14 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1686649574; bh=lZqQFMyareOe6OvViczKYe5GS2s6xKP3KTvSq806QXg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IivQOF4OEwPLvGND6J9pvLacvI7FbLafTD6EZ0TEk4ifzHyPsRmAGmYukaozKcPSG hjU5S6OamNKUl2sYAXv2UdEZSeJUZcrqcVwvqP62vB/wtOqArRr5QnsnKjxabem2X+ +qzNP/tT5ISEIUqnogARvFZ86L/56fhSfTXp4T9Nts6OllUoVYjpm8cKktAQJDnQpZ niobGup8QvSUAH6EFmBGKsiSMOMInQ0efBGPDykbaksFJ3ooBZ6XEINcfxYN1fAosv vGHr6MBXwnusgoQoFcVk2WsODB+stJJ6Jv2RdvXAHv14AgrUz9km7x6UDJtPH7Bp5q VrTz54efWNzfA== Date: Tue, 13 Jun 2023 11:46:11 +0200 From: Boris Brezillon To: dri-devel@lists.freedesktop.org Subject: Re: [PATCH] drm/sched: Call drm_sched_fence_set_parent() from drm_sched_fence_scheduled() Message-ID: <20230613114611.11402411@collabora.com> In-Reply-To: <20230613094424.2176746-1-boris.brezillon@collabora.com> References: <20230613094424.2176746-1-boris.brezillon@collabora.com> Organization: Collabora X-Mailer: Claws Mail 4.1.1 (GTK 3.24.37; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Sarah Walker , Christian =?UTF-8?B?S8O2bmln?= , Luben Tuikov , Donald Robson , Sumit Semwal Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" On Tue, 13 Jun 2023 11:44:24 +0200 Boris Brezillon wrote: > Drivers that can delegate waits to the firmware/GPU pass the scheduled > fence to drm_sched_job_add_dependency(), and issue wait commands to > the firmware/GPU at job submission time. For this to be possible, they > need all their 'native' dependencies to have a valid parent since this > is where the actual HW fence information are encoded. > > In drm_sched_main(), we currently call drm_sched_fence_set_parent() > after drm_sched_fence_set_parent(), leaving a short period of time after drm_sched_fence_scheduled(), ... > during which the job depending on this fence can be submitted. > > Since setting parent and signaling the fence are two things that are > kinda related (you can't have a parent if the job hasn't been scheduled), > it probably makes sense to pass the parent fence to > drm_sched_fence_scheduled() and let it call drm_sched_fence_set_parent() > before it signals the scheduled fence.