Re: [PATCH v4 5/7] drm/panfrost: Add a new ioctl to submit batches

2021-07-26 Thread Boris Brezillon
On Thu, 8 Jul 2021 14:10:45 +0200 Christian König wrote: > >> --- a/drivers/gpu/drm/panfrost/panfrost_job.c > >> +++ b/drivers/gpu/drm/panfrost/panfrost_job.c > >> @@ -254,6 +254,9 @@ static int panfrost_acquire_object_fences(struct > >> panfrost_job *job) > >>return

Re: [PATCH v4 00/18] drm/sched dependency tracking and dma-resv fixes

2021-07-27 Thread Boris Brezillon
lcome, as usual. > > Cheers, Daniel > > Daniel Vetter (18): > drm/sched: Split drm_sched_job_init > drm/sched: Barriers are needed for entity->last_scheduled > drm/sched: Add dependency tracking > drm/sched: drop entity parameter from drm_sched_push_job > drm/s

Re: [RFC PATCH 0/7] drm/panfrost: Add a new submit ioctl

2021-03-12 Thread Boris Brezillon
On Thu, 11 Mar 2021 12:16:33 + Steven Price wrote: > Also the current code completely ignores PANFROST_BO_REF_READ. So either > that should be defined as 0, or even better we support 3 modes: > > * Exclusive ('write' access) > * Shared ('read' access) > * No fence - ensures the BO is

Re: [RFC PATCH 0/7] drm/panfrost: Add a new submit ioctl

2021-03-12 Thread Boris Brezillon
On Fri, 12 Mar 2021 09:37:49 -0600 Jason Ekstrand wrote: > On Fri, Mar 12, 2021 at 1:31 AM Boris Brezillon > wrote: > > > > On Thu, 11 Mar 2021 12:11:48 -0600 > > Jason Ekstrand wrote: > > > > > > > > > > 2/ Queued

Re: [RFC PATCH 0/7] drm/panfrost: Add a new submit ioctl

2021-03-12 Thread Boris Brezillon
On Fri, 12 Mar 2021 19:25:13 +0100 Boris Brezillon wrote: > > So where does this leave us? Well, it depends on your submit model > > and exactly how you handle pipeline barriers that sync between > > engines. If you're taking option 3 above and doing two comma

[PATCH 0/3] drm/panfrost: MMU fixes

2021-02-01 Thread Boris Brezillon
discussing the first issue with Steve or Robin a while back, but we never hit it before (now we do :)). The last patch is a perf improvement: no need to re-enable hardware interrupts if we know the threaded irq handler will be woken up right away. Regards, Boris Boris Brezillon (3): drm/panfrost

[PATCH 2/3] drm/panfrost: Don't try to map pages that are already mapped

2021-02-01 Thread Boris Brezillon
heap allocations") Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 904d63450862..21e552d1ac71 100644 ---

[PATCH 1/3] drm/panfrost: Clear MMU irqs before handling the fault

2021-02-01 Thread Boris Brezillon
t for GPU heap allocations") Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 7c1b3481b785..904d63450

[PATCH 3/3] drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs

2021-02-01 Thread Boris Brezillon
Doing a hw-irq -> threaded-irq round-trip is counter-productive, stay in the threaded irq handler as long as we can. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 7 +++ 1 file changed, 7 insertions(+) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c

Re: [PATCH 3/3] drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs

2021-02-01 Thread Boris Brezillon
On Mon, 1 Feb 2021 12:13:49 + Steven Price wrote: > On 01/02/2021 08:21, Boris Brezillon wrote: > > Doing a hw-irq -> threaded-irq round-trip is counter-productive, stay > > in the threaded irq handler as long as we can. > > > > Signed-off-by: Boris Brezillon

Re: [PATCH 3/3] drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs

2021-02-01 Thread Boris Brezillon
On Mon, 1 Feb 2021 13:24:00 + Steven Price wrote: > On 01/02/2021 12:59, Boris Brezillon wrote: > > On Mon, 1 Feb 2021 12:13:49 + > > Steven Price wrote: > > > >> On 01/02/2021 08:21, Boris Brezillon wrote: > >>> Doing a hw-irq -> thread

[PATCH v2 0/3] drm/panfrost: MMU fixes

2021-02-05 Thread Boris Brezillon
handling loop to avoid a goto Boris Brezillon (3): drm/panfrost: Clear MMU irqs before handling the fault drm/panfrost: Don't try to map pages that are already mapped drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs drivers/gpu/drm/panfrost/panf

