drm/i915: Skip vblank wait if cxsr was already off
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 28 Nov 2016 17:37:12 +0000 (19:37 +0200)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Mon, 5 Dec 2016 14:23:27 +0000 (16:23 +0200)
commit11a85d6ab11440c87ff22bcdaa3b97dd5748ae14
tree21c5aca2ec87d3adad4647f5098b04bb497c0e37
parent3d90e649fa3da5c6e5cb72700584689eb6260082
drm/i915: Skip vblank wait if cxsr was already off

Before we attempt to turn any planes on or off we must first exit
csxr. That's due to cxsr effectively making the plane enable bits
read-only. Currently we achieve that with a vblank wait right after
toggling the cxsr enable bit. We do the vblank wait even if cxsr was
already off, which seems wasteful, so let's try to only do it when
absolutely necessary.

We could start tracking the cxsr state fully somewhere, but for now
it seems easiest to just have intel_set_memory_cxsr() return the
previous cxsr state.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1480354637-14209-11-git-send-email-ville.syrjala@linux.intel.com
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_display.c
drivers/gpu/drm/i915/intel_pm.c