From patchwork Tue Mar 31 17:05:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 6132761 Return-Path: X-Original-To: patchwork-dri-devel@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 5AD5A9F349 for ; Tue, 31 Mar 2015 17:05:54 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8C5462017D for ; Tue, 31 Mar 2015 17:05:53 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 48D982015A for ; Tue, 31 Mar 2015 17:05:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 986EC720C6; Tue, 31 Mar 2015 10:05:51 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pa0-f54.google.com (mail-pa0-f54.google.com [209.85.220.54]) by gabe.freedesktop.org (Postfix) with ESMTP id 94671720C6 for ; Tue, 31 Mar 2015 10:05:49 -0700 (PDT) Received: by patj18 with SMTP id j18so25262714pat.2 for ; Tue, 31 Mar 2015 10:05:49 -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=dO7uzPm8W54VuNzKfbgCBZcO+85QOr6F6m4VcOuR3jo=; b=X7raiLGI1LeOhOjIRHxmHAc3xOO2Je9D+fCxzxEvOwx8OaGBNagHuIF63pHKwTC5lY qlxRoq8pv6zh1cgVLvaLOAKB+YttgvwW7aKjjjqh8RV7gXSjH+rvd27X6B1OHgfgqFEo f3n/iDqF0PSo/txVmYSVBfGocGJKXZQeaRMDLuRCQSbpvlnB/VMTZ3dBWLpD11a0WMXE 1Md92as0KjCy+8hZvi5fL4DW5Rd6gnG8FwnoXZs4flQ23A84wLuBAAEBBMuZ/iNuX4Pf Ikt4ncAt1+9iBwyo+DtGhoYgP2PFRq4+fNF7v6Md5Zps7MxLYn9Iemht5iPxDnWt2zH4 b4EQ== X-Received: by 10.70.94.169 with SMTP id dd9mr69898840pdb.34.1427821549322; Tue, 31 Mar 2015 10:05:49 -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 qh9sm11520007pbc.24.2015.03.31.10.05.47 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 31 Mar 2015 10:05:48 -0700 (PDT) From: Todd Previte To: tprevite@gmail.com Subject: [PATCH 7/9] drm/i915: Fix for DP CTS test 4.2.2.5 - I2C DEFER handling Date: Tue, 31 Mar 2015 10:05:27 -0700 Message-Id: <1427821529-27241-8-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1427821529-27241-1-git-send-email-tprevite@gmail.com> References: <1427821529-27241-1-git-send-email-tprevite@gmail.com> Cc: dri-devel@lists.freedesktop.org X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" 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 For test 4.2.2.5 to pass per the Link CTS Core 1.2 rev1.1 spec, the source device must attempt at least 7 times to read the EDID when it receives an I2C defer. The normal DRM code makes only 7 retries, regardless of whether or not the response is a native defer or an I2C defer. Test 4.2.2.5 fails since there are native defers interspersed with the I2C defers which results in less than 7 EDID read attempts. The solution is to decrement the retry counter when an I2C DEFER is returned such that another read attempt will be made. This situation should normally only occur in compliance testing, however, as a worse case real-world scenario, it would result in 13 attempts ( 6 native defers, 7 I2C defers) for a single transaction to complete. The net result is a slightly slower response to an EDID read that shouldn't significantly impact overall performance. Signed-off-by: Todd Previte Cc: dri-devel@lists.freedesktop.org --- drivers/gpu/drm/drm_dp_helper.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c index 79968e3..0539758 100644 --- a/drivers/gpu/drm/drm_dp_helper.c +++ b/drivers/gpu/drm/drm_dp_helper.c @@ -469,6 +469,11 @@ static int drm_dp_i2c_do_msg(struct drm_dp_aux *aux, struct drm_dp_aux_msg *msg) case DP_AUX_I2C_REPLY_DEFER: DRM_DEBUG_KMS("I2C defer\n"); aux->i2c_defer_count++; + /* DP Compliance Test 4.2.2.5 Requirement: + * Must have at least 7 retries for I2C defers on the + * transaction to pass this test + */ + retry--; usleep_range(400, 500); continue;