summaryrefslogtreecommitdiffstats
path: root/sys/dev/vt/vt_buf.c
diff options
context:
space:
mode:
authorray <ray@FreeBSD.org>2014-06-16 11:26:30 +0000
committerray <ray@FreeBSD.org>2014-06-16 11:26:30 +0000
commit720dde12b535f530bea4077e6db9a11dc6fa5307 (patch)
treeec1082f2424473fee011b71d38fa2c47a3de9cfc /sys/dev/vt/vt_buf.c
parent6e05704f9e054f17171106ad4c859f761376bb6f (diff)
downloadFreeBSD-src-720dde12b535f530bea4077e6db9a11dc6fa5307.zip
FreeBSD-src-720dde12b535f530bea4077e6db9a11dc6fa5307.tar.gz
MFC 262785 263183 264182 264999 265391 265392 265395 265397 265398 265402 265403
265442 265546 265680 265681 265719 265862 265864 265867 265927 266010 266495 266540 266835 266856 266861 266862 267007 267310. 265391 Define a new method for probing vt(4) driver before attach it at early stage. 265392 Create dataset for vt(4) drivers. 265395 Set of updates to vt(4) core part. o Declare vt(4) drivers dataset. o Create single static structures for all early drivers. o Add vt(4) to be by default in the kernel consoles list. o Create one more sysinit point, to be able to initialize memory and lock requirement of early drivers. o Implement early drivers select. (Only best available will be selected). o Fix one missed "return (0)" for VTYLOCK. o Improve locking for cases when one driver replace another. o Make driver replacement notification less debug-look-like. o Minor spell fixes. 265397 Switch fb and efifb drivers to use names and new vt(4) driver probe method. 265398 Add vt(4) driver name for ofwfb driver. 265402 Revert r264997 and r265026. It is not required anymore. 265403 Switch vga drivers to use names and new vt(4) driver probe method. 265442 Implement KDMKTONE ioctl. 265546 Fix possible divide by zero. 265680 No need to assign fields required and checked on probe. 265681 Fix scrollback. 265719 Hide debug messages under VT_DEBUG. 265927 Update terminal sizes in any case when new vt(4) driver arrive. (Plus remove one unused newline) 266010 Remove extra newlines. No functional changes. 266495 Fix tty locking. o Correct expected values for VT_LOCKSWITCH ioctl. o Check current window for locked state. 266540 Proper fix of VT_LOCKSWITCH ioctl. 266835 Remove driver as unused. 267007 Fix case when vt(4) started w/o driver assigned. o Always init locks and cv ASAP. o Initialize driver-independent parts even if driver probing fail. o Allow to call vt_upgrade anytime, for later loaded drivers. o New window flag VWF_READY, to track if window already initialized. Other updates: o Pass vd as a cookie for kbd_allocate. o Do not blank window on driver replacement. Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'sys/dev/vt/vt_buf.c')
-rw-r--r--sys/dev/vt/vt_buf.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sys/dev/vt/vt_buf.c b/sys/dev/vt/vt_buf.c
index 0b078ec..d8602f8 100644
--- a/sys/dev/vt/vt_buf.c
+++ b/sys/dev/vt/vt_buf.c
@@ -357,17 +357,17 @@ void
vtbuf_fill_locked(struct vt_buf *vb, const term_rect_t *r, term_char_t c)
{
KASSERT(r->tr_begin.tp_row < vb->vb_scr_size.tp_row,
- ("vtbuf_fill_locked begin.tp_row %d must be < screen width %d",
+ ("vtbuf_fill_locked begin.tp_row %d must be < screen height %d",
r->tr_begin.tp_row, vb->vb_scr_size.tp_row));
KASSERT(r->tr_begin.tp_col < vb->vb_scr_size.tp_col,
- ("vtbuf_fill_locked begin.tp_col %d must be < screen height %d",
+ ("vtbuf_fill_locked begin.tp_col %d must be < screen width %d",
r->tr_begin.tp_col, vb->vb_scr_size.tp_col));
KASSERT(r->tr_end.tp_row <= vb->vb_scr_size.tp_row,
- ("vtbuf_fill_locked end.tp_row %d must be <= screen width %d",
+ ("vtbuf_fill_locked end.tp_row %d must be <= screen height %d",
r->tr_end.tp_row, vb->vb_scr_size.tp_row));
KASSERT(r->tr_end.tp_col <= vb->vb_scr_size.tp_col,
- ("vtbuf_fill_locked end.tp_col %d must be <= screen height %d",
+ ("vtbuf_fill_locked end.tp_col %d must be <= screen width %d",
r->tr_end.tp_col, vb->vb_scr_size.tp_col));
VTBUF_LOCK(vb);
@@ -448,8 +448,9 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, int history_size)
history_size = MAX(history_size, p->tp_row);
- if (history_size > vb->vb_history_size || p->tp_col >
- vb->vb_scr_size.tp_col) {
+ /* If new screen/history size bigger or buffer is VBF_STATIC. */
+ if ((history_size > vb->vb_history_size) || (p->tp_col >
+ vb->vb_scr_size.tp_col) || (vb->vb_flags & VBF_STATIC)) {
/* Allocate new buffer. */
bufsize = history_size * p->tp_col * sizeof(term_char_t);
new = malloc(bufsize, M_VTBUF, M_WAITOK | M_ZERO);
@@ -495,6 +496,9 @@ vtbuf_grow(struct vt_buf *vb, const term_pos_t *p, int history_size)
/* Deallocate old buffer. */
free(old, M_VTBUF);
free(oldrows, M_VTBUF);
+ } else {
+ /* Just update the size. */
+ vb->vb_scr_size = *p;
}
}
OpenPOWER on IntegriCloud