From patchwork Wed Jan 17 20:54:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: 'Max Staudt X-Patchwork-Id: 10171605 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 03511603ED for ; Wed, 17 Jan 2018 20:59:07 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E9523228C9 for ; Wed, 17 Jan 2018 20:59:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DDE4322B1F; Wed, 17 Jan 2018 20:59:06 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 88FC5228C9 for ; Wed, 17 Jan 2018 20:59:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755026AbeAQU6q (ORCPT ); Wed, 17 Jan 2018 15:58:46 -0500 Received: from mx2.suse.de ([195.135.220.15]:34434 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932082AbeAQU4K (ORCPT ); Wed, 17 Jan 2018 15:56:10 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 5F4BDAF6C; Wed, 17 Jan 2018 20:56:06 +0000 (UTC) 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, kernel.max@enpas.org Subject: [RFC PATCH v3 07/13] vt: Add keyboard hook to disable bootsplash Date: Wed, 17 Jan 2018 21:54:29 +0100 Message-Id: <20180117205435.2860-8-mstaudt@suse.de> X-Mailer: git-send-email 2.12.3 In-Reply-To: <20180117205435.2860-1-mstaudt@suse.de> References: <20180117205435.2860-1-mstaudt@suse.de> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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