From patchwork Sun Apr 19 23:09:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6238971 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id ED826BF4A6 for ; Sun, 19 Apr 2015 23:09:20 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 129772034E for ; Sun, 19 Apr 2015 23:09:20 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 150032034A for ; Sun, 19 Apr 2015 23:09:19 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7812A6E175; Sun, 19 Apr 2015 16:09:18 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by gabe.freedesktop.org (Postfix) with ESMTP id B51716E175 for ; Sun, 19 Apr 2015 16:09:16 -0700 (PDT) Received: by pacyx8 with SMTP id yx8so187973451pac.1 for ; Sun, 19 Apr 2015 16:09:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=jMJU+AsAAG9UdGznTTcc8J+tQ2VOUtOhhlyMaZ7vo1w=; b=mEjrkWNjcyL85DEIq8DKPC3xuY/XgVdHcgGIlu2Xi/B5oUzUd7CxrUufnBpnKiekQu SXYRnWmJfEoZUQaCklcj+y5b3yziF0Kvc4db/9df2EcYXtsYxIFleutiiTndnUZwNvd/ 83IvcplsHUtT7as+QME42aT4OChc1qjrYcHtjJ2VNH1IWeyttChXcTVqhlI2eUM0XQVn CUjhGfej0C8zsoO7YK+oQDM6bMhgJQ79V4Md+bqlS0vtxncrdguZX9mAgcKyfhhz+77Q Umx3CV/0dHev88pUQ/ygSFd+lxaraF/WYAsVSQtKdQWZzP0hwANRKmyfB1SKOuBEa2kr EiGw== X-Received: by 10.70.95.228 with SMTP id dn4mr20062265pdb.89.1429484956492; Sun, 19 Apr 2015 16:09:16 -0700 (PDT) Received: from localhost.localdomain (wsip-174-67-126-70.ph.ph.cox.net. [174.67.126.70]) by mx.google.com with ESMTPSA id k4sm16153061pdg.87.2015.04.19.16.09.15 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 19 Apr 2015 16:09:15 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Sun, 19 Apr 2015 16:09:05 -0700 Message-Id: <1429484945-24494-1-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429340659-14369-2-git-send-email-tprevite@gmail.com> References: <1429340659-14369-2-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH] drm/i915: Move Displayport test request and sink IRQ logic to intel_dp_detect() 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: , MIME-Version: 1.0 Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_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 Due to changes in the driver and to support Displayport compliance testing, the test request and sink IRQ logic has been relocated from intel_dp_check_link_status to intel_dp_detect. The reason for this is that this handler should be called during the normal hot plug path for a long pulse / hot plug event only. The intel_dp_check_link_status function is called for short pulses from intel_dp_hpd_pulse(). This allows for the proper detection of Displayport compliance test requests and the invocation of the test handler to support them. Additionally, this places compliance testing in the normal operational paths, eliminating as much special case code as possible. Signed-off-by: Todd Previte Tested-By: Intel Graphics QA PRTS (Patch Regression Test System Contact: shuang.he@intel.com) --- drivers/gpu/drm/i915/intel_dp.c | 29 ++++++++++++++--------------- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 2ef05d7..55d1f5f 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4123,7 +4123,6 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) { struct drm_device *dev = intel_dp_to_dev(intel_dp); struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; - u8 sink_irq_vector; u8 link_status[DP_LINK_STATUS_SIZE]; WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); @@ -4147,20 +4146,6 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) return; } - /* Try to read the source of the interrupt */ - if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && - intel_dp_get_sink_irq(intel_dp, &sink_irq_vector)) { - /* Clear interrupt source */ - drm_dp_dpcd_writeb(&intel_dp->aux, - DP_DEVICE_SERVICE_IRQ_VECTOR, - sink_irq_vector); - - if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST) - intel_dp_handle_test_request(intel_dp); - if (sink_irq_vector & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ)) - DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n"); - } - if (!drm_dp_channel_eq_ok(link_status, intel_dp->lane_count)) { DRM_DEBUG_KMS("%s: channel EQ not ok, retraining\n", intel_encoder->base.name); @@ -4386,6 +4371,7 @@ intel_dp_detect(struct drm_connector *connector, bool force) enum drm_connector_status status; enum intel_display_power_domain power_domain; bool ret; + u8 sink_irq_vector; DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); @@ -4428,6 +4414,19 @@ intel_dp_detect(struct drm_connector *connector, bool force) intel_encoder->type = INTEL_OUTPUT_DISPLAYPORT; status = connector_status_connected; + /* Check for sink IRQ and determine cause */ + if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && + intel_dp_get_sink_irq(intel_dp, &sink_irq_vector)) { + /* Clear interrupt source */ + drm_dp_dpcd_writeb(&intel_dp->aux, + DP_DEVICE_SERVICE_IRQ_VECTOR, + sink_irq_vector); + if (sink_irq_vector & DP_AUTOMATED_TEST_REQUEST) + intel_dp_handle_test_request(intel_dp); + if (sink_irq_vector & (DP_CP_IRQ | DP_SINK_SPECIFIC_IRQ)) + DRM_DEBUG_DRIVER("CP or sink specific irq unhandled\n"); + } + out: intel_dp_power_put(intel_dp, power_domain); return status;