summaryrefslogtreecommitdiff
path: root/sys/dev/video.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/video.c')
-rw-r--r--sys/dev/video.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/sys/dev/video.c b/sys/dev/video.c
index 019a75cebd8..5eaf008d9c4 100644
--- a/sys/dev/video.c
+++ b/sys/dev/video.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: video.c,v 1.9 2008/06/09 17:13:35 robert Exp $ */
+/* $OpenBSD: video.c,v 1.10 2008/06/09 20:51:31 mglocker Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
*
@@ -92,6 +92,8 @@ videoopen(dev_t dev, int flags, int fmt, struct proc *p)
sc->hw_if == NULL)
return (ENXIO);
+ sc->sc_start_read = 0;
+
if (sc->hw_if->open != NULL)
return (sc->hw_if->open(sc->hw_hdl, flags, &sc->sc_fsize,
sc->sc_fbuffer, video_intr, sc));
@@ -126,6 +128,12 @@ videoread(dev_t dev, struct uio *uio, int ioflag)
if (sc->sc_dying)
return (EIO);
+ /* start the stream */
+ if (sc->hw_if->start_read && !sc->sc_start_read) {
+ sc->sc_start_read = 1;
+ sc->hw_if->start_read(sc->hw_hdl);
+ }
+
DPRINTF(("resid=%d\n", uio->uio_resid));
/* block userland read until a frame is ready */