From patchwork Thu Feb 19 03:00:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 5849741 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 3C521BF440 for ; Thu, 19 Feb 2015 03:01:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 62B3520221 for ; Thu, 19 Feb 2015 03:00:59 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 73E052021F for ; Thu, 19 Feb 2015 03:00:58 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id F365C6E17C; Wed, 18 Feb 2015 19:00:57 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f46.google.com (mail-pa0-f46.google.com [209.85.220.46]) by gabe.freedesktop.org (Postfix) with ESMTP id EC3F86E17C for ; Wed, 18 Feb 2015 19:00:56 -0800 (PST) Received: by padet14 with SMTP id et14so5980359pad.11 for ; Wed, 18 Feb 2015 19:00:56 -0800 (PST) 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=KmSaRegsv+SS8CLgSOL+ddEZy5TazZZCUNJ2EwfxBs8=; b=QQ7x36F26VShmco2jX/Qlf8Ba9oM7DLmkt+1COZaDfNJBQvZtgEKImRC+SdXcYtREv 8sFiLro/4Gvmx0SeMidhmmv9dAuqyV6nXFNO+rhsqrQpITiL3ezPJPptxjTWdEmkGKY9 BpLCnx7e2iPv95z/ir2bEJQOYujtxDFGQAV7Drurd32sT02gquWMUfH9davJu4DWyEtE WbP9snCluiodW+MO/QeEttMuJjeqCtEmailHRU1XlS4ktjzdg3OQE4nPkFuK6Ax/rp5X vD4yW6twe0+JE7uLcfgCoXNv80kjoSHX78GZ/3foUTqSCdmBbEGb7ERvBHoJ2EjSMrNS MteQ== X-Received: by 10.68.194.38 with SMTP id ht6mr4123775pbc.36.1424314856776; Wed, 18 Feb 2015 19:00:56 -0800 (PST) Received: from localhost.localdomain (ip70-162-72-208.ph.ph.cox.net. [70.162.72.208]) by mx.google.com with ESMTPSA id je2sm21953646pbd.44.2015.02.18.19.00.55 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Feb 2015 19:00:56 -0800 (PST) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 18 Feb 2015 20:00:36 -0700 Message-Id: <1424314837-32434-9-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1424314837-32434-1-git-send-email-tprevite@gmail.com> References: <1424314837-32434-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH 8/9] drm/i915: Add new debugfs file for Displaypor compliance test control 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 a new file for controlling Displayport compliance testing via the debugfs interface. Adds two functions, 'open' and 'show', as well as the file operations structure to support reading the file from userspace. The new file is called 'i915_dp_test_ctl' and contains 4 fields: - Connector name - Test data - Test active flag - Test response These four fields are used to control communication and operation between the userspace application and the kernel during compliance testing. A new variable is also added to the intel_dp struct to hold the response code from the user application. This response code is then sent to the sink device upon completion of the test. V2: - N/A V3: - Removed the reference to dp_connector_is_valid() - Updated the show() function to match config_ctl_show() - Updated the enums to match the format of the existing enums for the config parameters Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/i915_debugfs.c | 69 ++++++++++++++++++++++++++++++++++++- drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 69 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index b77574e..45c0fde 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -68,6 +68,15 @@ enum dp_config_param { DP_CONFIG_PARAM_INVALID = -1 }; +enum dp_ctrl_param { + DP_CTRL_PARAM_CONNECTOR = 0, + DP_CTRL_PARAM_TEST_DATA, + DP_CTRL_PARAM_TEST_ACTIVE, + DP_CTRL_PARAM_TEST_RESPONSE, + DP_CTRL_PARAM_COUNT, + DP_CTRL_PARAM_INVALID = -1 +}; + struct dp_config { enum dp_config_param type; unsigned long value; @@ -4171,6 +4180,63 @@ static const struct file_operations i915_displayport_config_ctl_fops = { .write = i915_displayport_config_ctl_write }; +static int i915_displayport_test_ctl_show(struct seq_file *m, void *data) +{ + struct drm_device *dev = m->private; + struct drm_connector *connector; + struct list_head *connector_list = &dev->mode_config.connector_list; + struct intel_dp *intel_dp; + + if (!dev) + return -ENODEV; + + list_for_each_entry(connector, connector_list, head) { + + if (connector->connector_type != + DRM_MODE_CONNECTOR_DisplayPort) + continue; + + if (connector->status == connector_status_connected) { + intel_dp = enc_to_intel_dp(connector->encoder); + /* Compliance test data informs userspace about current + request + */ + seq_printf(m, "Test Data : %08lx\n", + intel_dp->compliance_test_data); + seq_printf(m, "Test Active: %02x\n", + intel_dp->compliance_testing_active); + seq_printf(m, "Test Response: %02lx\n", + intel_dp->compliance_test_response); + } else { + dp_print_string(m, + DP_CONFIG_PARAM_CONNECTOR, + connector->name); + dp_print_string(m, + DP_CONFIG_PARAM_CONNECTOR_ID, + &connector->base.id); + seq_puts(m, "disconnected\n"); + } + } + + return 0; +} + +static int i915_displayport_test_ctl_open(struct inode *inode, + struct file *file) +{ + struct drm_device *dev = inode->i_private; + + return single_open(file, i915_displayport_test_ctl_show, dev); +} + +static const struct file_operations i915_dp_test_ctl_fops = { + .owner = THIS_MODULE, + .open = i915_displayport_test_ctl_open, + .read = seq_read, + .llseek = seq_lseek, + .release = single_release, +}; + static void wm_latency_show(struct seq_file *m, const uint16_t wm[8]) { struct drm_device *dev = m->private; @@ -4920,7 +4986,8 @@ static const struct i915_debugfs_files { {"i915_spr_wm_latency", &i915_spr_wm_latency_fops}, {"i915_cur_wm_latency", &i915_cur_wm_latency_fops}, {"i915_fbc_false_color", &i915_fbc_fc_fops}, - {"i915_displayport_config_ctl", &i915_displayport_config_ctl_fops} + {"i915_displayport_config_ctl", &i915_displayport_config_ctl_fops}, + {"i915_dp_test_ctl", &i915_dp_test_ctl_fops} }; void intel_display_crc_init(struct drm_device *dev) diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index c813d3c..6af5880 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -663,6 +663,7 @@ struct intel_dp { /* Displayport compliance testing */ unsigned long compliance_test_data; bool compliance_testing_active; + unsigned long compliance_test_response; struct intel_dp_link_config compliance_config; };