From patchwork Wed Aug 26 05:26:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sonika.jindal@intel.com X-Patchwork-Id: 7074351 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 644679F358 for ; Wed, 26 Aug 2015 05:27:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7568D208A1 for ; Wed, 26 Aug 2015 05:27:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 640842089F for ; Wed, 26 Aug 2015 05:27:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B4EF77A010; Tue, 25 Aug 2015 22:27:25 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E5CC7A010 for ; Tue, 25 Aug 2015 22:27:24 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 25 Aug 2015 22:27:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,414,1437462000"; d="scan'208";a="775780695" Received: from kmsmsx152.gar.corp.intel.com ([172.21.73.87]) by fmsmga001.fm.intel.com with ESMTP; 25 Aug 2015 22:27:23 -0700 Received: from bgsmsx105.gar.corp.intel.com (10.223.43.197) by KMSMSX152.gar.corp.intel.com (172.21.73.87) with Microsoft SMTP Server (TLS) id 14.3.224.2; Wed, 26 Aug 2015 13:26:59 +0800 Received: from bgsmsx104.gar.corp.intel.com ([169.254.5.127]) by BGSMSX105.gar.corp.intel.com ([169.254.3.201]) with mapi id 14.03.0224.002; Wed, 26 Aug 2015 10:56:58 +0530 From: "Jindal, Sonika" To: "Nikula, Jani" , "intel-gfx@lists.freedesktop.org" Thread-Topic: [Intel-gfx] [PATCH v2 4/7] drm/i915: add common intel_digital_port_connected function Thread-Index: AQHQ2xwjDEwNkQPI7kivhQuclwOjAp4dx3dQ Date: Wed, 26 Aug 2015 05:26:57 +0000 Message-ID: <000C66961D35964B9714611E548C10AD0C2A67AB@BGSMSX104.gar.corp.intel.com> References: <0c78700c3506f56c6db3be0bef9863fc43816ded.1440056461.git.jani.nikula@intel.com> In-Reply-To: <0c78700c3506f56c6db3be0bef9863fc43816ded.1440056461.git.jani.nikula@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.223.10.10] MIME-Version: 1.0 Cc: "Nikula, Jani" Subject: Re: [Intel-gfx] [PATCH v2 4/7] drm/i915: add common intel_digital_port_connected function 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-Spam-Status: No, score=-5.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP So, looks like I can use intel_digital_port_connected for hdmi case. In that case, we can make this function global and add a case for bxt as well. Regards, Sonika -----Original Message----- From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of Jani Nikula Sent: Thursday, August 20, 2015 1:18 PM To: intel-gfx@lists.freedesktop.org Cc: Nikula, Jani Subject: [Intel-gfx] [PATCH v2 4/7] drm/i915: add common intel_digital_port_connected function Add a common intel_digital_port_connected() that splits out to functions for different platforms. No functional changes. v2: make the function return a boolean Signed-off-by: Jani Nikula --- drivers/gpu/drm/i915/intel_dp.c | 41 ++++++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 19 deletions(-) } -static bool g4x_digital_port_connected(struct drm_device *dev, +static bool g4x_digital_port_connected(struct drm_i915_private +*dev_priv, struct intel_digital_port *port) { - struct drm_i915_private *dev_priv = dev->dev_private; uint32_t bit; - if (IS_VALLEYVIEW(dev)) { + if (IS_VALLEYVIEW(dev_priv)) { switch (port->port) { case PORT_B: bit = PORTB_HOTPLUG_LIVE_STATUS_VLV; @@ -4565,6 +4557,22 @@ static bool g4x_digital_port_connected(struct drm_device *dev, return I915_READ(PORT_HOTPLUG_STAT) & bit; } +/* + * intel_digital_port_connected - is the specified port connected? + * @dev_priv: i915 private structure + * @port: the port to test + * + * Return %true if @port is connected, %false otherwise. + */ +static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, + struct intel_digital_port *port) +{ + if (HAS_PCH_SPLIT(dev_priv)) + return ibx_digital_port_connected(dev_priv, port); + else + return g4x_digital_port_connected(dev_priv, port); } + static enum drm_connector_status ironlake_dp_detect(struct intel_dp *intel_dp) { @@ -4572,7 +4580,7 @@ ironlake_dp_detect(struct intel_dp *intel_dp) struct drm_i915_private *dev_priv = dev->dev_private; struct intel_digital_port *intel_dig_port = dp_to_dig_port(intel_dp); - if (!ibx_digital_port_connected(dev_priv, intel_dig_port)) + if (!intel_digital_port_connected(dev_priv, intel_dig_port)) return connector_status_disconnected; return intel_dp_detect_dpcd(intel_dp); @@ -4594,7 +4602,7 @@ g4x_dp_detect(struct intel_dp *intel_dp) return status; } - if (!g4x_digital_port_connected(dev, intel_dig_port)) + if (!intel_digital_port_connected(dev->dev_private, intel_dig_port)) return connector_status_disconnected; return intel_dp_detect_dpcd(intel_dp); @@ -5057,13 +5065,8 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) /* indicate that we need to restart link training */ intel_dp->train_set_valid = false; - if (HAS_PCH_SPLIT(dev)) { - if (!ibx_digital_port_connected(dev_priv, intel_dig_port)) - goto mst_fail; - } else { - if (!g4x_digital_port_connected(dev, intel_dig_port)) - goto mst_fail; - } + if (!intel_digital_port_connected(dev_priv, intel_dig_port)) + goto mst_fail; if (!intel_dp_get_dpcd(intel_dp)) { goto mst_fail; -- 2.1.4 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index f08859471841..f947951a01d4 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4473,13 +4473,6 @@ edp_detect(struct intel_dp *intel_dp) return status; } -/* - * ibx_digital_port_connected - is the specified port connected? - * @dev_priv: i915 private structure - * @port: the port to test - * - * Returns true if @port is connected, false otherwise. - */ static bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, struct intel_digital_port *port) { @@ -4524,13 +4517,12 @@ static bool ibx_digital_port_connected(struct drm_i915_private *dev_priv, return I915_READ(SDEISR) & bit;