[PATCH v2 1/3] drm/panfrost: Clear MMU irqs before handling the fault

2021-02-05 Thread Boris Brezillon
t for GPU heap allocations") Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_m

[PATCH v2 3/3] drm/panfrost: Stay in the threaded MMU IRQ handler until we've handled all IRQs

2021-02-05 Thread Boris Brezillon
Doing a hw-irq -> threaded-irq round-trip is counter-productive, stay in the threaded irq handler as long as we can. v2: * Rework the loop to avoid a goto Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 26 + 1 file changed, 14 inserti

[PATCH v2 2/3] drm/panfrost: Don't try to map pages that are already mapped

2021-02-05 Thread Boris Brezillon
heap allocations") Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfrost_mmu.c index 90

Re: [PATCH v2 0/3] drm/panfrost: MMU fixes

2021-02-15 Thread Boris Brezillon
On Fri, 5 Feb 2021 12:17:54 +0100 Boris Brezillon wrote: > Hello, > > Here are 2 fixes and one improvement for the page fault handling. Those > bugs were found while working on indirect draw supports which requires > the allocation of a big heap buffer for varyings, and t

Re: [PATCH] drm/shmem-helper: Don't remove the offset in vm_area_struct pgoff

2021-02-22 Thread Boris Brezillon
> >>> fs_reclaim shrinker annotations, which means you don't have lockdep > > >>> checks. I think at least, would need some deadlock and testing. > > >> > > >> The big problem with this sort of method for triggering the shrinkers is > >

[RFC PATCH 0/7] drm/panfrost: Add a new submit ioctl

2021-03-11 Thread Boris Brezillon
I'm just trying to collect feedback. I don't intend to get those patches merged until we have a userspace user, but I thought starting the discussion early would be a good thing. Feel free to suggest other approaches. Regards, Boris Boris Brezillon (7): drm/panfrost: Pass a job

[RFC PATCH 3/7] drm/panfrost: Move the mappings collection out of panfrost_lookup_bos()

2021-03-11 Thread Boris Brezillon
So we can re-use it from elsewhere. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 52 ++--- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index

[RFC PATCH 2/7] drm/panfrost: Collect implicit and explicit deps in an XArray

2021-03-11 Thread Boris Brezillon
This way we can re-use the standard drm_gem_fence_array_add_implicit() helper and simplify the panfrost_job_dependency() logic. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 42 +++--- drivers/gpu/drm/panfrost/panfrost_job.c | 57

[RFC PATCH 4/7] drm/panfrost: Add BO access flags to relax dependencies between jobs

2021-03-11 Thread Boris Brezillon
Jobs reading from the same BO should not be serialized. Add access flags so we can relax the implicit dependencies in that case. We force RW access for now to keep the behavior unchanged, but a new SUBMIT ioctl taking explicit access flags will be introduced. Signed-off-by: Boris Brezillon

[RFC PATCH 7/7] drm/panfrost: Bump minor version to reflect the feature additions

2021-03-11 Thread Boris Brezillon
We now have a new ioctl that allows submitting multiple jobs at once (among other things) and we support timelined syncobjs. Bump the minor version number to reflect those changes. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 3 ++- 1 file changed, 2 insertions

[RFC PATCH 6/7] drm/panfrost: Advertise the SYNCOBJ_TIMELINE feature

2021-03-11 Thread Boris Brezillon
Now that we have a new SUBMIT ioctl dealing with timelined syncojbs we can advertise the feature. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers

[RFC PATCH 1/7] drm/panfrost: Pass a job to panfrost_{acquire, attach_object_fences}()

2021-03-11 Thread Boris Brezillon
So we don't have to change the prototype if we extend the function. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_job.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gp

[RFC PATCH 5/7] drm/panfrost: Add a new ioctl to submit batches

2021-03-11 Thread Boris Brezillon
This should help limit the number of ioctls when submitting multiple jobs. The new ioctl also supports syncobj timelines and BO access flags. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 303 include/uapi/drm/panfrost_drm.h | 79

Re: [RFC PATCH 0/7] drm/panfrost: Add a new submit ioctl

2021-03-11 Thread Boris Brezillon
Hi Steven, On Thu, 11 Mar 2021 12:16:33 + Steven Price wrote: > On 11/03/2021 09:25, Boris Brezillon wrote: > > Hello, > > > > I've been playing with Vulkan lately and struggled quite a bit to > > implement VkQueueSubmit with the submit ioctl we have. There

Re: [RFC PATCH 0/7] drm/panfrost: Add a new submit ioctl

