From nobody Sat Feb 17 21:32:33 2024 X-Original-To: dev-commits-src-all@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 4Tchpn5n2Rz59kcr; Sat, 17 Feb 2024 21:32:33 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Tchpn4DYxz4ghg; Sat, 17 Feb 2024 21:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708205553; 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=MzH0gT0tnqqOEGgE45bhS44Qa+P/oEEfKAmU8a4tHBY=; b=fq2XyuXCONOciCnRtrsPvWI+398pHmXINpZit/1x6dfqkRvJyLqBnlnbNvkPyARj1YJEHT Zlrzeb44sYmPRNv7ImRFLG6pVfZJ5BzZE/Oc6w3gV0TbODs3sCll97Zy/V9DBmwINF9hk4 sexHP/EcOD7oNW1jw1nPFWdXvBtygVlbvCJ3am6Tj0nI48ZV7DMjxVdFXxWjlmPgrJ4Ce9 cz8J2v2ZGHhdsZM1nIR61yyvWed8EFUt9Q2+5TMCfL2+xh6MZNevtz+4nvLrO8K7QzZB9H nKEhSSaiqPMRZXSHY6E26bVKdqmdFmfioaiC5NEc0mEsNVHHR/4Gq0E5/UTaiQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1708205553; 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=MzH0gT0tnqqOEGgE45bhS44Qa+P/oEEfKAmU8a4tHBY=; b=cljFq4t6s6epUL1WrZ0hT1UARhHfqdCP73t0CwCuW6JZn10rP3C/w8jDt6R9bJ/oFl3VOA QHKDPZTi1WSJPBE24SsFkQPvoFVpNbg/8kAAX3yDcubOXM/JBuoO8/v7242y5sdUtBHXk7 DZyX+boIBGxW81zsX4grdq/y6ZHH0Wkjer/AOTilZ0wovGCWR4/qg2JnvgC7o6oOKdYpmB lBkhk7wP72ga0NGwPyfxLdqjoPKBuAxzXzfB51ldex7ycTybFHBQX3baG9Qssw9ki/+1OU siO4DZMf0nf92b6BckS3eBtgzeq0GchBPxJ5RnIVCBwjJlAVIaz4NLb5ABx2vg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1708205553; a=rsa-sha256; cv=none; b=gDD2GICNLCgZdfP+0JRmUcJcj4NC8jyHxl71NEgHZiicgNSwxQfXWT6PJOrNYM1uaCi0eH 3Bl0Ie2NnGm5U/SvEq6oiCIOGCBEqcgGYq1ck/TnMsyGyIb/qzpqa4aTwewaFbne83cR0/ Ck40H+jhXB9oRz9l9qL1CJtEx2rbqnCiP4DbRFTpLQ1gJlNdaL9AC2FnulITheuKndq2L3 4IY2/bPbRCD1JCiPvkxAA1KAQNN6LcByBGQNjDIdl4Y0w/KglMYP8UM7uVBXTv3pKU3kE5 zwjQDWPMoOfscpZIEOWg7dpnunstkzuFW4akVzAi9fLuyy1E4joUjpbZ0RwI+g== 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 4Tchpn2MB4zPbC; Sat, 17 Feb 2024 21:32:33 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 41HLWXnq019696; Sat, 17 Feb 2024 21:32:33 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 41HLWXTr019693; Sat, 17 Feb 2024 21:32:33 GMT (envelope-from git) Date: Sat, 17 Feb 2024 21:32:33 GMT Message-Id: <202402172132.41HLWXTr019693@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: fc00c0377974 - stable/14 - vt(4): Always call vt_window_switch() in vtterm_cnungrab() List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: fc00c037797457c4bf7e06c207297bf06cc92f33 Auto-Submitted: auto-generated The branch stable/14 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=fc00c037797457c4bf7e06c207297bf06cc92f33 commit fc00c037797457c4bf7e06c207297bf06cc92f33 Author: Jean-Sébastien Pédron AuthorDate: 2023-11-24 17:30:35 +0000 Commit: Vladimir Kondratyev CommitDate: 2024-02-17 20:58:34 +0000 vt(4): Always call vt_window_switch() in vtterm_cnungrab() [Why] This ensures that vtterm_cnungrab() is the mirror of vtterm_cngrab(). And the latter always call vt_window_switch() and thus the backend's vd_postswitch(). This makes sure that whatever the backend did during vtterm_cngrab(), it can undo it during vtterm_cnungrab(). Reviewed by: manu Approved by: manu Differential Revision: https://reviews.freebsd.org/D42752 (cherry picked from commit f18b3ce0b7be0b24a743ec59077ca8e7929a353c) --- sys/dev/vt/vt_core.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/sys/dev/vt/vt_core.c b/sys/dev/vt/vt_core.c index bfd99665be4a..4a1031f1aa69 100644 --- a/sys/dev/vt/vt_core.c +++ b/sys/dev/vt/vt_core.c @@ -2046,7 +2046,7 @@ static void vtterm_cnungrab(struct terminal *tm) { struct vt_device *vd; - struct vt_window *vw; + struct vt_window *vw, *grabwindow; vw = tm->tm_softc; vd = vw->vw_device; @@ -2055,10 +2055,19 @@ vtterm_cnungrab(struct terminal *tm) if (vtterm_cnungrab_noswitch(vd, vw) != 0) return; - if (!cold && vd->vd_grabwindow != vw) - vt_window_switch(vd->vd_grabwindow); - + /* + * We set `vd_grabwindow` to NULL before calling vt_window_switch() + * because it allows the underlying vt(4) backend to distinguish a + * "grab" from an "ungrab" of the console. + * + * This is used by `vt_drmfb` in drm-kmod to call either + * fb_debug_enter() or fb_debug_leave() appropriately. + */ + grabwindow = vd->vd_grabwindow; vd->vd_grabwindow = NULL; + + if (!cold) + vt_window_switch(grabwindow); } static void