From patchwork Sat Mar 16 22:25:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yifeng Li X-Patchwork-Id: 10856083 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8F6A913B5 for ; Sat, 16 Mar 2019 22:25:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7727129CCE for ; Sat, 16 Mar 2019 22:25:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B11D29CD1; Sat, 16 Mar 2019 22:25:39 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,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 1FE2729CCE for ; Sat, 16 Mar 2019 22:25:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727233AbfCPWZi (ORCPT ); Sat, 16 Mar 2019 18:25:38 -0400 Received: from tomli.me ([153.92.126.73]:56126 "EHLO tomli.me" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726418AbfCPWZh (ORCPT ); Sat, 16 Mar 2019 18:25:37 -0400 Received: from tomli.me (localhost [127.0.0.1]) by tomli.me (OpenSMTPD) with ESMTP id c24c834c; Sat, 16 Mar 2019 22:25:34 +0000 (UTC) X-HELO: localhost.lan Authentication-Results: tomli.me; auth=pass (login) smtp.auth=tomli Received: from Unknown (HELO localhost.lan) (2402:f000:1:1501:200:5efe:6fc7:8b2c) by tomli.me (qpsmtpd/0.95) with ESMTPSA (DHE-RSA-CHACHA20-POLY1305 encrypted); Sat, 16 Mar 2019 22:25:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=tomli.me; h=from:to:cc:subject:date:message-id:in-reply-to:references:mime-version:content-transfer-encoding; s=1490979754; bh=a+rMub2vZtwc96/4+FBQHgZRTvW7Soc2ak2NjAW/PSs=; b=lSlmxo1FqbI+njadjF/NB8Tbtd3LWiIE+F8ldjDURTNZyAX/DrXPmCHSJuP438FCAJvQyhJBWbkUWr8okxWghwqs9vHz1AT0lNbovLdSR54IjH5HghofXSL+E4EDTiHueGpqczstxTtSkbgOmQY+ruwZUnPIvfCiTdE/m3PXvb7zlJthzHQaNJhUPWaXWiyDWpaSn1EDNrulFqFOCdSPNxq4A/WG4E3JU+yC4jR/8Gi3ga0fJgaqXe3e/9clB+JWyVslPsLL4+XZFngkLJyo3me6nXTgurZYp7COpddaAyH77GsdxCI8AGpxeYljEW+h5yCNgvioPHJOQP12ydo5Vw== From: Yifeng Li To: Sudip Mukherjee , Teddy Wang Cc: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Yifeng Li , stable@vger.kernel.org Subject: [PATCH 4/8] fbdev: sm712fb: fix boot screen glitch when sm712fb replaces VGA. Date: Sun, 17 Mar 2019 06:25:00 +0800 Message-Id: <20190316222504.27170-5-tomli@tomli.me> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190316222504.27170-1-tomli@tomli.me> References: <20190316222504.27170-1-tomli@tomli.me> MIME-Version: 1.0 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 When the machine is booted in VGA mode, loading sm712fb would cause a glitch of random pixels shown on the screen. To prevent it from happening, we first clear the entire framebuffer, and we also need to stop calling smtcfb_setmode() during initialization, the fbdev layer will call it for us later when it's ready. Signed-off-by: Yifeng Li Cc: stable@vger.kernel.org # v4.4+ Tested-by: Sudip Mukherjee --- drivers/video/fbdev/sm712fb.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/video/fbdev/sm712fb.c b/drivers/video/fbdev/sm712fb.c index 1a3d232c2916..e8149f0f47d5 100644 --- a/drivers/video/fbdev/sm712fb.c +++ b/drivers/video/fbdev/sm712fb.c @@ -1493,7 +1493,11 @@ static int smtcfb_pci_probe(struct pci_dev *pdev, if (err) goto failed; - smtcfb_setmode(sfb); + /* + * The screen would be temporarily garbled when sm712fb takes over + * vesafb or VGA text mode. Zero the framebuffer. + */ + memset_io(sfb->lfb, 0, sfb->fb->fix.smem_len); err = register_framebuffer(info); if (err < 0)