2021-03-11 Thread Boris Brezillon
Hi Jason, On Thu, 11 Mar 2021 10:58:46 -0600 Jason Ekstrand wrote: > Hi all, > > Dropping in where I may or may not be wanted to feel free to ignore. : -) I'm glad you decided to chime in. :-) > > > > 2/ Queued jobs might be executed out-of-order (unless they have > > > > explicit/impli

Re: [RFC PATCH 0/7] drm/panfrost: Add a new submit ioctl

2021-03-11 Thread Boris Brezillon
On Thu, 11 Mar 2021 12:11:48 -0600 Jason Ekstrand wrote: > > > > > > 2/ Queued jobs might be executed out-of-order (unless they have > > > > > > explicit/implicit deps between them), and Vulkan asks that the > > > > > > out > > > > > > fence be signaled when all jobs are done. Timeline s

[PATCH] drm/panfrost: Fix the panfrost_mmu_map_fault_addr() error path

2021-05-21 Thread Boris Brezillon
Make sure all bo->base.pages entries are either NULL or pointing to a valid page before calling drm_gem_shmem_put_pages(). Reported-by: Tomeu Vizoso Cc: Fixes: 187d2929206e ("drm/panfrost: Add support for GPU heap allocations") Signed-off-by: Boris Brezillon --- drivers/gpu

Re: [PATCH v5] drm/bridge: tfp410: Set input_bus_flags in atomic_check

2020-12-04 Thread Boris Brezillon
On Thu, 3 Dec 2020 18:20:48 +0530 Nikhil Devshatwar wrote: > input_bus_flags are specified in drm_bridge_timings (legacy) as well > as drm_bridge_state->input_bus_cfg.flags > > The flags from the timings will be deprecated. Bridges are supposed > to validate and set the bridge state flags from a

Re: [PATCH v4 4/7] drm/bridge: mhdp8546: Set input_bus_flags from atomic_check

2020-12-04 Thread Boris Brezillon
On Tue, 1 Dec 2020 17:48:27 +0530 Nikhil Devshatwar wrote: > input_bus_flags are specified in drm_bridge_timings (legacy) as well > as drm_bridge_state->input_bus_cfg.flags > > The flags from the timings will be deprecated. Bridges are supposed > to validate and set the bridge state flags from a

Re: [PATCH v4 3/7] drm/bridge: mhdp8546: Add minimal format negotiation

2020-12-04 Thread Boris Brezillon
On Tue, 1 Dec 2020 17:48:26 +0530 Nikhil Devshatwar wrote: > With new connector model, mhdp bridge will not create the connector and > SoC driver will rely on format negotiation to setup the encoder format. > > Support minimal format negotiations hooks in the drm_bridge_funcs. > Complete format

Re: [PATCH v4 4/7] drm/bridge: mhdp8546: Set input_bus_flags from atomic_check

2020-12-04 Thread Boris Brezillon
On Tue, 1 Dec 2020 17:48:27 +0530 Nikhil Devshatwar wrote: > input_bus_flags are specified in drm_bridge_timings (legacy) as well > as drm_bridge_state->input_bus_cfg.flags > > The flags from the timings will be deprecated. Bridges are supposed > to validate and set the bridge state flags from a

Re: [PATCH v4 5/7] drm/tidss: Set bus_format correctly from bridge/connector

2020-12-04 Thread Boris Brezillon
On Tue, 1 Dec 2020 17:48:28 +0530 Nikhil Devshatwar wrote: > Remove the old code to iterate over the bridge chain, as this is > already done by the framework. > The bridge state should have the negotiated bus format and flags. > Use these from the bridge's state. > If the bridge does not support

Re: [PATCH v4 5/7] drm/tidss: Set bus_format correctly from bridge/connector

2020-12-04 Thread Boris Brezillon
On Fri, 4 Dec 2020 12:56:27 +0200 Tomi Valkeinen wrote: > Hi Boris, > > On 04/12/2020 12:50, Boris Brezillon wrote: > > On Tue, 1 Dec 2020 17:48:28 +0530 > > Nikhil Devshatwar wrote: > > > >> Remove the old code to iterate over the bridge chain, as this i

Re: [PATCH v4 5/7] drm/tidss: Set bus_format correctly from bridge/connector

2020-12-04 Thread Boris Brezillon
On Fri, 4 Dec 2020 13:47:05 +0200 Tomi Valkeinen wrote: > On 04/12/2020 13:12, Boris Brezillon wrote: > > >>> That'd be even better if you implement the bridge interface instead of > >>> the encoder one so we can get rid of the encoder_{helper}_funcs an

