From patchwork Fri Feb 22 00:12:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Vetter X-Patchwork-Id: 2174061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 30DD63FD4E for ; Fri, 22 Feb 2013 00:21:44 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0F66BE6231 for ; Thu, 21 Feb 2013 16:21:44 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mail-ee0-f47.google.com (mail-ee0-f47.google.com [74.125.83.47]) by gabe.freedesktop.org (Postfix) with ESMTP id D33A5E61E7 for ; Thu, 21 Feb 2013 16:12:29 -0800 (PST) Received: by mail-ee0-f47.google.com with SMTP id e52so43248eek.6 for ; Thu, 21 Feb 2013 16:12:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=xPMUa53Myg8RIDOYgZh4x6ym9V/ksETTq+wBZP+RKFk=; b=E+MMF9xJQVnyGsbMln40e+2d2NmrkOuakQ0s27XTWv4l46DyKq9zoIwojpknBdAUq6 hWmZ/6MZHgjJojZhng5607hgOcFPwlROriH53a5YcJ929IZTwjZGZMeoglNjge/I1lBR zbZAZtTuGAwIh2JTZ1sx5Ct1q+K2Y0QSi/3Ho= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=xPMUa53Myg8RIDOYgZh4x6ym9V/ksETTq+wBZP+RKFk=; b=bvTAWQysLVPPx2/AxQbyaC4l2V9UnBqpkHQ7HMRQ5301vLw7FH0+63LZYJZuWnUZNF ZKWlwm4fF9k7LkZ6WtBfqAYcL9uT5bD9125PSSpr/oBeoKCqrLwXBPvXsR3tbkoWQ/ty gumjFnMcNbzXF935HqL/v71y45deoW6CpeHKukXJ2ob1AAOidVyYp/cA+gNvQSO5OU4/ ASOfDePL1GSxKSOkCSzWcXxq6PMnaXVWn8pRtgjaBeXu27gckVw+U9IxB8sdg4uvLgK1 KZb+LrnzTMi9czHoK9jNE8newpnQYCQ2/QRidKEt6z0zLLZ9PLztGQ+AfXx1Nez23M0b AFcw== X-Received: by 10.14.184.68 with SMTP id r44mr85699476eem.40.1361491949035; Thu, 21 Feb 2013 16:12:29 -0800 (PST) Received: from bremse.ffwll.local (178-83-130-250.dynamic.hispeed.ch. [178.83.130.250]) by mx.google.com with ESMTPS id f47sm493238eep.13.2013.02.21.16.12.27 (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 21 Feb 2013 16:12:28 -0800 (PST) From: Daniel Vetter To: Intel Graphics Development Date: Fri, 22 Feb 2013 01:12:11 +0100 Message-Id: <1361491936-14334-4-git-send-email-daniel.vetter@ffwll.ch> X-Mailer: git-send-email 1.7.11.4 In-Reply-To: <1361491936-14334-1-git-send-email-daniel.vetter@ffwll.ch> References: <1361491936-14334-1-git-send-email-daniel.vetter@ffwll.ch> X-Gm-Message-State: ALoCoQnWEE8Bmp7+9EcV5/NHZns5fmj4dD2MsIdW3CnfZ3OM6/1k3L17j5yvwMx28g+Lodr53eIO Cc: Daniel Vetter Subject: [Intel-gfx] [PATCH 3/8] drm/i915: split up fdi_set_m_n into computation and hw setup 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+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+patchwork-intel-gfx=patchwork.kernel.org@lists.freedesktop.org And also move the computed m_n values into the pipe_config. This is a prep step to move the fdi state computation completely into the prepare phase of the modeset sequence. Which will allow us to handle fdi link bw constraints in a better way. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 26 +++++++++++++++----------- drivers/gpu/drm/i915/intel_drv.h | 3 ++- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index c75d429..caecec1 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -5216,13 +5216,11 @@ void intel_cpu_transcoder_set_m_n(struct intel_crtc *crtc, } } -static void ironlake_fdi_set_m_n(struct drm_crtc *crtc) +static void ironlake_fdi_compute_config(struct intel_crtc *intel_crtc) { - struct drm_device *dev = crtc->dev; - struct intel_crtc *intel_crtc = to_intel_crtc(crtc); + struct drm_device *dev = intel_crtc->base.dev; struct drm_display_mode *adjusted_mode = &intel_crtc->config.adjusted_mode; - struct intel_link_m_n m_n = {0}; int target_clock, lane, link_bw; /* FDI is a binary signal running at ~2.7GHz, encoding @@ -5247,9 +5245,7 @@ static void ironlake_fdi_set_m_n(struct drm_crtc *crtc) if (intel_crtc->config.pixel_multiplier > 1) link_bw *= intel_crtc->config.pixel_multiplier; intel_link_compute_m_n(intel_crtc->config.pipe_bpp, lane, target_clock, - link_bw, &m_n); - - intel_cpu_transcoder_set_m_n(intel_crtc, &m_n); + link_bw, &intel_crtc->config.fdi_m_n); } static uint32_t ironlake_compute_dpll(struct intel_crtc *intel_crtc, @@ -5460,8 +5456,12 @@ static int ironlake_crtc_mode_set(struct drm_crtc *crtc, /* Note, this also computes intel_crtc->fdi_lanes which is used below in * ironlake_check_fdi_lanes. */ intel_crtc->config.fdi_lanes = 0; - if (intel_crtc->config.has_pch_encoder) - ironlake_fdi_set_m_n(crtc); + if (intel_crtc->config.has_pch_encoder) { + ironlake_fdi_compute_config(intel_crtc); + + intel_cpu_transcoder_set_m_n(intel_crtc, + &intel_crtc->config.fdi_m_n); + } fdi_config_ok = ironlake_check_fdi_lanes(intel_crtc); @@ -5588,8 +5588,12 @@ static int haswell_crtc_mode_set(struct drm_crtc *crtc, intel_set_pipe_timings(intel_crtc, mode, adjusted_mode); - if (intel_crtc->config.has_pch_encoder) - ironlake_fdi_set_m_n(crtc); + if (intel_crtc->config.has_pch_encoder) { + ironlake_fdi_compute_config(intel_crtc); + + intel_cpu_transcoder_set_m_n(intel_crtc, + &intel_crtc->config.fdi_m_n); + } haswell_set_pipeconf(crtc); diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 9d01482..7677fa8 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -223,8 +223,9 @@ struct intel_crtc_config { /* Used by SDVO (and if we ever fix it, HDMI). */ unsigned pixel_multiplier; - /* FDI lanes used, only valid if has_pch_encoder is set. */ + /* FDI configuration, only valid if has_pch_encoder is set. */ int fdi_lanes; + struct intel_link_m_n fdi_m_n; }; struct intel_crtc {