Add a helper for checking the gpu_reset_clobbers_display flag to make it easier to relocate the flag later. We keep the intel_gt_gpu_reset_clobbers_display() helper to not have to duplicate the gt -> display pointer chase. Signed-off-by: Jani Nikula <jani.nikula@xxxxxxxxx> --- drivers/gpu/drm/i915/display/intel_display_reset.c | 11 +++++++++-- drivers/gpu/drm/i915/display/intel_display_reset.h | 3 +++ drivers/gpu/drm/i915/gt/intel_reset.c | 3 ++- 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/i915/display/intel_display_reset.c b/drivers/gpu/drm/i915/display/intel_display_reset.c index 1e6421d51c51..93399ace7761 100644 --- a/drivers/gpu/drm/i915/display/intel_display_reset.c +++ b/drivers/gpu/drm/i915/display/intel_display_reset.c @@ -13,12 +13,19 @@ #include "intel_hotplug.h" #include "intel_pps.h" +bool intel_display_gpu_reset_clobbers_display(struct intel_display *display) +{ + struct drm_i915_private *i915 = to_i915(display->drm); + + return INTEL_INFO(i915)->gpu_reset_clobbers_display; +} + static bool gpu_reset_clobbers_display(struct intel_display *display) { struct drm_i915_private *i915 = to_i915(display->drm); - return (INTEL_INFO(i915)->gpu_reset_clobbers_display && - intel_has_gpu_reset(to_gt(i915))); + return intel_display_gpu_reset_clobbers_display(display) && + intel_has_gpu_reset(to_gt(i915)); } void intel_display_reset_prepare(struct intel_display *display) diff --git a/drivers/gpu/drm/i915/display/intel_display_reset.h b/drivers/gpu/drm/i915/display/intel_display_reset.h index 9a1fe99bfcd4..5acc07aab7b5 100644 --- a/drivers/gpu/drm/i915/display/intel_display_reset.h +++ b/drivers/gpu/drm/i915/display/intel_display_reset.h @@ -6,9 +6,12 @@ #ifndef __INTEL_RESET_H__ #define __INTEL_RESET_H__ +#include <linux/types.h> + struct intel_display; void intel_display_reset_prepare(struct intel_display *display); void intel_display_reset_finish(struct intel_display *display); +bool intel_display_gpu_reset_clobbers_display(struct intel_display *display); #endif /* __INTEL_RESET_H__ */ diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c index 0d863aa58fb6..774caaaa4ce5 100644 --- a/drivers/gpu/drm/i915/gt/intel_reset.c +++ b/drivers/gpu/drm/i915/gt/intel_reset.c @@ -1181,8 +1181,9 @@ static int resume(struct intel_gt *gt) bool intel_gt_gpu_reset_clobbers_display(struct intel_gt *gt) { struct drm_i915_private *i915 = gt->i915; + struct intel_display *display = &i915->display; - return INTEL_INFO(i915)->gpu_reset_clobbers_display; + return intel_display_gpu_reset_clobbers_display(display); } /** -- 2.39.5