Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp4817720imb; Thu, 7 Mar 2019 01:00:15 -0800 (PST) X-Google-Smtp-Source: APXvYqw6SqeV1LX+tiDKeVKdx9LylY7dhKOmj7FPiqPBSQepgXwDmOhJgpnJPCn3+4Kv7JIt4dLB X-Received: by 2002:a63:160d:: with SMTP id w13mr10251579pgl.85.1551949215255; Thu, 07 Mar 2019 01:00:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551949215; cv=none; d=google.com; s=arc-20160816; b=Km+I5UrlRrHIKLdES7RcNv9LCBrmG612TIe0Bkj3kJ4lkCzpPJfgmzxvX95Oo02cE1 FKPlKjfIhHSIiQ0z3T36bCHKIp915DfgNCayGJ2PcrGLKpCNOF5sGhqV5Id4+uiyUapK pl+tYpGRFhQzOJG47EMZyzG0NlnHr88KWAV0t9712h4HyTbAbQir5zfckDy0D/l6gtOu k5oVS3mAjVw8piOjr/o3YtFHvfCZs+yDSLe9VYVLg+HcOzCnSr9Tgq3lE/S7BZmOSRqt EqbbMlsh+4i9Vcg53xSvdJTvx2K30baAGgbEPhKkJJC0vSpfOsOQrsyJ1Ep1Du8zSUJZ 0qaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :organization:in-reply-to:subject:cc:to:from; bh=Pj8M72AYIYwyMNp6hJnfZv8vIa0oOTlU5wIbIBBG0EY=; b=wtMCdFxPg3zheGbemTpPzoVgI+j7ADEkCgGv9N9j7WF2wpFI3Sbg82CghzeBDzfM07 1CiiouViIZSWaIxPPsTMj/huzMK1xQAYIYQLcflm9wbaN6pyTJN6mfWewPHHrMY+/p5T rJG9AvU02n3jRKQwwMpZYtCaIAbT1nPPbUVAQ9TZkbQcxK7rHQ4ycyqIhfGbB1isBJB/ NDRg+2cMvrM2cUXEm3P4s2C1D8upOJoycYgInNaoM2xYKOJkrYo+WvbyP8N7+vSKb9mi bthZ44rqVUgPLF69YjGnWuxeoQ448Aikswq1M4HuW0VZIUBMYky/DbMIGuyyTfFv7T6Y l69g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q77si3760121pfi.220.2019.03.07.01.00.00; Thu, 07 Mar 2019 01:00:15 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726241AbfCGI64 (ORCPT + 99 others); Thu, 7 Mar 2019 03:58:56 -0500 Received: from mga14.intel.com ([192.55.52.115]:16908 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726143AbfCGI64 (ORCPT ); Thu, 7 Mar 2019 03:58:56 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2019 00:58:55 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,451,1544515200"; d="scan'208";a="152833159" Received: from jnikula-mobl3.fi.intel.com (HELO localhost) ([10.237.66.172]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2019 00:58:53 -0800 From: Jani Nikula To: Tom Li , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Bartlomiej Zolnierkiewicz , Sudip Mukherjee , Yifeng Li , Teddy Wang Subject: Re: Is it possible to reset graphics controller on reboot in a framebuffer driver? In-Reply-To: <20190307051641.GA7012@localhost.localdomain> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20190307051641.GA7012@localhost.localdomain> Date: Thu, 07 Mar 2019 11:00:49 +0200 Message-ID: <871s3jm532.fsf@intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 07 Mar 2019, Tom Li wrote: > Hi all. > > As you may have noticed, recently I've been working on a reworked version > of sm712fb, and planned to convert it to a DRM/KMS driver. Besides using > it on embedded/non-x86 systems, I thought it would be a good idea to support > histrocial x86 laptops with this VGA chipset as well, so I've acquired a > machine for testing. > > However, soon I found a nasty problem. The BIOS does not reset the chip > on boot! Like most graphics controller of that era, sm712 chipset has a > VGA compatible mode and a 2D framebuffer mode. The power-on default is > VGA. The BIOS writer just assumed this, and does nothing to reinitialize > it. If one uses the framebuffer driver under Linux, once the machine reboots, > the entire LCD panel becomes a piece of garbage. > > AFAIK, the framebuffer driver would be running throughout the kernel's life- > cycle, is it really possible to workaround this issue by restoring on VGA > state upon reboot? It's possible to do this using a reboot notifier. I am not sure if there are better ways to achieve the same, but there's at least one example of using reboot notifiers to achieve the exact same goal. See drivers/video/fbdev/aty/atyfb_base.c, look for register_reboot_notifier(). HTH, Jani. -- Jani Nikula, Intel Open Source Graphics Center