[PATCH v5 01/16] drm/sched: Document what the timedout_job method should do

2021-06-29 Thread Boris Brezillon
The documentation is a bit vague and doesn't really describe what the ->timedout_job() is expected to do. Let's add a few more details. v5: * New patch Suggested-by: Daniel Vetter Signed-off-by: Boris Brezillon --- include/drm/gpu_scheduler.h | 14 ++ 1 file changed,

[PATCH v5 00/16] drm/panfrost: Misc improvements

2021-06-29 Thread Boris Brezillon
see each commit for a detailed changelog) and collect R-b/A-b tags Regards, Boris Boris Brezillon (15): drm/sched: Document what the timedout_job method should do drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr drm/panfrost: Make ->run_job() return an ERR

[PATCH v5 03/16] drm/panfrost: Make ->run_job() return an ERR_PTR() when appropriate

2021-06-29 Thread Boris Brezillon
If the fence creation fail, we can return the error pointer directly. The core will update the fence error accordingly. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_job.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v5 02/16] drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr

2021-06-29 Thread Boris Brezillon
() method v3: * New patch v4: * Actually use the timeout_wq to queue the timeout work Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Lucas Stach Cc: Qiang Yu Cc: Emma Anholt Cc: Alex Deucher Cc: "Christian König" --- drivers/gpu/drm/amd/amdgpu/amdgpu_fe

[PATCH v5 09/16] drm/panfrost: Simplify the reset serialization logic

2021-06-29 Thread Boris Brezillon
executing and cancel_work_sync() will wait for the handler to return. Checking the reset pending status should avoid spurious resets v3: * New patch Suggested-by: Daniel Vetter Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.h | 6 +

[PATCH v5 07/16] drm/panfrost: Expose a helper to trigger a GPU reset

2021-06-29 Thread Boris Brezillon
Expose a helper to trigger a GPU reset so we can easily trigger reset operations outside the job timeout handler. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_device.h | 8 drivers/gpu/drm/panfrost

[PATCH v5 12/16] drm/panfrost: Reset the GPU when the AS_ACTIVE bit is stuck

2021-06-29 Thread Boris Brezillon
Things are unlikely to resolve until we reset the GPU. Let's not wait for other faults/timeout to happen to trigger this reset. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

[PATCH v5 08/16] drm/panfrost: Use a threaded IRQ for job interrupts

2021-06-29 Thread Boris Brezillon
This should avoid switching to interrupt context when the GPU is under heavy use. v3: * Don't take the job_lock in panfrost_job_handle_irq() Signed-off-by: Boris Brezillon Acked-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_job.c

[PATCH v5 05/16] drm/panfrost: Drop the pfdev argument passed to panfrost_exception_name()

2021-06-29 Thread Boris Brezillon
Currently unused. We'll add it back if we need per-GPU definitions. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.c | 2 +- drivers/gpu/drm/panfrost/panfrost_device.h | 2 +- drivers/gpu/drm/panfrost/panfrost_gpu.c| 2 +- driver

[PATCH v5 06/16] drm/panfrost: Do the exception -> string translation using a table

2021-06-29 Thread Boris Brezillon
tring table declaration in the same patch v3: * Drop the error field Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_device.c | 130 + drivers/gpu/drm/panfrost/panfrost_device.h | 69 +++ 2 fi

[PATCH v5 11/16] drm/panfrost: Disable the AS on unhandled page faults

2021-06-29 Thread Boris Brezillon
If we don't do that, we have to wait for the job timeout to expire before the fault jobs gets killed. v3: * Make sure the AS is re-enabled when new jobs are submitted to the context Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.h

[PATCH v5 14/16] drm/panfrost: Kill in-flight jobs on FD close

2021-06-29 Thread Boris Brezillon
taking the job_lock (not needed since this lock is never taken from an interrupt context) v3: * Set fence error to ECANCELED when a TERMINATED exception is received Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_device.h | 7 drivers/gpu/drm/panfrost/panfrost_job

[PATCH v5 13/16] drm/panfrost: Don't reset the GPU on job faults unless we really have to

2021-06-29 Thread Boris Brezillon
If we can recover from a fault without a reset there's no reason to issue one. v3: * Drop the mention of Valhall requiring a reset on JOB_BUS_FAULT * Set the fence error to -EINVAL instead of having per-exception error codes Signed-off-by: Boris Brezillon Reviewed-by: Steven

[PATCH v5 15/16] drm/panfrost: Queue jobs on the hardware

