* Re: [PATCH] drm/panthor: Don't add write fences to the shared BOs
2024-09-05 7:01 [PATCH] drm/panthor: Don't add write fences to the shared BOs Boris Brezillon
@ 2024-09-05 10:19 ` Steven Price
2024-09-05 13:13 ` Liviu Dudau
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Steven Price @ 2024-09-05 10:19 UTC (permalink / raw)
To: Boris Brezillon, Liviu Dudau, Adrián Larumbe
Cc: dri-devel, kernel, Matthew Brost, Simona Vetter, stable
On 05/09/2024 08:01, Boris Brezillon wrote:
> The only user (the mesa gallium driver) is already assuming explicit
> synchronization and doing the export/import dance on shared BOs. The
> only reason we were registering ourselves as writers on external BOs
> is because Xe, which was the reference back when we developed Panthor,
> was doing so. Turns out Xe was wrong, and we really want bookkeep on
> all registered fences, so userspace can explicitly upgrade those to
> read/write when needed.
>
> Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block")
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Simona Vetter <simona.vetter@ffwll.ch>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 9a0ff48f7061..41260cf4beb8 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -3423,13 +3423,8 @@ void panthor_job_update_resvs(struct drm_exec *exec, struct drm_sched_job *sched
> {
> struct panthor_job *job = container_of(sched_job, struct panthor_job, base);
>
> - /* Still not sure why we want USAGE_WRITE for external objects, since I
> - * was assuming this would be handled through explicit syncs being imported
> - * to external BOs with DMA_BUF_IOCTL_IMPORT_SYNC_FILE, but other drivers
> - * seem to pass DMA_RESV_USAGE_WRITE, so there must be a good reason.
> - */
> panthor_vm_update_resvs(job->group->vm, exec, &sched_job->s_fence->finished,
> - DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
> + DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_BOOKKEEP);
> }
>
> void panthor_sched_unplug(struct panthor_device *ptdev)
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/panthor: Don't add write fences to the shared BOs
2024-09-05 7:01 [PATCH] drm/panthor: Don't add write fences to the shared BOs Boris Brezillon
2024-09-05 10:19 ` Steven Price
@ 2024-09-05 13:13 ` Liviu Dudau
2024-09-24 9:34 ` Simona Vetter
2024-10-01 16:46 ` Boris Brezillon
3 siblings, 0 replies; 5+ messages in thread
From: Liviu Dudau @ 2024-09-05 13:13 UTC (permalink / raw)
To: Boris Brezillon
Cc: Steven Price, Adrián Larumbe, dri-devel, kernel,
Matthew Brost, Simona Vetter, stable
On Thu, Sep 05, 2024 at 09:01:54AM +0200, Boris Brezillon wrote:
> The only user (the mesa gallium driver) is already assuming explicit
> synchronization and doing the export/import dance on shared BOs. The
> only reason we were registering ourselves as writers on external BOs
> is because Xe, which was the reference back when we developed Panthor,
> was doing so. Turns out Xe was wrong, and we really want bookkeep on
> all registered fences, so userspace can explicitly upgrade those to
> read/write when needed.
>
> Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block")
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Simona Vetter <simona.vetter@ffwll.ch>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Liviu Dudau <liviu.dudau@arm.com>
Best regards,
Liviu
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 9a0ff48f7061..41260cf4beb8 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -3423,13 +3423,8 @@ void panthor_job_update_resvs(struct drm_exec *exec, struct drm_sched_job *sched
> {
> struct panthor_job *job = container_of(sched_job, struct panthor_job, base);
>
> - /* Still not sure why we want USAGE_WRITE for external objects, since I
> - * was assuming this would be handled through explicit syncs being imported
> - * to external BOs with DMA_BUF_IOCTL_IMPORT_SYNC_FILE, but other drivers
> - * seem to pass DMA_RESV_USAGE_WRITE, so there must be a good reason.
> - */
> panthor_vm_update_resvs(job->group->vm, exec, &sched_job->s_fence->finished,
> - DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
> + DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_BOOKKEEP);
> }
>
> void panthor_sched_unplug(struct panthor_device *ptdev)
> --
> 2.46.0
>
--
====================
| I would like to |
| fix the world, |
| but they're not |
| giving me the |
\ source code! /
---------------
¯\_(ツ)_/¯
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/panthor: Don't add write fences to the shared BOs
2024-09-05 7:01 [PATCH] drm/panthor: Don't add write fences to the shared BOs Boris Brezillon
2024-09-05 10:19 ` Steven Price
2024-09-05 13:13 ` Liviu Dudau
@ 2024-09-24 9:34 ` Simona Vetter
2024-10-01 16:46 ` Boris Brezillon
3 siblings, 0 replies; 5+ messages in thread
From: Simona Vetter @ 2024-09-24 9:34 UTC (permalink / raw)
To: Boris Brezillon
Cc: Steven Price, Liviu Dudau, Adrián Larumbe, dri-devel, kernel,
Matthew Brost, Simona Vetter, stable
On Thu, Sep 05, 2024 at 09:01:54AM +0200, Boris Brezillon wrote:
> The only user (the mesa gallium driver) is already assuming explicit
> synchronization and doing the export/import dance on shared BOs. The
> only reason we were registering ourselves as writers on external BOs
> is because Xe, which was the reference back when we developed Panthor,
> was doing so. Turns out Xe was wrong, and we really want bookkeep on
> all registered fences, so userspace can explicitly upgrade those to
> read/write when needed.
>
> Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block")
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Simona Vetter <simona.vetter@ffwll.ch>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
fwiw Reviewed-by: Simona Vetter <simona.vetter@ffwll.ch>
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 9a0ff48f7061..41260cf4beb8 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -3423,13 +3423,8 @@ void panthor_job_update_resvs(struct drm_exec *exec, struct drm_sched_job *sched
> {
> struct panthor_job *job = container_of(sched_job, struct panthor_job, base);
>
> - /* Still not sure why we want USAGE_WRITE for external objects, since I
> - * was assuming this would be handled through explicit syncs being imported
> - * to external BOs with DMA_BUF_IOCTL_IMPORT_SYNC_FILE, but other drivers
> - * seem to pass DMA_RESV_USAGE_WRITE, so there must be a good reason.
> - */
> panthor_vm_update_resvs(job->group->vm, exec, &sched_job->s_fence->finished,
> - DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
> + DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_BOOKKEEP);
> }
>
> void panthor_sched_unplug(struct panthor_device *ptdev)
> --
> 2.46.0
>
--
Simona Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] drm/panthor: Don't add write fences to the shared BOs
2024-09-05 7:01 [PATCH] drm/panthor: Don't add write fences to the shared BOs Boris Brezillon
` (2 preceding siblings ...)
2024-09-24 9:34 ` Simona Vetter
@ 2024-10-01 16:46 ` Boris Brezillon
3 siblings, 0 replies; 5+ messages in thread
From: Boris Brezillon @ 2024-10-01 16:46 UTC (permalink / raw)
To: Boris Brezillon, Steven Price, Liviu Dudau, Adrián Larumbe
Cc: dri-devel, kernel, Matthew Brost, Simona Vetter, stable
On Thu, 5 Sep 2024 09:01:54 +0200
Boris Brezillon <boris.brezillon@collabora.com> wrote:
> The only user (the mesa gallium driver) is already assuming explicit
> synchronization and doing the export/import dance on shared BOs. The
> only reason we were registering ourselves as writers on external BOs
> is because Xe, which was the reference back when we developed Panthor,
> was doing so. Turns out Xe was wrong, and we really want bookkeep on
> all registered fences, so userspace can explicitly upgrade those to
> read/write when needed.
>
> Fixes: 4bdca1150792 ("drm/panthor: Add the driver frontend block")
> Cc: Matthew Brost <matthew.brost@intel.com>
> Cc: Simona Vetter <simona.vetter@ffwll.ch>
> Cc: <stable@vger.kernel.org>
> Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Queued to drm-misc-fixes.
> ---
> drivers/gpu/drm/panthor/panthor_sched.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/gpu/drm/panthor/panthor_sched.c b/drivers/gpu/drm/panthor/panthor_sched.c
> index 9a0ff48f7061..41260cf4beb8 100644
> --- a/drivers/gpu/drm/panthor/panthor_sched.c
> +++ b/drivers/gpu/drm/panthor/panthor_sched.c
> @@ -3423,13 +3423,8 @@ void panthor_job_update_resvs(struct drm_exec *exec, struct drm_sched_job *sched
> {
> struct panthor_job *job = container_of(sched_job, struct panthor_job, base);
>
> - /* Still not sure why we want USAGE_WRITE for external objects, since I
> - * was assuming this would be handled through explicit syncs being imported
> - * to external BOs with DMA_BUF_IOCTL_IMPORT_SYNC_FILE, but other drivers
> - * seem to pass DMA_RESV_USAGE_WRITE, so there must be a good reason.
> - */
> panthor_vm_update_resvs(job->group->vm, exec, &sched_job->s_fence->finished,
> - DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_WRITE);
> + DMA_RESV_USAGE_BOOKKEEP, DMA_RESV_USAGE_BOOKKEEP);
> }
>
> void panthor_sched_unplug(struct panthor_device *ptdev)
^ permalink raw reply [flat|nested] 5+ messages in thread