diff options
author | Rob Clark <robdclark@chromium.org> | 2021-09-28 02:04:53 +0300 |
---|---|---|
committer | Rob Clark <robdclark@chromium.org> | 2021-10-16 02:35:39 +0300 |
commit | ddb6e37a50e02736f3c9f1a9f8f873989b22af54 (patch) | |
tree | a5304fc7fb8db4b532f630b42823e0036681e337 /drivers/gpu/drm/msm/msm_drv.h | |
parent | 415f36903be7be16bc0563f3624b0d0927739860 (diff) | |
download | linux-ddb6e37a50e02736f3c9f1a9f8f873989b22af54.tar.xz |
drm/msm: Add hrtimer + kthread_work helper
Before open-coding this a 2nd time, add a helper.
Signed-off-by: Rob Clark <robdclark@chromium.org>
Link: https://lore.kernel.org/r/20210927230455.1066297-1-robdclark@gmail.com
Signed-off-by: Rob Clark <robdclark@chromium.org>
Diffstat (limited to 'drivers/gpu/drm/msm/msm_drv.h')
-rw-r--r-- | drivers/gpu/drm/msm/msm_drv.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/drivers/gpu/drm/msm/msm_drv.h b/drivers/gpu/drm/msm/msm_drv.h index c552f0c3890c..205cc937dafa 100644 --- a/drivers/gpu/drm/msm/msm_drv.h +++ b/drivers/gpu/drm/msm/msm_drv.h @@ -480,6 +480,28 @@ void msm_writel(u32 data, void __iomem *addr); u32 msm_readl(const void __iomem *addr); void msm_rmw(void __iomem *addr, u32 mask, u32 or); +/** + * struct msm_hrtimer_work - a helper to combine an hrtimer with kthread_work + * + * @timer: hrtimer to control when the kthread work is triggered + * @work: the kthread work + * @worker: the kthread worker the work will be scheduled on + */ +struct msm_hrtimer_work { + struct hrtimer timer; + struct kthread_work work; + struct kthread_worker *worker; +}; + +void msm_hrtimer_queue_work(struct msm_hrtimer_work *work, + ktime_t wakeup_time, + enum hrtimer_mode mode); +void msm_hrtimer_work_init(struct msm_hrtimer_work *work, + struct kthread_worker *worker, + kthread_work_func_t fn, + clockid_t clock_id, + enum hrtimer_mode mode); + #define DBG(fmt, ...) DRM_DEBUG_DRIVER(fmt"\n", ##__VA_ARGS__) #define VERB(fmt, ...) if (0) DRM_DEBUG_DRIVER(fmt"\n", ##__VA_ARGS__) |