Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp975016rdh; Fri, 27 Oct 2023 00:32:56 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEezS74kCU5vW2NsJ9bWofiPj3cWB520sIqLrrQy7JIijrmJW5bYlzGHVSrUE6Rts70SwjC X-Received: by 2002:a81:c608:0:b0:5ac:fe2d:5edf with SMTP id l8-20020a81c608000000b005acfe2d5edfmr1555250ywi.44.1698391976335; Fri, 27 Oct 2023 00:32:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698391976; cv=none; d=google.com; s=arc-20160816; b=eYiNHEO/ydq4jCUc7Mt2ZKyoEkBTAk4M6Tr8KKj3dEHehK5XMXSRhz0ijCkwEsbnAa cr7kckuFA5oZor2M7Sp0yOXsQfsJXwdY1Ye5fcJtceMFa+j64dKV3MaoZZQPVzQVQLFT ahMW5Gt4bcnI7EmWwNcKoNcmYw7iAFoG6Ctq3oBjRM73i/SmSvQ+MOIi3IB/5u203J4u lEsL+OO2S8Y9ppua4WsbKrtQ02hImg2jPtp8h8t14WAqEzlh8wx1+uPCmx803rAgF7Xi l3PhkngpjaoHwt6DL7YDa15X7RaW/pseXXwhjelv7OdkKvprIB6CuRg2kI8n7kYxBWxS qAgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=XuoPirElAFT3lBOj8RPU9UlzhmvS5afC7pvzewfG8fA=; fh=vrgJW1VhCPqPLEEDQsxZRhOMLzx0mp7pBNPGhI6Xs/M=; b=JlmNrKQXjSurXxL6iNBdQ5KTlTM5OnI2k0VYP82H6SOrYgMjQNAFMcoRTt0Mb99hDz ZTfFpbVCQhP1murvsIBU6uzP2nOKl0uA2hum55AXcAOyi56Qrrcg5qd+8eoVlp9FCvvX zlT3FrLTpLmgGweyE50+dNUfO9xrBLIwbOgBg9m02b6IsnfuiO2k37iiVws2AlWbv/eX 36pcXEQ0VLOQMYgAPp7exNAVe6QBtUOvTJaYb5QJ/0m6J421U90s4ae+n51TUN9yGrln QTS0XpXbNfkFgI063JY6bHKwavohEAVPFS7VWSHCqAch2lX68eVjgiS7QEbs8Gjpr4a4 wiVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nYJxY9We; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Return-Path: Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id x22-20020a0dd516000000b0059f4fa06dd0si1884925ywd.241.2023.10.27.00.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 00:32:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=nYJxY9We; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=collabora.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 240EF8093403; Fri, 27 Oct 2023 00:32:53 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345289AbjJ0Hcq (ORCPT + 99 others); Fri, 27 Oct 2023 03:32:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47074 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234963AbjJ0Hcp (ORCPT ); Fri, 27 Oct 2023 03:32:45 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e5ab]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E0A8194 for ; Fri, 27 Oct 2023 00:32:43 -0700 (PDT) Received: from localhost (cola.collaboradmins.com [195.201.22.229]) (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 665FF66071F1; Fri, 27 Oct 2023 08:32:41 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1698391962; bh=wGt/lbRhILEM/Rjvh2nvIQRBqSqGnGIxsj9ivcKhlzc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=nYJxY9WejYkwmG4ZvP0Zn13pCis9iFzrc8E0HpRbXL+qP+u2lSvyT62zywoc4+wtf rJCdpJ571jfrrMkpMeH9TUPEuTF2QOYKTHjgK4ZzZbJYwtf8xSB85WOs+jgguzFLSl pxLSVSoFe6uDGukJsC1W/gqpzpByVLKzf5HDk5ghilAwt7u9eEn6J909tHzf1p9DQZ OTjH2agoeT4dwy6fQ5P14szKlKreBHjI0YBtOb8aU/9ZqMRmFFgq5YOppRmKcN5QTr 0pDTCvE317JIZcyoPZx+FZgtSRrThrvenTk8rCh3Z7vX2rYg0rXlZ8twcHh/cvTClQ D/UifR+slyAag== Date: Fri, 27 Oct 2023 09:32:38 +0200 From: Boris Brezillon To: Christian =?UTF-8?B?S8O2bmln?= Cc: Danilo Krummrich , airlied@gmail.com, daniel@ffwll.ch, matthew.brost@intel.com, faith@gfxstrand.net, luben.tuikov@amd.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH drm-misc-next v3] drm/sched: implement dynamic job-flow control Message-ID: <20231027093238.2ff8172e@collabora.com> In-Reply-To: <0bc79ae3-04fe-4e85-9fd0-e8b281148390@amd.com> References: <20231026161431.5934-1-dakr@redhat.com> <0bc79ae3-04fe-4e85-9fd0-e8b281148390@amd.com> Organization: Collabora X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 00:32:53 -0700 (PDT) On Fri, 27 Oct 2023 09:22:12 +0200 Christian K=C3=B6nig wrote: > > + > > + /** > > + * @update_job_credits: Called once the scheduler is considering this > > + * job for execution. > > + * > > + * Drivers may use this to update the job's submission credits, which= is > > + * useful to e.g. deduct the number of native fences which have been > > + * signaled meanwhile. > > + * > > + * The callback must either return the new number of submission credi= ts > > + * for the given job, or zero if no update is required. > > + * > > + * This callback is optional. > > + */ > > + u32 (*update_job_credits)(struct drm_sched_job *sched_job); =20 >=20 > Why do we need an extra callback for this? >=20 > Just document that prepare_job() is allowed to reduce the number of=20 > credits the job might need. ->prepare_job() is called only once if the returned fence is NULL, but we need this credit-update to happen every time a job is considered for execution by the scheduler. If you're saying this control-flow should be implemented with a dma_fence that's signaled when enough space is available, I fear Danilo's work won't be that useful to the PowerVR driver, unfortunately.