Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754017AbdLMTup (ORCPT ); Wed, 13 Dec 2017 14:50:45 -0500 Received: from mx2.suse.de ([195.135.220.15]:53780 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753684AbdLMTsp (ORCPT ); Wed, 13 Dec 2017 14:48:45 -0500 From: Max Staudt To: b.zolnierkie@samsung.com, linux-fbdev@vger.kernel.org Cc: mstaudt@suse.de, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, tiwai@suse.com, oneukum@suse.com, msrb@suse.com, sndirsch@suse.com, michal@markovi.net, philm@manjaro.org, bernhard.rosenkranzer@linaro.org Subject: [RFC PATCH v2 07/13] vt: Add keyboard hook to disable bootsplash Date: Wed, 13 Dec 2017 20:47:49 +0100 Message-Id: <20171213194755.3409-8-mstaudt@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20171213194755.3409-1-mstaudt@suse.de> References: <20171213194755.3409-1-mstaudt@suse.de> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1283 Lines: 53 Let's disable the splash if the user presses ESC or F1-F12 on a VT. The F1-F12 check is to disable the splash on VT switches. Signed-off-by: Max Staudt --- drivers/tty/vt/keyboard.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index f4166263bb3a..a248429194bb 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c @@ -47,6 +47,8 @@ #include +#include + extern void ctrl_alt_del(void); /* @@ -1353,6 +1355,28 @@ static void kbd_keycode(unsigned int keycode, int down, int hw_raw) } #endif + /* Trap keys when bootsplash is shown */ + if (bootsplash_would_render_now()) { + /* Deactivate bootsplash on ESC or Alt+Fxx VT switch */ + if (keycode >= KEY_F1 && keycode <= KEY_F12) { + bootsplash_disable(); + + /* + * No return here since we want to actually + * perform the VT switch. + */ + } else { + if (keycode == KEY_ESC) + bootsplash_disable(); + + /* + * Just drop any other keys. + * Their effect would be hidden by the splash. + */ + return; + } + } + if (kbd->kbdmode == VC_MEDIUMRAW) { /* * This is extended medium raw mode, with keys above 127 -- 2.12.3