Skip to content

Commit 9892287

Browse files
covanamKAGA-KOKO
authored andcommitted
drm/i915/gvt: Switch to use hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Patch was created by using Coccinelle. Signed-off-by: Nam Cao <[email protected]> Signed-off-by: Thomas Gleixner <[email protected]> Acked-by: Zack Rusin <[email protected]> Acked-by: Jani Nikula <[email protected]> Link: https://lore.kernel.org/all/9af55b7d0918bb3642c6392fbb4800d8ea7c9c50.1738746904.git.namcao@linutronix.de
1 parent 0592bb3 commit 9892287

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

drivers/gpu/drm/i915/gvt/display.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -581,8 +581,7 @@ static int setup_virtual_dp_monitor(struct intel_vgpu *vgpu, int port_num,
581581
vgpu->display.port_num = port_num;
582582

583583
/* Init hrtimer based on default refresh rate */
584-
hrtimer_init(&vblank_timer->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
585-
vblank_timer->timer.function = vblank_timer_fn;
584+
hrtimer_setup(&vblank_timer->timer, vblank_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
586585
vblank_timer->vrefresh_k = port->vrefresh_k;
587586
vblank_timer->period = DIV64_U64_ROUND_CLOSEST(NSEC_PER_SEC * MSEC_PER_SEC, vblank_timer->vrefresh_k);
588587

drivers/gpu/drm/i915/gvt/sched_policy.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -286,8 +286,7 @@ static int tbs_sched_init(struct intel_gvt *gvt)
286286
return -ENOMEM;
287287

288288
INIT_LIST_HEAD(&data->lru_runq_head);
289-
hrtimer_init(&data->timer, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
290-
data->timer.function = tbs_timer_fn;
289+
hrtimer_setup(&data->timer, tbs_timer_fn, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
291290
data->period = GVT_DEFAULT_TIME_SLICE;
292291
data->gvt = gvt;
293292

0 commit comments

Comments
 (0)