From: Daniel Vetter Subject: [PATCH 6/9] drm/i915: fix ibx/cpt/ppt dpll limits Date: Tue, 21 May 2013 21:54:56 +0200 Message-ID: <1369166099-1840-7-git-send-email-daniel.vetter@ffwll.ch> References: <1369166099-1840-1-git-send-email-daniel.vetter@ffwll.ch> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail-we0-f175.google.com (mail-we0-f175.google.com [74.125.82.175]) by gabe.freedesktop.org (Postfix) with ESMTP id 8F08CE625C for ; Tue, 21 May 2013 12:55:16 -0700 (PDT) Received: by mail-we0-f175.google.com with SMTP id p60so605210wes.6 for ; Tue, 21 May 2013 12:55:15 -0700 (PDT) In-Reply-To: <1369166099-1840-1-git-send-email-daniel.vetter@ffwll.ch> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Intel Graphics Development Cc: Daniel Vetter List-Id: intel-gfx@lists.freedesktop.org Now this was broken in pretty fundamental ways: - M1/M2 have been consistently off by 2 and used doc values instead of the two less registers values our code expects. - M/N limits often were too small by seemingly arbitrary amounts. I suspect this started to work around issues due to the wrong M1/M2 limits. Rectify this all and consolidate the limits a bit with a #define where the docs say that they should be equal. Signed-off-by: Daniel Vetter --- drivers/gpu/drm/i915/intel_display.c | 36 +++++++++++------------------------- 1 file changed, 11 insertions(+), 25 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 520e340..80698ac 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -217,18 +217,16 @@ static const intel_limit_t intel_limits_pineview_lvds = { .p2_slow = 14, .p2_fast = 14 }, }; -/* Ironlake / Sandybridge - * - * We calculate clock using (register_value + 2) for N/M1/M2, so here - * the range value for them is (actual_value - 2). - */ +#define ILK_DPLL_M_N_LIMITS \ + .n = { .min = 1, .max = 6 }, \ + .m = { .min = 79, .max = 127 }, \ + .m1 = { .min = 10, .max = 20 }, \ + .m2 = { .min = 3, .max = 7 }, \ + static const intel_limit_t intel_limits_ironlake_dac = { .dot = { .min = 25000, .max = 350000 }, .vco = { .min = 1760000, .max = 3510000 }, - .n = { .min = 1, .max = 5 }, - .m = { .min = 79, .max = 127 }, - .m1 = { .min = 12, .max = 22 }, - .m2 = { .min = 5, .max = 9 }, + ILK_DPLL_M_N_LIMITS .p = { .min = 5, .max = 80 }, .p1 = { .min = 1, .max = 8 }, .p2 = { .dot_limit = 225000, @@ -238,10 +236,7 @@ static const intel_limit_t intel_limits_ironlake_dac = { static const intel_limit_t intel_limits_ironlake_single_lvds = { .dot = { .min = 25000, .max = 350000 }, .vco = { .min = 1760000, .max = 3510000 }, - .n = { .min = 1, .max = 3 }, - .m = { .min = 79, .max = 118 }, - .m1 = { .min = 12, .max = 22 }, - .m2 = { .min = 5, .max = 9 }, + ILK_DPLL_M_N_LIMITS .p = { .min = 28, .max = 112 }, .p1 = { .min = 2, .max = 8 }, .p2 = { .dot_limit = 225000, @@ -251,10 +246,7 @@ static const intel_limit_t intel_limits_ironlake_single_lvds = { static const intel_limit_t intel_limits_ironlake_dual_lvds = { .dot = { .min = 25000, .max = 350000 }, .vco = { .min = 1760000, .max = 3510000 }, - .n = { .min = 1, .max = 3 }, - .m = { .min = 79, .max = 127 }, - .m1 = { .min = 12, .max = 22 }, - .m2 = { .min = 5, .max = 9 }, + ILK_DPLL_M_N_LIMITS .p = { .min = 14, .max = 56 }, .p1 = { .min = 2, .max = 8 }, .p2 = { .dot_limit = 225000, @@ -265,10 +257,7 @@ static const intel_limit_t intel_limits_ironlake_dual_lvds = { static const intel_limit_t intel_limits_ironlake_single_lvds_100m = { .dot = { .min = 25000, .max = 350000 }, .vco = { .min = 1760000, .max = 3510000 }, - .n = { .min = 1, .max = 2 }, - .m = { .min = 79, .max = 126 }, - .m1 = { .min = 12, .max = 22 }, - .m2 = { .min = 5, .max = 9 }, + ILK_DPLL_M_N_LIMITS .p = { .min = 28, .max = 112 }, .p1 = { .min = 2, .max = 8 }, .p2 = { .dot_limit = 225000, @@ -278,10 +267,7 @@ static const intel_limit_t intel_limits_ironlake_single_lvds_100m = { static const intel_limit_t intel_limits_ironlake_dual_lvds_100m = { .dot = { .min = 25000, .max = 350000 }, .vco = { .min = 1760000, .max = 3510000 }, - .n = { .min = 1, .max = 3 }, - .m = { .min = 79, .max = 126 }, - .m1 = { .min = 12, .max = 22 }, - .m2 = { .min = 5, .max = 9 }, + ILK_DPLL_M_N_LIMITS .p = { .min = 14, .max = 42 }, .p1 = { .min = 2, .max = 6 }, .p2 = { .dot_limit = 225000, -- 1.7.11.7