• Ville Syrjälä's avatar
    drm/i915: Disable LP3 watermarks on all SNB machines · 03981c6e
    Ville Syrjälä authored
    I have a Thinkpad X220 Tablet in my hands that is losing vblank
    interrupts whenever LP3 watermarks are used.
    
    If I nudge the latency value written to the WM3 register just
    by one in either direction the problem disappears. That to me
    suggests that the punit will not enter the corrsponding
    powersave mode (MPLL shutdown IIRC) unless the latency value
    in the register matches exactly what we read from SSKPD. Ie.
    it's not really a latency value but rather just a cookie
    by which the punit can identify the desired power saving state.
    On HSW/BDW this was changed such that we actually just write
    the WM level number into those bits, which makes much more
    sense given the observed behaviour.
    
    We could try to handle this by disallowing LP3 watermarks
    only when vblank interrupts are enabled but we'd first have
    to prove that only vblank interrupts are affected, which
    seems unlikely. Also we can't grab the wm mutex from the
    vblank enable/disable hooks because those are called with
    various spinlocks held. Thus we'd have to redesigne the
    watermark locking. So to play it safe and keep the code
    simple we simply disable LP3 watermarks on all SNB machines.
    
    To do that we simply zero out the latency values for
    watermark level 3, and we adjust the watermark computation
    to check for that. The behaviour now matches that of the
    g4x/vlv/skl wm code in the presence of a zeroed latency
    value.
    
    v2: s/USHRT_MAX/U32_MAX/ for consistency with the types (Chris)
    
    Cc: stable@vger.kernel.org
    Cc: Chris Wilson <chris@chris-wilson.co.uk>
    Acked-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101269
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103713Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Link: https://patchwork.freedesktop.org/patch/msgid/20181114173440.6730-1-ville.syrjala@linux.intel.com
    03981c6e
intel_pm.c 283 KB