summaryrefslogtreecommitdiff
path: root/sys/dev/video.c
diff options
context:
space:
mode:
authorRobert Nagy <robert@cvs.openbsd.org>2008-06-09 05:49:11 +0000
committerRobert Nagy <robert@cvs.openbsd.org>2008-06-09 05:49:11 +0000
commit0cdbb8efe06fea47797ab4394ddece21c51ae77e (patch)
tree25056be3cb66c75c881a4fd8d03de875f6ff92a2 /sys/dev/video.c
parent0fea6ee3bb1c9040cf4bb57de571d7edec646a8f (diff)
Allocate the video buffer based on the maximum frame size that's reported
by the device instead of using the statically set VIDEO_BUF_SIZE. ok mglocker@
Diffstat (limited to 'sys/dev/video.c')
-rw-r--r--sys/dev/video.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/sys/dev/video.c b/sys/dev/video.c
index 36cfc3c1f57..3f5b930224a 100644
--- a/sys/dev/video.c
+++ b/sys/dev/video.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: video.c,v 1.7 2008/06/07 22:14:57 mglocker Exp $ */
+/* $OpenBSD: video.c,v 1.8 2008/06/09 05:49:10 robert Exp $ */
/*
* Copyright (c) 2008 Robert Nagy <robert@openbsd.org>
*
@@ -63,13 +63,17 @@ videoattach(struct device *parent, struct device *self, void *aux)
{
struct video_softc *sc = (void *) self;
struct video_attach_args *sa = aux;
+ int video_buf_size = 0;
printf("\n");
sc->hw_if = sa->hwif;
sc->hw_hdl = sa->hdl;
sc->sc_dev = parent;
- sc->sc_fbuffer = malloc(VIDEO_BUF_SIZE, M_DEVBUF, M_NOWAIT);
+ if (sc->hw_if->get_bufsize)
+ video_buf_size = (sc->hw_if->get_bufsize)(sc->hw_hdl);
+
+ sc->sc_fbuffer = malloc(video_buf_size, M_DEVBUF, M_NOWAIT);
if (sc->sc_fbuffer == NULL) {
printf("video: could not allocate frame buffer\n");
return;