2021-06-29 Thread Boris Brezillon
lid active state * Only enable the second slot on GPUs supporting jobchain disambiguation * Split interrupt handling in sub-functions Signed-off-by: Steven Price Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_device.h | 2 +- drivers/gpu/drm/panfrost/panfrost_job.

[PATCH v5 04/16] drm/panfrost: Get rid of the unused JS_STATUS_EVENT_ACTIVE definition

2021-06-29 Thread Boris Brezillon
Exception types will be defined as an enum. v4: * Fix typo in the commit message Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_regs.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/panfrost

[PATCH v5 16/16] drm/panfrost: Increase the AS_ACTIVE polling timeout

2021-06-29 Thread Boris Brezillon
igger timeout value (1ms -> 100ms) to be on the safe side. v5: * New patch Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfro

[PATCH v5 10/16] drm/panfrost: Make sure job interrupts are masked before resetting

2021-06-29 Thread Boris Brezillon
et is issued gets tricky if we keep job interrupts active. Let's prepare for that and mask+flush job IRQs before issuing a reset. v4: * Add a comment explaining why we WARN_ON(!job) in the irq handler * Keep taking the job_lock when evicting stalled jobs v3: * New patch Signed-off-by: Boris

Re: [PATCH v5 02/16] drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr

2021-06-29 Thread Boris Brezillon
On Tue, 29 Jun 2021 10:50:36 +0200 Daniel Vetter wrote: > On Tue, Jun 29, 2021 at 09:34:56AM +0200, Boris Brezillon wrote: > > Mali Midgard/Bifrost GPUs have 3 hardware queues but only a global GPU > > reset. This leads to extra complexity when we need to synchronize timeout >

Re: [PATCH v5 02/16] drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr

2021-06-29 Thread Boris Brezillon
Hi Christian, On Tue, 29 Jun 2021 13:03:58 +0200 Christian König wrote: > Am 29.06.21 um 09:34 schrieb Boris Brezillon: > > Mali Midgard/Bifrost GPUs have 3 hardware queues but only a global GPU > > reset. This leads to extra complexity when we need to synchronize timeout >

Re: [PATCH v5 09/16] drm/panfrost: Simplify the reset serialization logic

2021-06-29 Thread Boris Brezillon
On Tue, 29 Jun 2021 09:35:03 +0200 Boris Brezillon wrote: > @@ -379,57 +370,72 @@ void panfrost_job_enable_interrupts(struct > panfrost_device *pfdev) > job_write(pfdev, JOB_INT_MASK, irq_mask); > } > > -static bool panfrost_scheduler_stop(struct panfrost_

[PATCH v6 01/16] drm/sched: Document what the timedout_job method should do

2021-06-29 Thread Boris Brezillon
The documentation is a bit vague and doesn't really describe what the ->timedout_job() is expected to do. Let's add a few more details. v5: * New patch Suggested-by: Daniel Vetter Signed-off-by: Boris Brezillon Reviewed-by: Daniel Vetter --- include/drm/gpu_scheduler.h | 14

[PATCH v6 00/16] drm/panfrost

2021-06-29 Thread Boris Brezillon
e header Regards, Boris Boris Brezillon (15): drm/sched: Document what the timedout_job method should do drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr drm/panfrost: Make ->run_job() return an ERR_PTR() when appropriate drm/panfrost: Get rid of

[PATCH v6 02/16] drm/sched: Allow using a dedicated workqueue for the timeout/fault tdr

2021-06-29 Thread Boris Brezillon
() method v3: * New patch v4: * Actually use the timeout_wq to queue the timeout work Suggested-by: Daniel Vetter Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Lucas Stach Acked-by: Daniel Vetter Acked-by: Christian König Cc: Qiang Yu Cc: Emma Anholt Cc: Alex Deucher

[PATCH v6 04/16] drm/panfrost: Get rid of the unused JS_STATUS_EVENT_ACTIVE definition

2021-06-29 Thread Boris Brezillon
Exception types will be defined as an enum. v4: * Fix typo in the commit message Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_regs.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/gpu/drm/panfrost

[PATCH v6 03/16] drm/panfrost: Make ->run_job() return an ERR_PTR() when appropriate

2021-06-29 Thread Boris Brezillon
If the fence creation fail, we can return the error pointer directly. The core will update the fence error accordingly. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_job.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH v6 09/16] drm/panfrost: Simplify the reset serialization logic

2021-06-29 Thread Boris Brezillon
Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.h | 6 +- drivers/gpu/drm/panfrost/panfrost_job.c| 186 - 2 files changed, 69 insertions(+), 123 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/

[PATCH v6 05/16] drm/panfrost: Drop the pfdev argument passed to panfrost_exception_name()

