Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-04-14 Thread Philipp Stanner
On Wed, 2025-04-09 at 16:04 +0200, Philipp Stanner wrote: > +Cc Matthew > > On Wed, 2025-04-09 at 15:55 +0200, Christian König wrote: > > Am 09.04.25 um 12:28 schrieb Philipp Stanner: > > > On Fri, 2025-03-21 at 16:58 +0100, Christian König wrote: > > > > Sometimes drivers need to be able to submi

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-04-09 Thread Philipp Stanner
+Cc Matthew On Wed, 2025-04-09 at 15:55 +0200, Christian König wrote: > Am 09.04.25 um 12:28 schrieb Philipp Stanner: > > On Fri, 2025-03-21 at 16:58 +0100, Christian König wrote: > > > Sometimes drivers need to be able to submit multiple jobs which > > > depend on > > > each other to different sc

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-04-09 Thread Christian König
Am 09.04.25 um 12:28 schrieb Philipp Stanner: > On Fri, 2025-03-21 at 16:58 +0100, Christian König wrote: >> Sometimes drivers need to be able to submit multiple jobs which >> depend on >> each other to different schedulers at the same time, but using >> drm_sched_job_add_dependency() can't fail an

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-04-09 Thread Philipp Stanner
On Fri, 2025-03-21 at 16:58 +0100, Christian König wrote: > Sometimes drivers need to be able to submit multiple jobs which > depend on > each other to different schedulers at the same time, but using > drm_sched_job_add_dependency() can't fail any more after the first > job is > initialized. > >

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-04-04 Thread Christian König
Am 21.03.25 um 09:20 schrieb Philipp Stanner: > On Thu, 2025-03-20 at 11:49 +, Tvrtko Ursulin wrote: >> On 19/03/2025 11:23, Christian König wrote: > + * > + * Return: > + * 0 on success, or an error on failing to expand the array. > + */ > +int drm_sched_job_prealloc_depend

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-03-24 Thread Christian König
Am 24.03.25 um 09:35 schrieb Tvrtko Ursulin: > > On 21/03/2025 15:58, Christian König wrote: >> Sometimes drivers need to be able to submit multiple jobs which depend on >> each other to different schedulers at the same time, but using >> drm_sched_job_add_dependency() can't fail any more after the

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-03-24 Thread Christian König
Am 21.03.25 um 19:05 schrieb Philipp Stanner: > On Fri, 2025-03-21 at 16:58 +0100, Christian König wrote: >> Sometimes drivers need to be able to submit multiple jobs which >> depend on >> each other to different schedulers at the same time, but using >> drm_sched_job_add_dependency() can't fail an

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-03-24 Thread Tvrtko Ursulin
On 21/03/2025 15:58, Christian König wrote: Sometimes drivers need to be able to submit multiple jobs which depend on each other to different schedulers at the same time, but using drm_sched_job_add_dependency() can't fail any more after the first job is initialized. This function preallocate

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-03-21 Thread Philipp Stanner
On Fri, 2025-03-21 at 16:58 +0100, Christian König wrote: > Sometimes drivers need to be able to submit multiple jobs which > depend on > each other to different schedulers at the same time, but using > drm_sched_job_add_dependency() can't fail any more after the first > job is > initialized. > >

[PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots v2

2025-03-21 Thread Christian König
Sometimes drivers need to be able to submit multiple jobs which depend on each other to different schedulers at the same time, but using drm_sched_job_add_dependency() can't fail any more after the first job is initialized. This function preallocate memory for dependency slots so that no ENOMEM ca

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-21 Thread Philipp Stanner
On Thu, 2025-03-20 at 11:49 +, Tvrtko Ursulin wrote: > > On 19/03/2025 11:23, Christian König wrote: > > > > + * > > > > + * Return: > > > > + * 0 on success, or an error on failing to expand the array. > > > > + */ > > > > +int drm_sched_job_prealloc_dependency_slots(struct > > > > drm_sched_

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-20 Thread Tvrtko Ursulin
On 19/03/2025 11:23, Christian König wrote: + * + * Return: + * 0 on success, or an error on failing to expand the array. + */ +int drm_sched_job_prealloc_dependency_slots(struct drm_sched_job *job, +     unsigned int num_deps) +{ + struct dma_fence *

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-19 Thread Christian König
>> + * >> + * Return: >> + * 0 on success, or an error on failing to expand the array. >> + */ >> +int drm_sched_job_prealloc_dependency_slots(struct drm_sched_job >> *job, >> +    unsigned int num_deps) >> +{ >> +struct dma_fence *fence; >> +u32 id = 0;

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-19 Thread Christian König
Am 18.03.25 um 13:39 schrieb Danilo Krummrich: > On Tue, Mar 18, 2025 at 01:03:12PM +0100, Christian König wrote: >> /** >> * drm_sched_job_add_dependency - adds the fence as a job dependency >> * @job: scheduler job to add the dependencies to >> @@ -878,10 +910,12 @@ int drm_sched_job_add_dep

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-18 Thread Tvrtko Ursulin
On 18/03/2025 12:03, Christian König wrote: The problem is that drivers sometimes need to add dependencies without allocating any memory. Add a function which preallocates slots by inserting signaled stub fences into the dependency array. Signed-off-by: Christian König --- drivers/gpu/drm/

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-18 Thread Philipp Stanner
On Tue, 2025-03-18 at 13:03 +0100, Christian König wrote: > The problem is that drivers sometimes need to add dependencies > without > allocating any memory. > > Add a function which preallocates slots by inserting signaled stub > fences > into the dependency array. I think I get what you're doin

Re: [PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-18 Thread Danilo Krummrich
On Tue, Mar 18, 2025 at 01:03:12PM +0100, Christian König wrote: > /** > * drm_sched_job_add_dependency - adds the fence as a job dependency > * @job: scheduler job to add the dependencies to > @@ -878,10 +910,12 @@ int drm_sched_job_add_dependency(struct drm_sched_job > *job, >* engi

[PATCH 1/2] drm/sched: add drm_sched_prealloc_dependency_slots

2025-03-18 Thread Christian König
The problem is that drivers sometimes need to add dependencies without allocating any memory. Add a function which preallocates slots by inserting signaled stub fences into the dependency array. Signed-off-by: Christian König --- drivers/gpu/drm/scheduler/sched_main.c | 41 +