From nobody Sat Nov 23 15:03:55 2024 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4XwZx76vWgz5dPGj; Sat, 23 Nov 2024 15:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4XwZx75hPjz4HRl; Sat, 23 Nov 2024 15:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732374235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYn7tDhZFI7bfVkvgNz+q5x57bMhzMKqFFYVcUBb3E0=; b=nGooek2iVmeR+wtcEUDrR4xbTqihNWIjRAggczPtwSclPu4M+sDsHJJ6Z//nwbfwMhpZp9 szpYfj5tEDtmEwYcmyltAXCRqO05u+Ce/IYRk3j0cIWrXFTQkWMjuj7i3orZFaZAOAj0w+ gJ2pVAMOWlQgMR9LGacRYHHiZC57OMi5OyM0QIxCtitWHpDKY12G9R/UK6qKxKNYbqWxfe YO43VW9GGpmD/Km2p0rzCJGx0fkK8qiTVKOQvPcAqULPMuQKShZVDHx7tz5y+dGMVWGWSU rlKkDJ0Q4fSlz9e/a4PnfX4MYLFh1aH8flQXY28fmqFgsnAEXmJ3kfaCBp4Bng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1732374235; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gYn7tDhZFI7bfVkvgNz+q5x57bMhzMKqFFYVcUBb3E0=; b=PK8+IMB/dZv7eSPV+LhDIQ1U+9Mrk/STDcFob0iL1UL7aNL8En9lcbWwjDYNNI/dXI/gRE mEj4ilVDkwkp+nGUTE+0aqdOD1Oc0kfLu98/gy1bhKYaWbxrS+bELCxFAO2gAWxq5Uy+/Y UcmkFRZQaAHd73EQ0zeAh5ZJS12yf/v7T+kOrfPw+VDGOArOqDV1z8EuhaoRKvH4kUVcr0 /EYrP/CMUeJhxXK9gFS8kRQyOm1Mb37+Neqsiw0iEiRxbwpWVGhXXoebCtOuCCC85QzkVh uljbzcihV0LC7ndH2iRdtVUs+HmpEieToZ7iE+sQQD9uAnT0tRSJ4cqdP3fhhg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1732374235; a=rsa-sha256; cv=none; b=H9dnw/weC4bqXTsxNpXRQgjH4B6FiHvpuSAIIHE4koBf43xOLrGT7SqV0zIPutS4Vc/4+o jXWHblTEyLaKK4AnsoksqLNdiPFpoGmhYyRBy0X8juk5GJIS7rkyF8Q71uEe5IuAv6hJp+ 1ZAD/xOWtndEISOwK7juDjSfavkAk3uca37q7CzH281FqZluUPsCko4r3s7YajUL6lgZPH sjFduP79hBOFJANYK5Zw9B7WRm5UwI49PVhG/qM/IA1aRQgWgV1d/ypG6uQ132YQUG8BUO x5iImUs0xncc+hbD9UxVJGP8MxpuCwiLxvjzKx556AWjQq53fCZU2IiYhgN66g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4XwZx74MMszFDY; Sat, 23 Nov 2024 15:03:55 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 4ANF3tCP067725; Sat, 23 Nov 2024 15:03:55 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 4ANF3tJZ067722; Sat, 23 Nov 2024 15:03:55 GMT (envelope-from git) Date: Sat, 23 Nov 2024 15:03:55 GMT Message-Id: <202411231503.4ANF3tJZ067722@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Poul-Henning Kamp Subject: git: 7749de244014 - main - Add new kern.vt.slow_down tunable. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: phk X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 7749de244014a057b55552ea9d68fd8aeb262ea0 Auto-Submitted: auto-generated The branch main has been updated by phk: URL: https://cgit.FreeBSD.org/src/commit/?id=7749de244014a057b55552ea9d68fd8aeb262ea0 commit 7749de244014a057b55552ea9d68fd8aeb262ea0 Author: Poul-Henning Kamp AuthorDate: 2024-11-23 15:01:09 +0000 Commit: Poul-Henning Kamp CommitDate: 2024-11-23 15:01:09 +0000 Add new kern.vt.slow_down tunable. On a laptop with no other console devices than the screen, things scroll of the screen faster than eye or camera can capture it. This tunable slows the console down and makes it update synchronously, so console output continues when timers or interrupts do not. Differential Revision: https://reviews.freebsd.org/D47710 --- share/man/man4/vt.4 | 11 +++++++++++ sys/dev/vt/vt_core.c | 9 +++++++++ 2 files changed, 20 insertions(+) diff --git a/share/man/man4/vt.4 b/share/man/man4/vt.4 index 4c115b68a80d..d3d3c4b38013 100644 --- a/share/man/man4/vt.4 +++ b/share/man/man4/vt.4 @@ -50,6 +50,7 @@ In .Cd kern.vt.color..rgb="" .Cd kern.vt.fb.default_mode="x" .Cd kern.vt.fb.modes.="x" +.Cd kern.vt.slow_down=" .Cd screen.font="x" .Pp In @@ -266,6 +267,16 @@ It will contain a list of connectors and their associated tunables. This is currently only supported by the .Cm vt_fb backend when it is paired with a KMS video driver. +.It Va kern.vt.slow_down +When debugging the kernel on modern laptops, the screen is often +the only available console, and relevant information will scroll +out of view before it can be captured by eye or camera. +.Pp +Setting +.Va kern.vt.slow_down +to a non-zero number will make console output synchronous (ie: +not dependent on timers and interrupts) and slow it down in proportion +to the number. .It Va screen.font Set this value to the base name of the desired font file located in .Pa /boot/fonts . diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index 87020b6e6f19..1be98466112e 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -132,6 +132,9 @@ static VT_SYSCTL_INT(debug, 0, "vt(9) debug level"); static VT_SYSCTL_INT(deadtimer, 15, "Time to wait busy process in VT_PROCESS mode"); static VT_SYSCTL_INT(suspendswitch, 1, "Switch to VT0 before suspend"); +/* Slow down and dont rely on timers and interrupts */ +static VT_SYSCTL_INT(slow_down, 0, "Non-zero make console slower and synchronous."); + /* Allow to disable some keyboard combinations. */ static VT_SYSCTL_INT(kbd_halt, 1, "Enable halt keyboard combination. " "See kbdmap(5) to configure."); @@ -1657,6 +1660,12 @@ vtterm_done(struct terminal *tm) } vd->vd_flags &= ~VDF_SPLASH; vt_flush(vd); + } else if (vt_slow_down > 0) { + int i, j; + for (i = 0; i < vt_slow_down; i++) { + for (j = 0; j < 1000; j++) + vt_flush(vd); + } } else if (!(vd->vd_flags & VDF_ASYNC)) { vt_flush(vd); }