2021-06-29 Thread Boris Brezillon
Currently unused. We'll add it back if we need per-GPU definitions. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.c | 2 +- drivers/gpu/drm/panfrost/panfrost_device.h | 2 +- drivers/gpu/drm/panfrost/panfrost_gpu.c| 2 +- driver

[PATCH v6 07/16] drm/panfrost: Expose a helper to trigger a GPU reset

2021-06-29 Thread Boris Brezillon
Expose a helper to trigger a GPU reset so we can easily trigger reset operations outside the job timeout handler. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_device.h | 8 drivers/gpu/drm/panfrost

[PATCH v6 08/16] drm/panfrost: Use a threaded IRQ for job interrupts

2021-06-29 Thread Boris Brezillon
This should avoid switching to interrupt context when the GPU is under heavy use. v3: * Don't take the job_lock in panfrost_job_handle_irq() Signed-off-by: Boris Brezillon Acked-by: Alyssa Rosenzweig Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_job.c

[PATCH v6 13/16] drm/panfrost: Don't reset the GPU on job faults unless we really have to

2021-06-29 Thread Boris Brezillon
If we can recover from a fault without a reset there's no reason to issue one. v3: * Drop the mention of Valhall requiring a reset on JOB_BUS_FAULT * Set the fence error to -EINVAL instead of having per-exception error codes Signed-off-by: Boris Brezillon Reviewed-by: Steven

[PATCH v6 11/16] drm/panfrost: Disable the AS on unhandled page faults

2021-06-29 Thread Boris Brezillon
If we don't do that, we have to wait for the job timeout to expire before the fault jobs gets killed. v3: * Make sure the AS is re-enabled when new jobs are submitted to the context Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_device.h

[PATCH v6 06/16] drm/panfrost: Do the exception -> string translation using a table

2021-06-29 Thread Boris Brezillon
tring table declaration in the same patch v3: * Drop the error field Signed-off-by: Boris Brezillon Reviewed-by: Steven Price Reviewed-by: Alyssa Rosenzweig --- drivers/gpu/drm/panfrost/panfrost_device.c | 130 + drivers/gpu/drm/panfrost/panfrost_device.h | 69 +++ 2 fi

[PATCH v6 15/16] drm/panfrost: Queue jobs on the hardware

2021-06-29 Thread Boris Brezillon
lid active state * Only enable the second slot on GPUs supporting jobchain disambiguation * Split interrupt handling in sub-functions Signed-off-by: Steven Price Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_device.h | 2 +- drivers/gpu/drm/panfrost/panfrost_job.

[PATCH v6 10/16] drm/panfrost: Make sure job interrupts are masked before resetting

2021-06-29 Thread Boris Brezillon
et is issued gets tricky if we keep job interrupts active. Let's prepare for that and mask+flush job IRQs before issuing a reset. v4: * Add a comment explaining why we WARN_ON(!job) in the irq handler * Keep taking the job_lock when evicting stalled jobs v3: * New patch Signed-off-by: Boris

[PATCH v6 16/16] drm/panfrost: Increase the AS_ACTIVE polling timeout

2021-06-29 Thread Boris Brezillon
igger timeout value (1ms -> 100ms) to be on the safe side. v5: * New patch Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_mmu.c b/drivers/gpu/drm/panfrost/panfro

[PATCH v6 14/16] drm/panfrost: Kill in-flight jobs on FD close

2021-06-29 Thread Boris Brezillon
taking the job_lock (not needed since this lock is never taken from an interrupt context) v3: * Set fence error to ECANCELED when a TERMINATED exception is received Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_device.h | 7 drivers/gpu/drm/panfrost/panfrost_job

[PATCH v6 12/16] drm/panfrost: Reset the GPU when the AS_ACTIVE bit is stuck

2021-06-29 Thread Boris Brezillon
Things are unlikely to resolve until we reset the GPU. Let's not wait for other faults/timeout to happen to trigger this reset. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_mmu.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-)

Re: [PATCH v6 00/16] drm/panfrost

2021-06-30 Thread Boris Brezillon
On Wed, 30 Jun 2021 08:27:35 +0200 Boris Brezillon wrote: > Hello, > > Bunch of improvements to make the panfrost driver more robust and allow > queuing jobs at the HW level. > > Changes in v6: > * Collected acks/reviews > * Got rid of the cancel_delayed_work()

[PATCH v2 2/7] drm/panfrost: Move the mappings collection out of panfrost_lookup_bos()

2021-07-01 Thread Boris Brezillon
So we can re-use it from elsewhere. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 52 ++--- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index

