From patchwork Wed Apr 15 17:15:04 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6222011 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 EC1DABF4A6 for ; Wed, 15 Apr 2015 17:15:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 01C4B2015E for ; Wed, 15 Apr 2015 17:15:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 266F220131 for ; Wed, 15 Apr 2015 17:15:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 68B9589B12; Wed, 15 Apr 2015 10:15:17 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by gabe.freedesktop.org (Postfix) with ESMTP id 4AB2489B12 for ; Wed, 15 Apr 2015 10:15:16 -0700 (PDT) Received: by pabsx10 with SMTP id sx10so57495035pab.3 for ; Wed, 15 Apr 2015 10:15: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=q746hEbtIBKj0g1IKg6aYzhL52EMcmSu12i7qWhmNQc=; b=pUozcIaMeziaY2bRBH3gqWAkheYNTBOoXhfNJntAjHZqLWe8Joh+aycTma5Rw3p4jD 9OhiYzD19/daZVGsjQ25tr++8vybe4iczUXd0F3j5zjUuexsZGB+o2kV1vNslkeOUT2h umQ2p/6tgA8kau9d3omgkwI1jLd9MP2bNTh7nzLFrmStojwUBzbrhfVzWGTJk52Ch8OI iPPUtHa0RfWkuSUuIf/8NY0FxbLfVHjKICqIV683Kh+6tJDlaeMVRWZoRUljzy/sj7vW XSHM9BZG851ClGpvbe2jhmXm0zFPyXLH5OBmL+cuz/KrWmFckb7QS2tT5IN8yJVBlpxe SElA== X-Received: by 10.68.229.138 with SMTP id sq10mr47734828pbc.136.1429118116091; Wed, 15 Apr 2015 10:15:16 -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 eh4sm4650534pbd.69.2015.04.15.10.15.14 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Apr 2015 10:15:15 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 15 Apr 2015 10:15:04 -0700 Message-Id: <1429118104-15759-1-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429112327-7695-4-git-send-email-tprevite@gmail.com> References: <1429112327-7695-4-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH 03/12] drm/i915: Add EDID read in intel_dp_check_link_status() for Link CTS 4.2.2.1 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 Adds in an EDID read after the DPCD read to accommodate test 4.2.2.1 in the Displayport Link CTS Core 1.2 rev1.1. This test requires an EDID read for all HPD plug events. To reduce the amount of code, this EDID read is also used for Link CTS tests 4.2.2.3, 4.2.2.4, 4.2.2.5 and 4.2.2.6. Actual support for these tests is implemented in later patches in this series. V2: - Fixed compilation error introduced during rework V3: - Plugged a memory leak where the EDID data wasn't being freed after allocation in this function V4: - Fixed whitespace problems - Cleaned up formatting V5: - Added propagation of the long_hpd flag from the hot_pulse function Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/intel_dp.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1352c00..23586f6 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4110,15 +4110,30 @@ go_again: * 4. Check link status on receipt of hot-plug interrupt */ static void -intel_dp_check_link_status(struct intel_dp *intel_dp) +intel_dp_check_link_status(struct intel_dp *intel_dp, bool long_hpd) { struct drm_device *dev = intel_dp_to_dev(intel_dp); struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; + struct drm_connector *connector = &intel_dp->attached_connector->base; + struct i2c_adapter *adapter = &intel_dp->aux.ddc; + struct edid *edid_read = NULL; u8 sink_irq_vector; u8 link_status[DP_LINK_STATUS_SIZE]; WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); + /* Displayport Link CTS Core 1.2 rev1.1 EDID testing + * 4.2.2.1 - EDID read required for all HPD events + */ + if (long_hpd) { + edid_read = drm_get_edid(connector, adapter); + if (!edid_read) { + DRM_DEBUG_DRIVER("Invalid EDID detected\n"); + } else { + kfree(edid_read); + } + } + /* 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)) { @@ -4773,7 +4788,7 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) * but for short hpds we should check it now */ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); - intel_dp_check_link_status(intel_dp); + intel_dp_check_link_status(intel_dp, long_hpd); drm_modeset_unlock(&dev->mode_config.connection_mutex); } }