diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2009-08-12 15:58:32 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2009-08-12 15:58:32 +0000 |
commit | 71c1c313d7a054c7699c03b66e1e598b1d7ae5b0 (patch) | |
tree | d17455d7161d214f4928b32f2075317054f5aa49 /sys | |
parent | b6c1a50d5d1b9d2bb2a9081166fcae595ab222e6 (diff) |
Backing store for ega and vga virtual console is not allocated until the
second vc is created. However, it was allocated using the geometry of
the second vc to allocate backing store for the first. Be sure to use
the proper values in case geometries differ.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/dev/ic/vga.c | 8 | ||||
-rw-r--r-- | sys/dev/isa/ega.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c index 7e9056f1e0e..a7565f7aa11 100644 --- a/sys/dev/ic/vga.c +++ b/sys/dev/ic/vga.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vga.c,v 1.50 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: vga.c,v 1.51 2009/08/12 15:58:30 miod Exp $ */ /* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */ /*- @@ -715,8 +715,10 @@ vga_alloc_screen(v, type, cookiep, curxp, curyp, defattrp) * for the first one too. * XXX We could be more clever and use video RAM. */ - LIST_FIRST(&vc->screens)->pcs.mem = - malloc(type->ncols * type->nrows * 2, M_DEVBUF, M_WAITOK); + scr = LIST_FIRST(&vc->screens); + scr->pcs.mem = + malloc(scr->pcs.type->ncols * scr->pcs.type->nrows * 2, + M_DEVBUF, M_WAITOK); } scr = malloc(sizeof(struct vgascreen), M_DEVBUF, M_WAITOK); diff --git a/sys/dev/isa/ega.c b/sys/dev/isa/ega.c index 3fcda238a0f..2790cb02c52 100644 --- a/sys/dev/isa/ega.c +++ b/sys/dev/isa/ega.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ega.c,v 1.13 2009/03/29 21:53:52 sthen Exp $ */ +/* $OpenBSD: ega.c,v 1.14 2009/08/12 15:58:31 miod Exp $ */ /* $NetBSD: ega.c,v 1.4.4.1 2000/06/30 16:27:47 simonb Exp $ */ /* @@ -622,8 +622,10 @@ ega_alloc_screen(v, type, cookiep, curxp, curyp, defattrp) * for the first one too. * XXX We could be more clever and use video RAM. */ - LIST_FIRST(&vc->screens)->pcs.mem = - malloc(type->ncols * type->nrows * 2, M_DEVBUF, M_WAITOK); + scr = LIST_FIRST(&vs->screens); + scr->pcs.mem = + malloc(scr->pcs.type->ncols * scr->pcs.type->nrows * 2, + M_DEVBUF, M_WAITOK); } scr = malloc(sizeof(struct egascreen), M_DEVBUF, M_WAITOK); |