[PATCH v2 0/7] drm/panfrost: drm/panfrost: Add a new submit ioctl

2021-07-01 Thread Boris Brezillon
this new ioctl is welcome, in particular, do you think other things are missing/would be nice to have for Vulkan? Regards, Boris P.S.: basic igt tests for these new ioctls re available there [1] [1]https://gitlab.freedesktop.org/bbrezillon/igt-gpu-tools/-/tree/panfrost-batch-submit Boris

[PATCH v2 1/7] drm/panfrost: Pass a job to panfrost_{acquire, attach_object_fences}()

2021-07-01 Thread Boris Brezillon
So we don't have to change the prototype if we extend the function. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_job.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gp

[PATCH v2 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-01 Thread Boris Brezillon
Needed to keep VkQueues isolated from each other. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/Makefile | 3 +- drivers/gpu/drm/panfrost/panfrost_device.h| 2 +- drivers/gpu/drm/panfrost/panfrost_drv.c | 69 -- drivers/gpu/drm/panfrost

[PATCH v2 5/7] drm/panfrost: Add a new ioctl to submit batches

2021-07-01 Thread Boris Brezillon
This should help limit the number of ioctls when submitting multiple jobs. The new ioctl also supports syncobj timelines and BO access flags. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 305 drivers/gpu/drm/panfrost/panfrost_job.c | 3

[PATCH v2 3/7] drm/panfrost: Add BO access flags to relax dependencies between jobs

2021-07-01 Thread Boris Brezillon
Jobs reading from the same BO should not be serialized. Add access flags so we can relax the implicit dependencies in that case. We force exclusive access for now to keep the behavior unchanged, but a new SUBMIT ioctl taking explicit access flags will be introduced. Signed-off-by: Boris Brezillon

[PATCH v2 6/7] drm/panfrost: Advertise the SYNCOBJ_TIMELINE feature

2021-07-01 Thread Boris Brezillon
Now that we have a new SUBMIT ioctl dealing with timelined syncojbs we can advertise the feature. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers

[PATCH v2 7/7] drm/panfrost: Bump minor version to reflect the feature additions

2021-07-01 Thread Boris Brezillon
We now have a new ioctl that allows submitting multiple jobs at once (among other things) and we support timelined syncobjs. Bump the minor version number to reflect those changes. Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/panfrost_drv.c | 4 +++- 1 file changed, 3 insertions

Re: [PATCH v2 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 10:56:29 +0100 Steven Price wrote: > On 01/07/2021 10:12, Boris Brezillon wrote: > > Needed to keep VkQueues isolated from each other. > > > > Signed-off-by: Boris Brezillon > > My Vulkan knowledge is limited so I'm not sure whether this is

Re: [PATCH v2 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 11:08:58 +0100 Steven Price wrote: > On 01/07/2021 10:12, Boris Brezillon wrote: > > Needed to keep VkQueues isolated from each other. > > One more comment I noticed when I tried this out: > > [...] > > +struct panfrost_submitqueue * > > +p

Re: [PATCH v2 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 11:58:34 +0100 Steven Price wrote: > On 02/07/2021 11:52, Boris Brezillon wrote: > > On Fri, 2 Jul 2021 11:08:58 +0100 > > Steven Price wrote: > > > >> On 01/07/2021 10:12, Boris Brezillon wrote: > >>> Needed to keep VkQueues i

Re: [PATCH v2 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 09:58:06 -0400 Alyssa Rosenzweig wrote: > > > My Vulkan knowledge is limited so I'm not sure whether this is the right > > > approach or not. In particular is it correct that an application can > > > create a high priority queue which could affect other (normal priority) > > >

[PATCH v3 0/7] drm/panfrost: drm/panfrost: Add a new submit ioctl

2021-07-02 Thread Boris Brezillon
3: * Fix a deadlock in the submitqueue logic * Limit the number of submitqueue per context to 16 Boris Brezillon (7): drm/panfrost: Pass a job to panfrost_{acquire,attach}_object_fences() drm/panfrost: Move the mappings collection out of panfrost_lookup_bos() drm/panfrost: Add BO access fl

[PATCH v3 1/7] drm/panfrost: Pass a job to panfrost_{acquire, attach}_object_fences()

2021-07-02 Thread Boris Brezillon
So we don't have to change the prototype if we extend the function. v3: * Fix subject Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_job.c | 22 -- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/driver

[PATCH v3 2/7] drm/panfrost: Move the mappings collection out of panfrost_lookup_bos()

2021-07-02 Thread Boris Brezillon
So we can re-use it from elsewhere. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 52 ++--- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm

[PATCH v3 3/7] drm/panfrost: Add BO access flags to relax dependencies between jobs

2021-07-02 Thread Boris Brezillon
Jobs reading from the same BO should not be serialized. Add access flags so we can relax the implicit dependencies in that case. We force exclusive access for now to keep the behavior unchanged, but a new SUBMIT ioctl taking explicit access flags will be introduced. Signed-off-by: Boris Brezillon

[PATCH v3 5/7] drm/panfrost: Add a new ioctl to submit batches

2021-07-02 Thread Boris Brezillon
This should help limit the number of ioctls when submitting multiple jobs. The new ioctl also supports syncobj timelines and BO access flags. v3: * Re-use panfrost_get_job_bos() and panfrost_get_job_in_syncs() in the old submit path Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost

[PATCH v3 7/7] drm/panfrost: Bump minor version to reflect the feature additions

2021-07-02 Thread Boris Brezillon
We now have a new ioctl that allows submitting multiple jobs at once (among other things) and we support timelined syncobjs. Bump the minor version number to reflect those changes. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 4 +++- 1

[PATCH v3 6/7] drm/panfrost: Advertise the SYNCOBJ_TIMELINE feature

2021-07-02 Thread Boris Brezillon
Now that we have a new SUBMIT ioctl dealing with timelined syncojbs we can advertise the feature. Signed-off-by: Boris Brezillon Reviewed-by: Steven Price --- drivers/gpu/drm/panfrost/panfrost_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panfrost

[PATCH v3 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-02 Thread Boris Brezillon
Needed to keep VkQueues isolated from each other. v3: * Limit the number of submitqueue per context to 16 * Fix a deadlock Signed-off-by: Boris Brezillon --- drivers/gpu/drm/panfrost/Makefile | 3 +- drivers/gpu/drm/panfrost/panfrost_device.h| 2 +- drivers/gpu/drm/panfrost

Re: [PATCH v3 5/7] drm/panfrost: Add a new ioctl to submit batches

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 11:13:16 -0400 Alyssa Rosenzweig wrote: > ``` > > +/* Syncobj reference passed at job submission time to encode explicit > > + * input/output fences. > > + */ > > +struct drm_panfrost_syncobj_ref { > > + __u32 handle; > > + __u32 pad; > > + __u64 point; > > +}; > ``` >

Re: [PATCH v3 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 16:05:30 +0100 Steven Price wrote: > On 02/07/2021 15:32, Boris Brezillon wrote: > > Needed to keep VkQueues isolated from each other. > > > > v3: > > * Limit the number of submitqueue per context to 16 > > * Fix a deadlock > > > &

Re: [PATCH v3 4/7] drm/panfrost: Add the ability to create submit queues

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 17:49:10 +0200 Boris Brezillon wrote: > On Fri, 2 Jul 2021 16:05:30 +0100 > Steven Price wrote: > > > On 02/07/2021 15:32, Boris Brezillon wrote: > > > Needed to keep VkQueues isolated from each other. > > > > > > v3: > > &g

Re: [PATCH v3 5/7] drm/panfrost: Add a new ioctl to submit batches

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 12:49:55 -0400 Alyssa Rosenzweig wrote: > > > Why is there padding instead of putting point first? > > > > We can move the point field first, but we need to keep the explicit > > padding: the struct has to be 64bit aligned because of the __u64 field > > (which the compiler t

Re: [PATCH v3 5/7] drm/panfrost: Add a new ioctl to submit batches

2021-07-02 Thread Boris Brezillon
On Fri, 2 Jul 2021 12:49:55 -0400 Alyssa Rosenzweig wrote: > > > ``` > > > > #define PANFROST_BO_REF_EXCLUSIVE 0x1 > > > > +#define PANFROST_BO_REF_NO_IMPLICIT_DEP0x2 > > > ``` > > > > > > This seems logically backwards. NO_IMPLICIT_DEP makes sense if we're > > > trying to ke

[PATCH v4 0/7] drm/panfrost: drm/panfrost: Add a new submit ioctl

2021-07-05 Thread Boris Brezillon
ubmitqueue per context to 16 *** BLURB HERE *** Boris Brezillon (7): drm/panfrost: Pass a job to panfrost_{acquire,attach}_object_fences() drm/panfrost: Move the mappings collection out of panfrost_lookup_bos() drm/panfrost: Add BO access flags to relax dependencies between jobs drm/panfr

  1   2   3   4   5   6   7   8   9   10   >