From patchwork Mon Aug 8 13:13:46 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: David Weinehall X-Patchwork-Id: 9268339 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 D52E1607D6 for ; Mon, 8 Aug 2016 13:13:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5DF3283E4 for ; Mon, 8 Aug 2016 13:13:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BAC3F283EF; Mon, 8 Aug 2016 13:13:42 +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=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 22BB3283E4 for ; Mon, 8 Aug 2016 13:13:42 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E1CCA6E335; Mon, 8 Aug 2016 13:13:40 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by gabe.freedesktop.org (Postfix) with ESMTP id A86FB6E335 for ; Mon, 8 Aug 2016 13:13:40 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga102.jf.intel.com with ESMTP; 08 Aug 2016 06:13:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.28,490,1464678000"; d="scan'208"; a="1021634009" Received: from dweineha-mobl3.fi.intel.com (HELO boom) ([10.237.72.72]) by fmsmga001.fm.intel.com with ESMTP; 08 Aug 2016 06:13:38 -0700 Date: Mon, 8 Aug 2016 16:13:46 +0300 From: David Weinehall To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= Message-ID: <20160808131345.ht6abxaaflvdrjes@boom> Mail-Followup-To: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= , Clint Taylor , intel-gfx@lists.freedesktop.org, Paulo Zanoni References: <1470231378-10656-1-git-send-email-ville.syrjala@linux.intel.com> <57A516FF.6000505@intel.com> <20160808125241.GF4329@intel.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20160808125241.GF4329@intel.com> X-Editor: Vi Improved X-Accept-Language: Swedish, English X-GPG-Fingerprint: ED69 8CF5 6102 21B9 AFD1 9DB7 0B27 96FD 15DA A404 X-GPG-Key: http://www.acc.umu.se/~tao/files/pub_15daa404.gpg.asc X-Clacks-Overhead: GNU Terry Pratchett User-Agent: Mutt/1.6.2-neo (2016-07-23) Cc: intel-gfx@lists.freedesktop.org, Paulo Zanoni Subject: Re: [Intel-gfx] [PATCH] drm/i915: Shut down displays gracefully on reboot X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Aug 08, 2016 at 03:52:41PM +0300, Ville Syrjälä wrote: > On Fri, Aug 05, 2016 at 03:45:19PM -0700, Clint Taylor wrote: > > On 08/03/2016 06:36 AM, ville.syrjala@linux.intel.com wrote: > > > From: Ville Syrjälä > > > > > > Dell UP2414Q doesn't like it when we're driving it in MST mode, and then > > > reboot the machine. After reboot, the monitor is somehow confused and > > > refuses to do the payload allocation: > > > [drm:drm_dp_mst_allocate_vcpi] initing vcpi for 282 8 > > > [drm:drm_dp_dpcd_write_payload] status not set after read payload table status 0 > > > and thus we're left with a black screen until the monitor power is > > > toggled. > > > > > > It seems that if we shut down things gracefully prior to rebooting, the > > > monitor doesn't get confused like this. So let's try to shut down all > > > the displays gracefully on reboot. The downside is that we will > > > introduce the reboot notifier to all the modesetl locks. So if there's > > > a locking bug around, we might not be able to reboot the machine > > > gracefully. sysrq reboot will still work though, as it will not > > > call the notifiers. > > > > > > While we do this, we can eliminate the eDP reboot notifier, which is > > > there to shut down the panel power and make sure the firmware won't > > > violate the panel power cycle delay post-reboot. Since we're now > > > shutting eDP down properly, we can mostly just rip out the eDP notifier. > > > We still need to do the panel power cycle wait though, as that would > > > normally get postponed until the next modeset. So let's move that part > > > into intel_panel so that other display types will get the same treatment > > > as a bonus. > > > > > > The Dell UP2414Q can often get even more confused, and sometimes what > > > you have to do is: switch to another input on the monitor, toggle the > > > monitor power, switch the input back to the original setting. And > > > sometimes it seems you just have to yank the power cable entirely. I'm > > > not sure if this reboot notifier might avoid some of these other > > > failure modes as well, but I'm pretty sure it can't hurt at least. > > > > > > > While testing this change on SKL if 2 crtc's are enabled resume from > > suspend is 500ms longer than a single crtc resume. Are we calling the > > T12 msleep(500) for non eDP panels? > > Seems unlikely, unless we misdetect DP as eDP. 500ms sure sounds a lot > for non-eDP though. You can try this patch to get easy access to the timings to see if they seem reasonable: commit 7e88e096931065efebd43d844fe3bf106932a9fa Author: David Weinehall Date: Thu Jul 21 13:36:49 2016 +0300 drm/i915/debugfs: Add panel delays for eDP The eDP backlight and panel enable/disable delays are quite useful to know when measuring time consumed by suspend/resume, and while the information are printed to the kernel log as debug messages, having this information in debugfs makes things easier. Signed-off-by: David Weinehall diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index e726b02bdb5a..282d6716d012 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -5544,6 +5544,40 @@ static const struct file_operations i915_dpcd_fops = { .release = single_release, }; +static int i915_panel_show(struct seq_file *m, void *data) +{ + struct drm_connector *connector = m->private; + struct intel_dp *intel_dp = + enc_to_intel_dp(&intel_attached_encoder(connector)->base); + + if (connector->status != connector_status_connected) + return -ENODEV; + + seq_printf(m, "Panel power up delay: %d\n", + intel_dp->panel_power_up_delay); + seq_printf(m, "Panel power down delay: %d\n", + intel_dp->panel_power_down_delay); + seq_printf(m, "Backlight on delay: %d\n", + intel_dp->backlight_on_delay); + seq_printf(m, "Backlight off delay: %d\n", + intel_dp->backlight_off_delay); + + return 0; +} + +static int i915_panel_open(struct inode *inode, struct file *file) +{ + return single_open(file, i915_panel_show, inode->i_private); +} + +static const struct file_operations i915_panel_fops = { + .owner = THIS_MODULE, + .open = i915_panel_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + /** * i915_debugfs_connector_add - add i915 specific connector debugfs files * @connector: pointer to a registered drm_connector @@ -5563,8 +5597,12 @@ int i915_debugfs_connector_add(struct drm_connector *connector) if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort || connector->connector_type == DRM_MODE_CONNECTOR_eDP) - debugfs_create_file("i915_dpcd", S_IRUGO, root, connector, - &i915_dpcd_fops); + debugfs_create_file("i915_dpcd", S_IRUGO, root, + connector, &i915_dpcd_fops); + + if (connector->connector_type == DRM_MODE_CONNECTOR_eDP) + debugfs_create_file("i915_panel_timings", S_IRUGO, root, + connector, &i915_panel_fops); return 0; }