diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2021-06-30 09:27:42 +0300 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2021-07-01 09:53:30 +0300 |
commit | 229f45788e22aa60b9317fe84c46ecdff9c08b01 (patch) | |
tree | 18f4562d0b53f35c9be33dd4c07781b71f3f7a89 /drivers/gpu/drm/panfrost | |
parent | 7319965fa19edb177ae3d240f5678fe0519cba97 (diff) | |
download | linux-229f45788e22aa60b9317fe84c46ecdff9c08b01.tar.xz |
drm/panfrost: Expose a helper to trigger a GPU reset
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 <boris.brezillon@collabora.com>
Reviewed-by: Steven Price <steven.price@arm.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210630062751.2832545-8-boris.brezillon@collabora.com
Diffstat (limited to 'drivers/gpu/drm/panfrost')
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_device.h | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_job.c | 4 |
2 files changed, 9 insertions, 3 deletions
diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 3639288ee8a2..aec11b6f5abc 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -244,4 +244,12 @@ enum drm_panfrost_exception_type { const char *panfrost_exception_name(u32 exception_code); +static inline void +panfrost_device_schedule_reset(struct panfrost_device *pfdev) +{ + /* Schedule a reset if there's no reset in progress. */ + if (!atomic_xchg(&pfdev->reset.pending, 1)) + schedule_work(&pfdev->reset.work); +} + #endif diff --git a/drivers/gpu/drm/panfrost/panfrost_job.c b/drivers/gpu/drm/panfrost/panfrost_job.c index ea3432ffde40..12285a285765 100644 --- a/drivers/gpu/drm/panfrost/panfrost_job.c +++ b/drivers/gpu/drm/panfrost/panfrost_job.c @@ -447,9 +447,7 @@ static enum drm_gpu_sched_stat panfrost_job_timedout(struct drm_sched_job if (!panfrost_scheduler_stop(&pfdev->js->queue[js], sched_job)) return DRM_GPU_SCHED_STAT_NOMINAL; - /* Schedule a reset if there's no reset in progress. */ - if (!atomic_xchg(&pfdev->reset.pending, 1)) - schedule_work(&pfdev->reset.work); + panfrost_device_schedule_reset(pfdev); return DRM_GPU_SCHED_STAT_NOMINAL; } |