From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: lianzhi chang <changlianzhi@uniontech.com>
Cc: linux-kernel@vger.kernel.org, dmitry.torokhov@gmail.com,
gregkh@linuxfoundation.org, jirislaby@kernel.org,
282827961@qq.com
Subject: Re: [PATCH v15] tty: Fix the keyboard led light display problem
Date: Fri, 26 Nov 2021 11:55:33 +0200 [thread overview]
Message-ID: <YaCvFYyBljlQRKth@smile.fi.intel.com> (raw)
In-Reply-To: <20211126024423.17218-1-changlianzhi@uniontech.com>
On Fri, Nov 26, 2021 at 10:44:23AM +0800, lianzhi chang wrote:
> When the desktop and tty switch mutually, the led state of the
> keyboard may be inconsistent with the state of the keyboard lock.
> This is because the desktop environment (Xorg, etc.) is bound to
> a tty, and the kb->kbdmode attribute of this tty is set to VC_OFF.
> This leads to the fact that in the desktop environment, the bound
> tty will not set the keyboard light state, so in the current tty
> scene, the values of ledstate and kb->ledflagstate are always 0.
> This leads to two situations: (1) When switching from the desktop
> to another tty, the code inside VT still compares ledstate with
> the kb->ledflagstate of the next tty. If they are equal, then
> after the switch is completed, The keyboard light will maintain
> the state of the previous desktop settings, and the state of the
> keyboard lock may be inconsistent; (2) When switching from another
> tty to the desktop, according to the code logic, it may still
> trigger the desktop bound tty to set the keyboard light state.
> After the switch is completed, the keyboard light is forcibly
> turned off. I think in this case, the tty should not set the
> keyboard light, and give control to Xorg etc. to handle it.
> The current modification judges the value of kb->kbdmode.
> In some modes, when switching VT, the current tty keyboard
> light status is forcibly issued. And when switching to the
> desktop, the tty no longer sets the keyboard light.
>
> Signed-off-by: lianzhi chang <changlianzhi@uniontech.com>
> Suggested-by: dmitry.torokhov <dmitry.torokhov@gmail.com>
I guess I have told you at least a couple of times that the format of these
lines should follow the pattern, where it's "Real Name <real@email.com>".
I truly believe there is no guy with _real_ name "dmitry.torochov".
...
> /*
> * Notifier list for console keyboard events
(1)
> @@ -412,9 +413,20 @@ static void do_compute_shiftstate(void)
> /* We still have to export this method to vt.c */
> void vt_set_leds_compute_shiftstate(void)
> {
> + /* When switching VT, according to the value of kb->kbdmode,
> + * judge whether it is necessary to force the keyboard light
> + * state to be issued.
> + */
Is it too hard to be consistent? See (1).
--
With Best Regards,
Andy Shevchenko
prev parent reply other threads:[~2021-11-26 9:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-26 2:44 [PATCH v15] tty: Fix the keyboard led light display problem lianzhi chang
2021-11-26 9:55 ` Andy Shevchenko [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YaCvFYyBljlQRKth@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=282827961@qq.com \
--cc=changlianzhi@uniontech.com \
--cc=dmitry.torokhov@gmail.com \
--cc=gregkh@linuxfoundation.org \
--cc=jirislaby@kernel.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).