drm/i915: Refactor the hpd irq handling functions
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 27 Aug 2015 20:56:10 +0000 (23:56 +0300)
committerDaniel Vetter <daniel.vetter@ffwll.ch>
Wed, 2 Sep 2015 15:01:32 +0000 (17:01 +0200)
commit40e5641086f6f64acb13ff6893cf82c4fb30a6d7
treee7a577fad736b2a19fb73ab9fbbd9f13ed9305aa
parentcebd87a07748b649f22356efd56f478248aec300
drm/i915: Refactor the hpd irq handling functions

A lot of the hpd irq handling is duplicated code, so refactor it a bit
by observing that in several places the only difference is the hpd[]
array. So pull the code to a few functions and pass in the hpd[] array
from the caller. Another option would be to determine the correct array
to use within the functions themselves, but somehow passing it in felt
nicer.

Further code reduction could be achieved by passing in the hotplug
register offset, and the long pulse detection function pointer. But that
didn't feel as good for some reason, so I left it at the middle ground.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
drivers/gpu/drm/i915/i915_irq.c