From patchwork Wed Dec 10 23:53:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 5473401 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.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D6BD29F1D4 for ; Wed, 10 Dec 2014 23:54:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0C1B120172 for ; Wed, 10 Dec 2014 23:54:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1C9BE2016C for ; Wed, 10 Dec 2014 23:54:25 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8B90E6E71F; Wed, 10 Dec 2014 15:54:24 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pd0-f176.google.com (mail-pd0-f176.google.com [209.85.192.176]) by gabe.freedesktop.org (Postfix) with ESMTP id 27CCF6E71F for ; Wed, 10 Dec 2014 15:54:23 -0800 (PST) Received: by mail-pd0-f176.google.com with SMTP id r10so1774382pdi.7 for ; Wed, 10 Dec 2014 15:54:23 -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=ezs/3PuxB+PU2IOyhG2zMeoEBqv7vWOMlfrrFr9gXdU=; b=CZpRr+sUuPq5bBGJzyNM4mw27ARHP5mCNc0c1ayFLPXQJJwsS+hMETvnK2GdJjafOC 8sEKeqLzqRCYVjNmqeQ6zhdqG15kGEk0O1y91WfBuRaCX8UpBAu+qsYpDGJSp9KzK1x4 0neWrYofzeKGu2IEpAkRndNBoFA/crx9aunYXw440Hp7nZ0VTtM10d6wVWIdnrHbIfXK SnNNcwshB61Wd3VnbX+Yghxxlo/Kw2Kx17hMQ4ddq8B8XOJbiuysso8ah4xT4ixqRnwY eUpiY9ZSF3/G5ngLNWFoJq3lHo/gqpTkZVop4NOjZmAKaOUdy5rjpyQsAsngK+Thb/gz 9jag== X-Received: by 10.66.254.232 with SMTP id al8mr11787653pad.76.1418255663027; Wed, 10 Dec 2014 15:54:23 -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.21 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 10 Dec 2014 15:54:22 -0800 (PST) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 10 Dec 2014 16:53:15 -0700 Message-Id: <1418255597-4716-16-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 15/17] drm/i915: Update debugfs functions for Displayport 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 Updates displayport_config_ctl_write and displayport_config_ctl_show to use the dp_connector_is_valid() function. This saves on code and improves maintainability by unifying the code in a single, common path. Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/i915_debugfs.c | 42 +++++++++++++------------------------ 1 file changed, 14 insertions(+), 28 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_debugfs.c b/drivers/gpu/drm/i915/i915_debugfs.c index 978ddd1..846b2fb 100644 --- a/drivers/gpu/drm/i915/i915_debugfs.c +++ b/drivers/gpu/drm/i915/i915_debugfs.c @@ -3955,6 +3955,7 @@ static int displayport_config_ctl_show(struct seq_file *m, void *data) struct drm_connector *drm_connector; struct intel_encoder *encoder; struct intel_connector *connector; + char *conn_name; if (!dev) return -ENODEV; @@ -3964,23 +3965,14 @@ static int displayport_config_ctl_show(struct seq_file *m, void *data) head) { connector = to_intel_connector(drm_connector); encoder = connector->encoder; - if (drm_connector->connector_type == - DRM_MODE_CONNECTOR_DisplayPort) { - if (encoder->type == INTEL_OUTPUT_DISPLAYPORT || - encoder->type == INTEL_OUTPUT_UNKNOWN) { - if (drm_connector->status == - connector_status_connected) { - displayport_show_config_info(m, - connector); - } else { - seq_printf(m, DP_CONF_STR_CONNECTOR, - encoder->base.name); - seq_puts(m, "disconnected\n"); - } - } + conn_name = connector->base.name; + if (dp_connector_is_valid(drm_connector, 1)) { + displayport_show_config_info(m, connector); + } else { + seq_printf(m, DP_CONF_STR_CONNECTOR, conn_name); + seq_puts(m, "disconnected\n"); } } - return 0; } @@ -4001,7 +3993,6 @@ static ssize_t displayport_config_ctl_write(struct file *file, struct seq_file *m; struct drm_device *dev; struct drm_connector *connector; - struct drm_encoder *drm_enc; struct intel_encoder *intel_encoder; struct intel_connector *intel_connector; struct intel_dp *intel_dp; @@ -4036,18 +4027,13 @@ static ssize_t displayport_config_ctl_write(struct file *file, list_for_each_entry(connector, &dev->mode_config.connector_list, head) { intel_connector = to_intel_connector(connector); intel_encoder = intel_connector->encoder; - drm_enc = &intel_encoder->base; - if (connector->connector_type == - DRM_MODE_CONNECTOR_DisplayPort) { - if (intel_encoder->type == INTEL_OUTPUT_DISPLAYPORT || - intel_encoder->type == INTEL_OUTPUT_UNKNOWN) { - intel_dp = enc_to_intel_dp(drm_enc); - status = displayport_parse_config(input_buffer, - len, - intel_dp); - if (status < 0) - goto out; - } + if (dp_connector_is_valid(connector, 0)) { + intel_dp = enc_to_intel_dp(&intel_encoder->base); + status = displayport_parse_config(input_buffer, + len, + intel_dp); + if (status < 0) + goto out; } } out: