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
This commit is contained in:
parent
7319965fa1
commit
229f45788e
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue