drm/i915: Preallocate the debug power domain wakerefs array
authorImre Deak <imre.deak@intel.com>
Mon, 14 Nov 2022 12:22:44 +0000 (14:22 +0200)
committerImre Deak <imre.deak@intel.com>
Fri, 18 Nov 2022 15:27:53 +0000 (17:27 +0200)
commit7ed310025e75826f74f6b3587047118e7176b409
tree0cb4156340f92c0c3217bbab032d91feb4575740
parent10b85f0e1d922210ae857afed6d012ec32c4b6cb
drm/i915: Preallocate the debug power domain wakerefs array

Since the current size of intel_display_power_domain_set struct is
close to 1kB, it's better to use preallocated memory for it. The only
user of the intel_display_power_get/put_in_set() allocating the struct
on stack is hsw_get_pipe_config(), so we can avoid potential stack
overallocations by moving the struct here to the preallocated
intel_crtc struct (hsw_get_pipe_config() is non-reentrant wrt. each
CRTC).

This patch replaces
https://lore.kernel.org/intel-gfx/20221107170917.3566758-5-imre.deak@intel.com/T/#md3f6cdf17fcd

Suggested-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Jani Nikula <jani.nikula@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/20221114122251.21327-3-imre.deak@intel.com
drivers/gpu/drm/i915/display/intel_display.c
drivers/gpu/drm/i915/display/intel_display_types.h