From patchwork Wed Apr 15 15:38:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6221461 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 556C49F313 for ; Wed, 15 Apr 2015 15:39:09 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 777E9201CE for ; Wed, 15 Apr 2015 15:39:08 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8F6D6202A1 for ; Wed, 15 Apr 2015 15:39:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 1E9056E829; Wed, 15 Apr 2015 08:39:07 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f180.google.com (mail-pd0-f180.google.com [209.85.192.180]) by gabe.freedesktop.org (Postfix) with ESMTP id D0DFE6E864 for ; Wed, 15 Apr 2015 08:39:05 -0700 (PDT) Received: by pdbnk13 with SMTP id nk13so56524671pdb.0 for ; Wed, 15 Apr 2015 08:39:05 -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=N74fdTVRfKgrWb/Wi9HFwX7UlVrai2Jeb9huldrujnc=; b=CHGt5+mYiX79HIRT2bV1wK+wwJf+X6pzx/Wy1zn6yIfiIHSeeFuTdkL0IF3KSCy6bU 1ukHip5celBmZSsX4pP/acs+WSCZ+IJ9cHAZqqEKJDKfLyhforXNDZVVLJz6yInND8KG 3EQwZzHNGh/9ODMBLmYq2yN0cD2NQrPNA4L9u6rbQcDwUmBvt4Yejoq964+0kFoyYQEW CJoz8cpHM2zKZz2eJQRkgJqWYcD0jLVZXqMgh2rHcdXbn35+sSocr0sPrmySqVUus+9o bdNF0ixxKpU1bHzcyR4yoQeekHC4ryTnbtuSOUX/tQQQ32ST6KHXiuZleGDGMco5MVDl +6XA== X-Received: by 10.68.197.201 with SMTP id iw9mr48053577pbc.84.1429112345672; Wed, 15 Apr 2015 08:39:05 -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 su5sm4484999pbc.38.2015.04.15.08.39.04 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Apr 2015 08:39:04 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 15 Apr 2015 08:38:40 -0700 Message-Id: <1429112327-7695-4-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429112327-7695-1-git-send-email-tprevite@gmail.com> References: <1429112327-7695-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH 03/10] 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 Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/intel_dp.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 1352c00..c112359 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4114,11 +4114,24 @@ 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; + 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 + */ + 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)) {