From patchwork Sat Apr 18 07:04:15 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6236661 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 CF933BF4A6 for ; Sat, 18 Apr 2015 07:04:35 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ED80D2038D for ; Sat, 18 Apr 2015 07:04:34 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 07C1420351 for ; Sat, 18 Apr 2015 07:04:34 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F9FD6E14D; Sat, 18 Apr 2015 00:04:33 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by gabe.freedesktop.org (Postfix) with ESMTP id F0CDA6E17F for ; Sat, 18 Apr 2015 00:04:30 -0700 (PDT) Received: by pabtp1 with SMTP id tp1so148569290pab.2 for ; Sat, 18 Apr 2015 00:04:30 -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=zcoA3ozmwk79slv0lVKBtkn0Dq5aHXkc4IKIlIXacvEz9PA11svIVKtKYDgKIyy0y+ VxnBG5GHcZ+E3W024FBUAQiVKlr7Ar+yMD+di4nXAcMdDPRsvLvcyQElIynbF5mxo/+h kMDIde+ThuJK+tMyABd3EbnMT4We/m57v7xppt/T2I4GYjckZ3Vav5kkTcRf7j5M7YES d024uaiGCIZ9R77gk0Hmhg67Yw2tfz6ltHvwRCuiHcaf8eYOKjPIuE8xHdECTesLGceS ceFb9k09KuSk4s3HjOYtOQgIxxEshErgCm9kk0aPsg5HbTFqO3y8gpQzPsj8vrihwWfU Zw2w== X-Received: by 10.68.215.9 with SMTP id oe9mr11805193pbc.146.1429340670808; Sat, 18 Apr 2015 00:04:30 -0700 (PDT) Received: from localhost.localdomain (ip70-162-72-208.ph.ph.cox.net. [70.162.72.208]) by mx.google.com with ESMTPSA id dc5sm11968427pbc.53.2015.04.18.00.04.29 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 18 Apr 2015 00:04:30 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Sat, 18 Apr 2015 00:04:15 -0700 Message-Id: <1429340659-14369-2-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429340659-14369-1-git-send-email-tprevite@gmail.com> References: <1429340659-14369-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH 1/5] 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 --- 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;