drm/i915: save some time when waiting the eDP timings
authorPaulo Zanoni <paulo.r.zanoni@intel.com>
Thu, 19 Dec 2013 16:29:40 +0000 (14:29 -0200)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Fri, 24 Jan 2014 16:22:46 +0000 (17:22 +0100)
commitdce56b3c626fb1d533258a624d42a1a3fc17da17
treeb9409c2403fdf46e16e224cbbf22ba32a11b1643
parent0095e6dcd36199a4d4b8deaab6b812ec88bcf825
drm/i915: save some time when waiting the eDP timings

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: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_drv.h
This page took 0.032778 seconds and 5 git commands to generate.