• P
    drm/i915: save some time when waiting the eDP timings · dce56b3c
    Paulo Zanoni 提交于
    The eDP spec defines some points where after you do action A, you have
    to wait some time before action B. The thing is that in our driver
    action B does not happen exactly after action A, but we still use
    msleep() calls directly. What this patch does is that we record the
    timestamp of when action A happened, then, just before action B, we
    look at how much time has passed and only sleep the remaining amount
    needed.
    
    With this change, I am able to save about 5-20ms (out of the total
    200ms) of the backlight_off delay and completely skip the 1ms
    backlight_on delay. The 600ms vdd_off delay doesn't happen during
    normal usage anymore due to a previous patch.
    
    v2: - Rename ironlake_wait_jiffies_delay to intel_wait_until_after and
          move it to intel_display.c
        - Fix the msleep call: diff is in jiffies
    v3: - Use "tmp_jiffies" so we don't need to worry about the value of
          "jiffies" advancing while we're doing the math.
    v4: - Rename function again.
        - Move function to i915_drv.h.
        - Store last_power_cycle at edp_panel_off too.
        - Use msecs_to_jiffies_timeout, then replace the msleep with an
          open-coded version that avoids the extra +1 jiffy.
        - Try to add units to every variable name so we don't confuse
          jiffies with milliseconds.
    Signed-off-by: NPaulo Zanoni <paulo.r.zanoni@intel.com>
    Reviewed-by: NJani Nikula <jani.nikula@intel.com>
    Signed-off-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
    dce56b3c
intel_dp.c 107.0 KB