From patchwork Wed Dec 10 23:53:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 5473391 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 47B94BEEA8 for ; Wed, 10 Dec 2014 23:54:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 884272018E for ; Wed, 10 Dec 2014 23:54:23 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id A9BE82016C for ; Wed, 10 Dec 2014 23:54:22 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 25C426E71E; Wed, 10 Dec 2014 15:54:22 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f177.google.com (mail-pd0-f177.google.com [209.85.192.177]) by gabe.freedesktop.org (Postfix) with ESMTP id 5B8E27A03A for ; Wed, 10 Dec 2014 15:54:21 -0800 (PST) Received: by mail-pd0-f177.google.com with SMTP id ft15so3736893pdb.36 for ; Wed, 10 Dec 2014 15:54:21 -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=Y2jeQCnG3pIvAi/Gw/2PpoQd/ECshi05ooNFYlR8VyE=; b=J40FqrkHLgAiwncM1HhhYBWSUzb1sYcqoGOaMA5y1csiaD0mpEHXLUVc6pDRuvE/pV cNjGvqJ2tkU5hiPmNfpcbyKssWpqi5bgu5VjQ2B/8YicrRc5O/NqYUVt1Jgi72RpVWrp 1303pdjvKPIjPIxMFKrL2CA2KWCuBNemPOif+qQnbVpOv5EIC5hcJ0yPacQAX1ZQqvoj zYz5pweTbA2waayYPDuPJr//OCArzfMuZyFQenj2rJq1bB7+Maync9VUhLWDyBd+eqii uBkscd5V0l98iYqfTGRGz22ZGiqbbS4JXhbHxA47e2xYnZr0jwcDL4x/Us33+G5MDxyJ DoMw== X-Received: by 10.66.219.70 with SMTP id pm6mr11772531pac.126.1418255661155; Wed, 10 Dec 2014 15:54:21 -0800 (PST) Received: from localhost.localdomain (ip68-3-234-27.ph.ph.cox.net. [68.3.234.27]) by mx.google.com with ESMTPSA id gy10sm5164958pbd.67.2014.12.10.15.54.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Dec 2014 15:54:20 -0800 (PST) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Dec 2014 16:53:14 -0700 Message-Id: <1418255597-4716-15-git-send-email-tprevite@gmail.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1418255597-4716-1-git-send-email-tprevite@gmail.com> References: <1418255597-4716-1-git-send-email-tprevite@gmail.com> Subject: [Intel-gfx] [PATCH 14/17] drm/i915: Add debugfs function to check connector status for compliance testing 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 function to check the status of a Displayport connector. This function simplifies the Displayport compliance testing interface in debugfs by providing a single method for determining the status of a connector during Displayport compliance testing. This function checks whether or not the connector is a Displayport connector and whether or not that connector is active. Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/i915_debugfs.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 5eb6c24..978ddd1 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -3920,6 +3920,35 @@ static int displayport_parse_config(char *input_buffer, return status; } +static bool dp_connector_is_valid(struct drm_connector *connector, + bool check_active) +{ + struct intel_encoder *intel_encoder; + struct intel_connector *intel_connector; + + intel_connector = to_intel_connector(connector); + intel_encoder = intel_connector->encoder; + + if (connector->connector_type != DRM_MODE_CONNECTOR_DisplayPort) + goto no; + + if (intel_encoder->type != INTEL_OUTPUT_DISPLAYPORT && + intel_encoder->type != INTEL_OUTPUT_UNKNOWN) + goto no; + + if (check_active) { + if (connector->status == connector_status_connected) + goto yes; + else + goto no; + } + +yes: + return true; +no: + return false; +} + static int displayport_config_ctl_show(struct seq_file *m, void *data) { struct drm_device *dev = m->private;