From patchwork Wed Dec 21 22:49:10 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chrisanthus, Anitha" X-Patchwork-Id: 9483859 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 4BDDF601D2 for ; Wed, 21 Dec 2016 22:44:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3B0FC2848C for ; Wed, 21 Dec 2016 22:44:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C18C2849D; Wed, 21 Dec 2016 22:44: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 B35772848C for ; Wed, 21 Dec 2016 22:44:45 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25DA16ED38; Wed, 21 Dec 2016 22:44:41 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) by gabe.freedesktop.org (Postfix) with ESMTPS id 505756ED38 for ; Wed, 21 Dec 2016 22:44:39 +0000 (UTC) Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 21 Dec 2016 14:44:38 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,385,1477983600"; d="scan'208";a="45210578" Received: from fmsmsx108.amr.corp.intel.com ([10.18.124.206]) by orsmga005.jf.intel.com with ESMTP; 21 Dec 2016 14:44:38 -0800 Received: from fmsmsx152.amr.corp.intel.com (10.18.125.5) by FMSMSX108.amr.corp.intel.com (10.18.124.206) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 21 Dec 2016 14:44:38 -0800 Received: from achrisan-desktop.fm.intel.com (10.1.200.107) by FMSMSX152.amr.corp.intel.com (10.18.125.5) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 21 Dec 2016 14:44:38 -0800 From: Anitha Chrisanthus To: Date: Wed, 21 Dec 2016 14:49:10 -0800 Message-ID: <1482360550-7909-1-git-send-email-anitha.chrisanthus@intel.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.1.200.107] Cc: "Chrisanthus, Anitha" Subject: [Intel-gfx] [PATCH] drm/i915: moved edid read from _force() to _get_modes() 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 From: "Chrisanthus, Anitha" When the connector is forced ON and firmware EDID is provided, driver still tries to read the EDID from the sink device, this can increase the driver's start up time by ~25ms per attempt. This change is to fix this problem. By moving the point where we attempt to read EDID from the hdmi and dp _force functions to the corresponding _get_modes() functions we only attempt to read EDID if EDID firmware is not provided or if there is no valid EDID. This change should have no effect on the general case where the EDID is normally read during the hdmi or dp _detect() call. Signed-off-by: Chrisanthus, Anitha --- drivers/gpu/drm/i915/intel_dp.c | 31 +++++++++++++++++++++---------- drivers/gpu/drm/i915/intel_hdmi.c | 14 ++++++++------ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 66b5bc8..0fcecc9 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4563,23 +4563,13 @@ intel_dp_force(struct drm_connector *connector) { struct intel_dp *intel_dp = intel_attached_dp(connector); struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; - struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); - enum intel_display_power_domain power_domain; DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); - intel_dp_unset_edid(intel_dp); if (connector->status != connector_status_connected) return; - power_domain = intel_display_port_aux_power_domain(intel_encoder); - intel_display_power_get(dev_priv, power_domain); - - intel_dp_set_edid(intel_dp); - - intel_display_power_put(dev_priv, power_domain); - if (intel_encoder->type != INTEL_OUTPUT_EDP) intel_encoder->type = INTEL_OUTPUT_DP; } @@ -4588,8 +4578,29 @@ static int intel_dp_get_modes(struct drm_connector *connector) { struct intel_connector *intel_connector = to_intel_connector(connector); struct edid *edid; + struct intel_dp *intel_dp = intel_attached_dp(connector); + struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; + struct drm_i915_private *dev_priv = to_i915(intel_encoder->base.dev); + enum intel_display_power_domain power_domain; edid = intel_connector->detect_edid; + if ((edid == NULL) && + (connector->status == connector_status_connected)) { + + intel_dp_unset_edid(intel_dp); + + power_domain = + intel_display_port_aux_power_domain(intel_encoder); + intel_display_power_get(dev_priv, power_domain); + + intel_dp_detect_dpcd(intel_dp); + + intel_dp_set_edid(intel_dp); + + intel_display_power_put(dev_priv, power_domain); + + edid = intel_connector->detect_edid; + } if (edid) { int ret = intel_connector_update_modes(connector, edid); if (ret) diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 0bcfead..e2f8bde 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -1520,12 +1520,9 @@ intel_hdmi_force(struct drm_connector *connector) DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); - intel_hdmi_unset_edid(connector); - if (connector->status != connector_status_connected) return; - intel_hdmi_set_edid(connector); hdmi_to_dig_port(intel_hdmi)->base.type = INTEL_OUTPUT_HDMI; } @@ -1534,9 +1531,14 @@ static int intel_hdmi_get_modes(struct drm_connector *connector) struct edid *edid; edid = to_intel_connector(connector)->detect_edid; - if (edid == NULL) - return 0; - + if ((edid == NULL) && + (connector->status == connector_status_connected)) { + intel_hdmi_unset_edid(connector); + intel_hdmi_set_edid(connector); + edid = to_intel_connector(connector)->detect_edid; + if (edid == NULL) + return 0; + } return intel_connector_update_modes(connector, edid); }