From patchwork Wed Apr 15 19:29:20 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6222451 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 6DC57BF4A6 for ; Wed, 15 Apr 2015 19:29:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 85AD320160 for ; Wed, 15 Apr 2015 19:29:31 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 3257020155 for ; Wed, 15 Apr 2015 19:29:30 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 833EF6E8BB; Wed, 15 Apr 2015 12:29:29 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f181.google.com (mail-pd0-f181.google.com [209.85.192.181]) by gabe.freedesktop.org (Postfix) with ESMTP id 718186E8BB for ; Wed, 15 Apr 2015 12:29:28 -0700 (PDT) Received: by pdbqa5 with SMTP id qa5so63066952pdb.1 for ; Wed, 15 Apr 2015 12:29:28 -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=SS2FWQQA3T2k6GT5Jt4ITofrs7fxVMhC8KqhGSebN48=; b=bka6PM2y5fC3d2UfIhHdtjzoy84MKU+/LvIKHTvwyY1zAdk2o+ZS+429hkfRdxds6G Bl8NSBG+zUsbPpE8dyVlpGNNwnNqe/ZhA612Xc9tfQOpw6+RlZNWYrnjepxFT1DQ80b2 3ZIMA8tpN7pWq14BmSbHEr9cHOZPEvF6rhFVMFLALTeaL4p3r+Ec0ojYyN6FIIhm4XUd TU2blz4ppf/jPBPdYM748zs4Mg3oyAiANkfO0LfeTNjZw2Lueun7kgyxjrt1cCjYv5yh gUz92UogxvELgrJha2gEI1+yIFJxxFYldIEq3cZkpA+s7idhapaFwvj1ZBJV6MR0daNN Sf6A== X-Received: by 10.68.179.67 with SMTP id de3mr49302548pbc.85.1429126168215; Wed, 15 Apr 2015 12:29:28 -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 fl4sm4940591pab.8.2015.04.15.12.29.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Apr 2015 12:29:27 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 15 Apr 2015 12:29:20 -0700 Message-Id: <1429126160-1382-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 V6: - Versioning, accommodating changes from previous patch 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 9c38986..a875b44 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4110,10 +4110,13 @@ 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]; @@ -4122,6 +4125,18 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) if (!intel_dp_get_dpcd(intel_dp)) return; + /* 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)) { @@ -4776,7 +4791,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); } }