diff options
author | Boris Brezillon <boris.brezillon@collabora.com> | 2021-06-30 08:27:42 +0200 |
---|---|---|
committer | Boris Brezillon <boris.brezillon@collabora.com> | 2021-07-01 08:53:30 +0200 |
commit | 229f45788e22aa60b9317fe84c46ecdff9c08b01 (patch) | |
tree | 18f4562d0b53f35c9be33dd4c07781b71f3f7a89 /drivers/gpu/drm/panfrost/panfrost_device.h | |
parent | 7319965fa19edb177ae3d240f5678fe0519cba97 (diff) | |
download | linux-229f45788e22aa60b9317fe84c46ecdff9c08b01.tar.bz2 |
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/panfrost_device.h')
-rw-r--r-- | drivers/gpu/drm/panfrost/panfrost_device.h | 8 |
1 files changed, 8 insertions, 0 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 |