From patchwork Thu Feb 19 03:00:34 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Todd Previte X-Patchwork-Id: 5849711 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 337B4BF440 for ; Thu, 19 Feb 2015 03:00:57 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2EFA620225 for ; Thu, 19 Feb 2015 03:00:56 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 550102021F for ; Thu, 19 Feb 2015 03:00:55 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D0BF06E3AC; Wed, 18 Feb 2015 19:00:54 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-pa0-f47.google.com (mail-pa0-f47.google.com [209.85.220.47]) by gabe.freedesktop.org (Postfix) with ESMTP id 442F76E0F1 for ; Wed, 18 Feb 2015 19:00:54 -0800 (PST) Received: by pabrd3 with SMTP id rd3so6049491pab.4 for ; Wed, 18 Feb 2015 19:00:54 -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=DELNg9Fi4Gz/wXv+Ykp68nKW9kkXgDbwfg6L4sIX8gY=; b=C5qV9syzLmIeYRQEbs2paEkwYBZrsgxpAvnUik3YnnCKEYwW55YzJWXln1uy8gc5pE EonmnNXpzFJV2+4cGsSHGiq7X4QXuLcyhKDvn0yQ2bH2xRsJ3ArElNcv7MUoqhuiziUW jnnmYnSIZk///WJPJTEtuWsJZMhgKD9fJz9Me/SHeNwbxQz60Ebk5ksIsdQytt5a3H74 /XccUkwVlaE6agilJpmExf79soj/eeb22URLzSxZzN3i2JTFMlOPGMwQSaYgMeJy/K5T y5fy6p3hL30dXB12lAo3jcYVluHwzQVrwk6A2winIiTPqqTm0S4B1LQHgQM+SzW9a5ur rhGg== X-Received: by 10.67.8.2 with SMTP id dg2mr3960402pad.15.1424314854115; Wed, 18 Feb 2015 19:00:54 -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.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 18 Feb 2015 19:00:53 -0800 (PST) From: Todd Previte To: intel-gfx@lists.freedesktop.org Date: Wed, 18 Feb 2015 20:00:34 -0700 Message-Id: <1424314837-32434-7-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 6/9] drm/i915: Update intel_dp_compute_config() to handle compliance test requests 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 provisions in intel_dp_compute_config() to accommodate compliance testing. Mostly this invovles circumventing the automatic link configuration parameters and allowing the compliance code to set those parameters as required by the tests. V2: - N/A V3: - Moved color range check down under the compliance_exit tag Signed-off-by: Todd Previte --- drivers/gpu/drm/i915/intel_dp.c | 38 +++++++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e69cdad..2d83f13 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1191,6 +1191,21 @@ intel_dp_compute_config(struct intel_encoder *encoder, pipe_config->has_drrs = false; pipe_config->has_audio = intel_dp->has_audio; + /* Compliance testing should skip most of this function */ + if (!is_edp(intel_dp) && intel_dp->compliance_testing_active) { + bpp = intel_dp->compliance_config.bits_per_pixel; + lane_count = intel_dp->compliance_config.lane_count; + clock = intel_dp->compliance_config.link_rate >> 3; + /* Assign here and skip at the end - ensures correct values */ + intel_dp->link_bw = bws[clock]; + intel_dp->lane_count = lane_count; + pipe_config->pipe_bpp = bpp; + pipe_config->port_clock = + drm_dp_bw_code_to_link_rate(intel_dp->link_bw); + + goto compliance_exit; + } + if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) { intel_fixed_panel_mode(intel_connector->panel.fixed_mode, adjusted_mode); @@ -1251,6 +1266,18 @@ intel_dp_compute_config(struct intel_encoder *encoder, return false; found: + intel_dp->link_bw = bws[clock]; + intel_dp->lane_count = lane_count; + pipe_config->pipe_bpp = bpp; + pipe_config->port_clock = drm_dp_bw_code_to_link_rate(intel_dp->link_bw); + + DRM_DEBUG_KMS("DP link bw %02x lane count %d clock %d bpp %d\n", + intel_dp->link_bw, intel_dp->lane_count, + pipe_config->port_clock, bpp); + DRM_DEBUG_KMS("DP link bw required %i available %i\n", + mode_rate, link_avail); + +compliance_exit: if (intel_dp->color_range_auto) { /* * See: @@ -1266,17 +1293,6 @@ found: if (intel_dp->color_range) pipe_config->limited_color_range = true; - intel_dp->link_bw = bws[clock]; - intel_dp->lane_count = lane_count; - pipe_config->pipe_bpp = bpp; - pipe_config->port_clock = drm_dp_bw_code_to_link_rate(intel_dp->link_bw); - - DRM_DEBUG_KMS("DP link bw %02x lane count %d clock %d bpp %d\n", - intel_dp->link_bw, intel_dp->lane_count, - pipe_config->port_clock, bpp); - DRM_DEBUG_KMS("DP link bw required %i available %i\n", - mode_rate, link_avail); - intel_link_compute_m_n(bpp, lane_count, adjusted_mode->crtc_clock, pipe_config->port_clock,