> Date: Wed, 15 Aug 2018 01:50:58 -0400
> From: Philippe Meunier <[email protected]>
>
> Philippe Meunier wrote:
> >Mark Kettenis wrote:
> >>Does the diff below fix things?
> >
> >Yes, it fixes the console resolution problem, although a bunch of "vblank
> >wait timed out on crtc 0" messages now show up (see dmesg's output below).
>
> How about the patch below? It does essentially the same thing as yours but
> directly inside drm_wait_one_vblank where "cold" was already tested, and
> without testing "condition" in __wait_event_intr_timeout wich was never
> tested anyway when "cold" is 1.
No. We want to keep the modifications to the original Linux code as
small as possible. Otherwise jsg@ and I go insane the next time we
update this code to include support for new hardware. So I really
want to fix this in the compatibility layer in drm_linux.c.
Maybe you can add some printf's to figure out why the timeout is
happening? Is it actually doing a delay? Is the delay too long? Or
too short?
Thanks,
Mark
> Index: sys/dev/pci/drm/drm_irq.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/drm/drm_irq.c,v
> retrieving revision 1.70
> diff -u -p -u -p -r1.70 drm_irq.c
> --- sys/dev/pci/drm/drm_irq.c 28 Mar 2018 05:27:28 -0000 1.70
> +++ sys/dev/pci/drm/drm_irq.c 15 Aug 2018 05:45:18 -0000
> @@ -1316,10 +1316,17 @@ void drm_wait_one_vblank(struct drm_devi
> struct drm_vblank_crtc *vblank = &dev->vblank[pipe];
> int ret;
> u32 last;
> + int timo = msecs_to_jiffies(100);
>
> - if (WARN_ON(pipe >= dev->num_crtcs) || cold)
> + if (WARN_ON(pipe >= dev->num_crtcs))
> return;
>
> + if (cold) {
> + for (ret = timo; ret > 0; ret--)
> + delay(tick);
> + return;
> + }
> +
> ret = drm_vblank_get(dev, pipe);
> if (WARN(ret, "vblank not available on crtc %i, ret=%i\n", pipe, ret))
> return;
> @@ -1328,7 +1335,7 @@ void drm_wait_one_vblank(struct drm_devi
>
> ret = wait_event_timeout(vblank->queue,
> last != drm_vblank_count(dev, pipe),
> - msecs_to_jiffies(100));
> + timo);
>
> WARN(ret == 0, "vblank wait timed out on crtc %i\n", pipe);
>
>