From patchwork Fri Nov 1 22:44:08 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 3129841 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 50E76BEEB2 for ; Fri, 1 Nov 2013 22:46:03 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7B54E20458 for ; Fri, 1 Nov 2013 22:46:02 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 91C6D20123 for ; Fri, 1 Nov 2013 22:46:01 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 41140EFAC8; Fri, 1 Nov 2013 15:46:00 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pb0-f41.google.com (mail-pb0-f41.google.com [209.85.160.41]) by gabe.freedesktop.org (Postfix) with ESMTP id 46737EFAC8 for ; Fri, 1 Nov 2013 15:45:59 -0700 (PDT) Received: by mail-pb0-f41.google.com with SMTP id wy17so1694339pbc.28 for ; Fri, 01 Nov 2013 15:45:59 -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=lJDEazs6caJ0pE8okVEWSGvNLGP+Cda/B86rwxXNmfA=; b=fN4whExHvCRaWJ2aZioxuHpfvzjCJRMIReqNsvs79evlmLXpFSx5Ld7H/lt9y9jwqJ jloCQp/jrA+gIPQS0i72O40vr+p3WRzfLWVxMiT5O0/sjQyJ7y8Xlgb0vwIlwgwaEcfx ADIMkfS4liESPHS4LyNaARiMLm6obHI8wh/DKgPhy8d71ZM7XSNiqkWIxyOvNryUuoZY s26qfgaAil4UY0PJsZaKhuiurs9rZvuv8fz8swnmwWjUIaSg6ei/RxDHFV55DorIucue RmjsFYlXOsiebyGnS0VVpGFDG7/VvbkwBy1ReJLWCCEtnN0NP5gMu2Xcaps9Z40XUCed S1cA== X-Received: by 10.66.9.7 with SMTP id v7mr5381566paa.4.1383345959088; Fri, 01 Nov 2013 15:45:59 -0700 (PDT) Received: from localhost.localdomain (ip70-162-72-129.ph.ph.cox.net. [70.162.72.129]) by mx.google.com with ESMTPSA id py4sm13047409pbb.33.2013.11.01.15.45.57 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 01 Nov 2013 15:45:58 -0700 (PDT) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Fri, 1 Nov 2013 15:44:08 -0700 Message-Id: <1383345848-6872-2-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1383345848-6872-1-git-send-email-tprevite@gmail.com> References: <1380882730-32207-1-git-send-email-tprevite@gmail.com> <1383345848-6872-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH] drm/i915: Implement Displayport automated testing X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: intel-gfx-bounces@lists.freedesktop.org Errors-To: intel-gfx-bounces@lists.freedesktop.org X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 This initial patch adds support for automated testing of the source device to the i915 driver. Most of this patch is infrastructure for the tests; follow up patches will add support for the individual tests with updates to ACK the tests that are supported (or NAK if the test fails/is unsupported). Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/intel_dp.c | 87 +++++++++++++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index c8515bb..5f2a720 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -2813,11 +2813,92 @@ intel_dp_get_sink_irq(struct intel_dp *intel_dp, u8 *sink_irq_vector) return true; } +/* Automated test function hook - description forthcoming */ +static bool +intel_dp_autotest_link_training(struct intel_dp *intel_dp) +{ + bool test_result = false; + return test_result; +} + +/* Automated test function hook - description forthcoming */ +static bool +intel_dp_autotest_video_pattern(struct intel_dp *intel_dp) +{ + bool test_result = false; + return test_result; +} + +/* Automated test function hook - description forthcoming */ +static bool +intel_dp_autotest_edid(struct intel_dp *intel_dp) +{ + bool test_result = false; + return test_result; +} + +/* Automated test function hook - description forthcoming */ +static bool +intel_dp_autotest_phy_pattern(struct intel_dp *intel_dp) +{ + bool test_result = false; + return test_result; +} + +/* Automated test function hook - description forthcoming */ +static bool +intel_dp_autotest_faux_pattern(struct intel_dp *intel_dp) +{ + bool test_result = false; + return test_result; +} + static void intel_dp_handle_test_request(struct intel_dp *intel_dp) -{ - /* NAK by default */ - intel_dp_aux_native_write_1(intel_dp, DP_TEST_RESPONSE, DP_TEST_NAK); +{ + uint8_t response = DP_TEST_NAK; + bool result = false; + uint8_t rxdata = 0; + + DRM_DEBUG_KMS("Displayport: Recvd automated test request\n"); + /* Read DP_TEST_REQUEST register to identify the requested test */ + intel_dp_aux_native_read_retry(intel_dp, DP_TEST_REQUEST, &rxdata, 1); + /* Determine which test has been requested */ + switch (rxdata) { + /* ACK/NAK response based on the success or failure of the specified + automated test function. Unimplemented tests will NAK as will those + that are unsupported. */ + case DP_TEST_LINK_TRAINING: + DRM_DEBUG_KMS("Displayport: Executing LINK_TRAINING request\n"); + result = intel_dp_autotest_link_training(intel_dp); + break; + case DP_TEST_LINK_VIDEO_PATTERN: + DRM_DEBUG_KMS("Displayport: Executing TEST_PATTERN request\n"); + result = intel_dp_autotest_video_pattern(intel_dp); + break; + case DP_TEST_LINK_EDID_READ: + DRM_DEBUG_KMS("Displayport: Executing EDID request\n"); + result = intel_dp_autotest_edid(intel_dp); + break; + case DP_TEST_LINK_PHY_TEST_PATTERN: + DRM_DEBUG_KMS("Displayport: Executing PHY_PATTERN request\n"); + result = intel_dp_autotest_phy_pattern(intel_dp); + break; + case DP_TEST_LINK_FAUX_PATTERN: + printk(KERN_DEBUG "Displayport: Executing FAUX_PATTERN request \n"); + result = intel_dp_autotest_faux_pattern(intel_dp); + break; + /* Unsupported test case or something went wrong */ + default: + /* Log error here for unhandled test request */ + DRM_DEBUG_KMS("Displayport: Error - unhandled automated test type\n"); + break; + } + /* Check for a valid test execution */ + if (result == true) + response = DP_TEST_ACK; + /* Send ACK/NAK based on action taken above */ + intel_dp_aux_native_write_1(intel_dp, DP_TEST_RESPONSE, response); } /*