On Tue, May 21, 2013 at 09:54:56PM +0200, Daniel Vetter wrote: > 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. So this time I'm reading ibexpeak_xxx.xls > Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch> > --- > 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, In ibexpeak_xxxx.xsl I have n between 3 and 7 (so 1,5 seemed correct) for DAC. It also restrics M between 79 and 118. > @@ -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, For single channel LVDS with ref clock at 120MHz I have n between 3 and 5 (so 1,3 seemed correct). M is restricted to 79,118 here as well > @@ -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, For dual channel LVDS, I have n between 3 and 5, so 1,3? M between 79,127 > @@ -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, And there n between 3,4 so (1,2), M was indeed between 79 and 126 -- Damien