From patchwork Wed Sep 14 11:14:35 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jani Nikula X-Patchwork-Id: 9331209 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 F02DE60231 for ; Wed, 14 Sep 2016 11:14:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E04DD29CC5 for ; Wed, 14 Sep 2016 11:14:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D1C2229CCB; Wed, 14 Sep 2016 11:14:46 +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 B96ED29CC5 for ; Wed, 14 Sep 2016 11:14:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AC4C6E240; Wed, 14 Sep 2016 11:14:42 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTPS id DC1476E092; Wed, 14 Sep 2016 11:14:39 +0000 (UTC) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 14 Sep 2016 04:14:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.30,333,1470726000"; d="scan'208"; a="1055805479" Received: from jnikula-mobl.fi.intel.com (HELO localhost) ([10.237.72.162]) by fmsmga002.fm.intel.com with ESMTP; 14 Sep 2016 04:14:36 -0700 From: Jani Nikula To: Pavel Machek , Martin Steigerwald In-Reply-To: <87h99isuv2.fsf@intel.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo References: <20160913202350.GA30707@amd> <20160913210437.GA4097@amd> <87y42vrkwl.fsf@intel.com> <20160914075410.GA7540@amd> <87h99isuv2.fsf@intel.com> User-Agent: Notmuch/0.22.1+63~g648dcc7 (https://notmuchmail.org) Emacs/24.4.1 (x86_64-pc-linux-gnu) Date: Wed, 14 Sep 2016 14:14:35 +0300 Message-ID: <87h99iraw4.fsf@intel.com> MIME-Version: 1.0 Cc: daniel.vetter@intel.com, intel-gfx@lists.freedesktop.org, "Rafael J. Wysocki" , kernel list , dri-devel@lists.freedesktop.org Subject: Re: [Intel-gfx] 4.8-rc1: it is now common that machine needs re-run of xrandr after resume 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 Wed, 14 Sep 2016, Jani Nikula wrote: > On Wed, 14 Sep 2016, Pavel Machek wrote: >> For the "sometimes need xrandr after resume": I don't think I can >> bisect that. It only happens sometimes :-(. But there's something >> helpful in the logs: > >> [ 1856.218863] [drm:drm_edid_block_valid] *ERROR* EDID checksum is >> invalid, remainder is 130 >> [ 1856.218863] Raw EDID: >> [ 1856.218863] 00 ff ff ff ff ff ff 00 ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] [drm:drm_edid_block_valid] *ERROR* EDID checksum is >> invalid, remainder is 130 >> [ 1856.218863] Raw EDID: >> [ 1856.218863] 00 ff ff ff ff ff ff 00 ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] [drm:drm_edid_block_valid] *ERROR* EDID checksum is >> invalid, remainder is 130 >> [ 1856.218863] Raw EDID: >> [ 1856.218863] 00 ff ff ff ff ff ff 00 ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] [drm:drm_edid_block_valid] *ERROR* EDID checksum is >> invalid, remainder is 130 >> [ 1856.218863] Raw EDID: >> [ 1856.218863] 00 ff ff ff ff ff ff 00 ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff ff >> [ 1856.218863] i915 0000:00:02.0: HDMI-A-1: EDID block 0 invalid. > > Pavel, Martin, do you always see this when the display fails to resume? > Is it HDMI/DVI for both of you? Please try this patch, backported from our next. BR, Jani. From c5cec7b2df1a518a632998aecd6f73f3fefe59ec Mon Sep 17 00:00:00 2001 From: David Weinehall Date: Wed, 17 Aug 2016 15:47:48 +0300 Subject: [PATCH] Revert "drm/i915: Check live status before reading edid" Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Cc: Jani Nikula This reverts commit 237ed86c693d8a8e4db476976aeb30df4deac74b. Our current implementation of live status check (repeat 9 times with 10ms delays between each attempt as a workaround for buggy displays) imposes a rather serious penalty, time wise, on intel_hdmi_detect(). Since we we already skip live status checks on platforms before gen 7, and since we seem to have coped quite well before the live status check was introduced for newer platforms too, the previous behaviour is probably preferable, at least unless someone can point to a use-case that the live status check improves (apart from "Bspec says so".) Signed-off-by: David Weinehall Fixes: 237ed86c693d ("drm/i915: Check live status before reading edid") Fixes: f8d03ea0053b ("drm/i915: increase the tries for HDMI hotplug live status checking") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97139 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=94014 Acked-by: Chris Wilson Cc: stable@vger.kernel.org # v4.4+ Signed-off-by: Jani Nikula Link: http://patchwork.freedesktop.org/patch/msgid/20160817124748.31208-1-david.weinehall@linux.intel.com Conflicts: drivers/gpu/drm/i915/intel_drv.h --- drivers/gpu/drm/i915/intel_dp.c | 2 +- drivers/gpu/drm/i915/intel_drv.h | 2 -- drivers/gpu/drm/i915/intel_hdmi.c | 43 +++++++++------------------------------ 3 files changed, 11 insertions(+), 36 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 21b04c3eda41..81c9b89b7a38 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4148,7 +4148,7 @@ static bool bxt_digital_port_connected(struct drm_i915_private *dev_priv, * * Return %true if @port is connected, %false otherwise. */ -bool intel_digital_port_connected(struct drm_i915_private *dev_priv, +static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, struct intel_digital_port *port) { if (HAS_PCH_IBX(dev_priv)) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index ff399b9a5c1f..2c74213a8467 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -1387,8 +1387,6 @@ void intel_edp_drrs_disable(struct intel_dp *intel_dp); void intel_edp_drrs_invalidate(struct drm_device *dev, unsigned frontbuffer_bits); void intel_edp_drrs_flush(struct drm_device *dev, unsigned frontbuffer_bits); -bool intel_digital_port_connected(struct drm_i915_private *dev_priv, - struct intel_digital_port *port); void intel_dp_program_link_training_pattern(struct intel_dp *intel_dp, diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 4df9f384910c..c3aa9e670d15 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -1422,24 +1422,22 @@ intel_hdmi_dp_dual_mode_detect(struct drm_connector *connector, bool has_edid) } static bool -intel_hdmi_set_edid(struct drm_connector *connector, bool force) +intel_hdmi_set_edid(struct drm_connector *connector) { struct drm_i915_private *dev_priv = to_i915(connector->dev); struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); - struct edid *edid = NULL; + struct edid *edid; bool connected = false; - if (force) { - intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); + intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); - edid = drm_get_edid(connector, - intel_gmbus_get_adapter(dev_priv, - intel_hdmi->ddc_bus)); + edid = drm_get_edid(connector, + intel_gmbus_get_adapter(dev_priv, + intel_hdmi->ddc_bus)); - intel_hdmi_dp_dual_mode_detect(connector, edid != NULL); + intel_hdmi_dp_dual_mode_detect(connector, edid != NULL); - intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); - } + intel_display_power_put(dev_priv, POWER_DOMAIN_GMBUS); to_intel_connector(connector)->detect_edid = edid; if (edid && edid->input & DRM_EDID_INPUT_DIGITAL) { @@ -1465,37 +1463,16 @@ static enum drm_connector_status intel_hdmi_detect(struct drm_connector *connector, bool force) { enum drm_connector_status status; - struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); struct drm_i915_private *dev_priv = to_i915(connector->dev); - bool live_status = false; - unsigned int try; DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); - for (try = 0; !live_status && try < 9; try++) { - if (try) - msleep(10); - live_status = intel_digital_port_connected(dev_priv, - hdmi_to_dig_port(intel_hdmi)); - } - - if (!live_status) { - DRM_DEBUG_KMS("HDMI live status down\n"); - /* - * Live status register is not reliable on all intel platforms. - * So consider live_status only for certain platforms, for - * others, read EDID to determine presence of sink. - */ - if (INTEL_INFO(dev_priv)->gen < 7 || IS_IVYBRIDGE(dev_priv)) - live_status = true; - } - intel_hdmi_unset_edid(connector); - if (intel_hdmi_set_edid(connector, live_status)) { + if (intel_hdmi_set_edid(connector)) { struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; @@ -1521,7 +1498,7 @@ intel_hdmi_force(struct drm_connector *connector) if (connector->status != connector_status_connected) return; - intel_hdmi_set_edid(connector, true); + intel_hdmi_set_edid(connector); hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; }