[PATCH] drm/vkms: Don't warn hrtimer_forward_now failure.
daniel at ffwll.ch
Tue May 26 11:11:28 UTC 2020
On Tue, May 26, 2020 at 6:39 AM Tetsuo Handa
<penguin-kernel at i-love.sakura.ne.jp> wrote:
> On 2020/05/26 13:18, Tetsuo Handa wrote:
> > due to mode->crtc_clock <= 0. Thus, somehow initializing mode->crtc_clock > 0 might be able
> > to solve this problem.
> Well, I came to think that vkms_enable_vblank() should return an error to the caller
> when drm_calc_timestamping_constants() failed...
If my memory is right we shouldn't even get there. crtc->mode being
all zeros sounds like the simulated output isn't on (no surprise,
syzbot doesn't enable it and fbcon is probably on card0), so something
higher up should reject this. I'll see whether I can figure out what
vkms isn't doing right (or whether there's a higher level bug in
drm_vblank.c code), yesterday my machine died and already evening
Thanks for digging into this a bit more meanwhile.
> static int vkms_enable_vblank(struct drm_crtc *crtc)
> struct drm_device *dev = crtc->dev;
> unsigned int pipe = drm_crtc_index(crtc);
> struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> struct vkms_output *out = drm_crtc_to_vkms_output(crtc);
> drm_calc_timestamping_constants(crtc, &crtc->mode);
> hrtimer_init(&out->vblank_hrtimer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
> out->vblank_hrtimer.function = &vkms_vblank_simulate;
> out->period_ns = ktime_set(0, vblank->framedur_ns);
> hrtimer_start(&out->vblank_hrtimer, out->period_ns, HRTIMER_MODE_REL);
> return 0;
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
More information about the dri-devel