diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-09-13 09:32:28 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2018-09-13 09:32:28 +0000 |
commit | 9f835b185f3777e9fa153c71f0035ca98205bc57 (patch) | |
tree | f8b89a1eba75d165ec04980676a3cffb8e287790 /sys/dev/pci/drm | |
parent | c95a6d411ae38df5eaf7abbf23b241585eab9de9 (diff) |
In drm_wait_one_vblank() add a delay when we're "cold". Interrupts aren't
enabled at that point, so we cannot wait for one to happen. But having no
delay at all breaks detection of some output connectors.
Thanks to Philippe Meunier for tracking down the issue.
ok millert@, jsg@
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/drm_irq.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c index dd8474fc4a0..cbb80424abc 100644 --- a/sys/dev/pci/drm/drm_irq.c +++ b/sys/dev/pci/drm/drm_irq.c @@ -1317,8 +1317,21 @@ void drm_wait_one_vblank(struct drm_device *dev, unsigned int pipe) int ret; u32 last; - if (WARN_ON(pipe >= dev->num_crtcs) || cold) + if (WARN_ON(pipe >= dev->num_crtcs)) + return; + +#ifdef __OpenBSD__ + /* + * If we're cold, vblank interrupts won't happen even if + * they're turned on by the driver. Just stall long enough + * for a vblank to pass. This assumes a vrefresh of at least + * 25 Hz. + */ + if (cold) { + delay(40000); return; + } +#endif ret = drm_vblank_get(dev, pipe); if (WARN(ret, "vblank not available on crtc %i, ret=%i\n", pipe, ret)) |