OSDN Git Service

drm/i915: Remove the unneeded AUX power ref from intel_dp_detect()
authorImre Deak <imre.deak@intel.com>
Thu, 9 May 2019 17:34:42 +0000 (20:34 +0300)
committerImre Deak <imre.deak@intel.com>
Tue, 14 May 2019 11:06:30 +0000 (14:06 +0300)
commit6cfe7ec02e854278fb341e62db54d49a2b199c62
tree352beeb2fa39885f36f8eae2339f0c7bf59adb9a
parentad5125d6ef2de22212de82debd0baaecdaa7e7cd
drm/i915: Remove the unneeded AUX power ref from intel_dp_detect()

We don't need the AUX power for the whole duration of the detect, only
when we're doing AUX transfers. The AUX transfer function takes its own
reference on the AUX power domain already. The two places during detect
which access display core registers (not specific to a
pipe/port/transcoder) only need the power domain that is required for
that access. That power domain is equivalent to the device global power
domain on most platforms (enabled whenever we hold a runtime PM
reference) except on CHV/VLV where it's equivalent to the display power
well.

Add a new power domain that reflects the above, and use this at the two
spots accessing registers. With that we can avoid taking the AUX
reference for the whole duration of the detect function.

Put the domains asynchronously to avoid the unneeded on-off-on toggling.

Also adapt the idea from with_intel_runtime_pm et al. for making it easy
to write short sequences where a display power ref is needed.

v2: (Ville)
- Add with_intel_display_power() helper to simplify things.
- s/bool res/bool is_connected/

Cc: Ville Syrjala <ville.syrjala@linux.intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190509173446.31095-8-imre.deak@intel.com
drivers/gpu/drm/i915/intel_display.h
drivers/gpu/drm/i915/intel_dp.c
drivers/gpu/drm/i915/intel_runtime_pm.c
drivers/gpu/drm/i915/intel_runtime_pm.h