Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/i915: use struct drm_device for clock gating funcs

While we want to refactor intel_clock_gating.[ch] and likely move a lot
of display related code to display, start off with a little intermediate
change to use struct drm_device in the interface instead of struct
drm_i915_private, to allow us to drop another dependency on i915_drv.h
and struct drm_i915_private.

Cc: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Mika Kahola <mika.kahola@intel.com>
Link: https://patch.msgid.link/20251121112200.3435099-2-jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+18 -17
+1 -3
drivers/gpu/drm/i915/display/intel_display_power.c
··· 1415 1415 1416 1416 static void hsw_disable_pc8(struct intel_display *display) 1417 1417 { 1418 - struct drm_i915_private __maybe_unused *dev_priv = to_i915(display->drm); 1419 - 1420 1418 drm_dbg_kms(display->drm, "Disabling package C8+\n"); 1421 1419 1422 1420 hsw_restore_lcpll(display); ··· 1422 1424 1423 1425 /* Many display registers don't survive PC8+ */ 1424 1426 #ifdef I915 /* FIXME */ 1425 - intel_clock_gating_init(dev_priv); 1427 + intel_clock_gating_init(display->drm); 1426 1428 #endif 1427 1429 } 1428 1430
+2 -3
drivers/gpu/drm/i915/display/intel_display_reset.c
··· 6 6 #include <drm/drm_atomic_helper.h> 7 7 #include <drm/drm_print.h> 8 8 9 - #include "i915_drv.h" 10 9 #include "intel_clock_gating.h" 11 10 #include "intel_cx0_phy.h" 12 11 #include "intel_display_core.h" 13 12 #include "intel_display_driver.h" 14 13 #include "intel_display_reset.h" 15 14 #include "intel_display_types.h" 15 + #include "intel_display_utils.h" 16 16 #include "intel_hotplug.h" 17 17 #include "intel_pps.h" 18 18 ··· 79 79 80 80 void intel_display_reset_finish(struct intel_display *display, bool test_only) 81 81 { 82 - struct drm_i915_private *i915 = to_i915(display->drm); 83 82 struct drm_modeset_acquire_ctx *ctx = &display->restore.reset_ctx; 84 83 struct drm_atomic_state *state; 85 84 int ret; ··· 106 107 */ 107 108 intel_pps_unlock_regs_wa(display); 108 109 intel_display_driver_init_hw(display); 109 - intel_clock_gating_init(i915); 110 + intel_clock_gating_init(display->drm); 110 111 intel_cx0_pll_power_save_wa(display); 111 112 intel_hpd_init(display); 112 113
+2 -2
drivers/gpu/drm/i915/i915_driver.c
··· 263 263 264 264 intel_irq_init(dev_priv); 265 265 intel_display_driver_early_probe(display); 266 - intel_clock_gating_hooks_init(dev_priv); 266 + intel_clock_gating_hooks_init(&dev_priv->drm); 267 267 268 268 intel_detect_preproduction_hw(dev_priv); 269 269 ··· 1276 1276 1277 1277 intel_display_driver_init_hw(display); 1278 1278 1279 - intel_clock_gating_init(dev_priv); 1279 + intel_clock_gating_init(&dev_priv->drm); 1280 1280 1281 1281 if (intel_display_device_present(display)) 1282 1282 intel_display_driver_resume_access(display);
+2 -2
drivers/gpu/drm/i915/i915_gem.c
··· 1184 1184 * 1185 1185 * FIXME: break up the workarounds and apply them at the right time! 1186 1186 */ 1187 - intel_clock_gating_init(dev_priv); 1187 + intel_clock_gating_init(&dev_priv->drm); 1188 1188 1189 1189 for_each_gt(gt, dev_priv, i) { 1190 1190 ret = intel_gt_init(gt); ··· 1235 1235 /* Minimal basic recovery for KMS */ 1236 1236 ret = i915_ggtt_enable_hw(dev_priv); 1237 1237 i915_ggtt_resume(to_gt(dev_priv)->ggtt); 1238 - intel_clock_gating_init(dev_priv); 1238 + intel_clock_gating_init(&dev_priv->drm); 1239 1239 } 1240 1240 1241 1241 i915_gem_drain_freed_objects(dev_priv);
+7 -3
drivers/gpu/drm/i915/intel_clock_gating.c
··· 709 709 _MASKED_BIT_ENABLE(MEM_DISPLAY_B_TRICKLE_FEED_DISABLE)); 710 710 } 711 711 712 - void intel_clock_gating_init(struct drm_i915_private *i915) 712 + void intel_clock_gating_init(struct drm_device *drm) 713 713 { 714 + struct drm_i915_private *i915 = to_i915(drm); 715 + 714 716 i915->clock_gating_funcs->init_clock_gating(i915); 715 717 } 716 718 ··· 751 749 752 750 /** 753 751 * intel_clock_gating_hooks_init - setup the clock gating hooks 754 - * @i915: device private 752 + * @drm: drm device 755 753 * 756 754 * Setup the hooks that configure which clocks of a given platform can be 757 755 * gated and also apply various GT and display specific workarounds for these 758 756 * platforms. Note that some GT specific workarounds are applied separately 759 757 * when GPU contexts or batchbuffers start their execution. 760 758 */ 761 - void intel_clock_gating_hooks_init(struct drm_i915_private *i915) 759 + void intel_clock_gating_hooks_init(struct drm_device *drm) 762 760 { 761 + struct drm_i915_private *i915 = to_i915(drm); 762 + 763 763 if (IS_DG2(i915)) 764 764 i915->clock_gating_funcs = &dg2_clock_gating_funcs; 765 765 else if (IS_COFFEELAKE(i915) || IS_COMETLAKE(i915))
+3 -3
drivers/gpu/drm/i915/intel_clock_gating.h
··· 6 6 #ifndef __INTEL_CLOCK_GATING_H__ 7 7 #define __INTEL_CLOCK_GATING_H__ 8 8 9 - struct drm_i915_private; 9 + struct drm_device; 10 10 11 - void intel_clock_gating_init(struct drm_i915_private *i915); 12 - void intel_clock_gating_hooks_init(struct drm_i915_private *i915); 11 + void intel_clock_gating_init(struct drm_device *drm); 12 + void intel_clock_gating_hooks_init(struct drm_device *drm); 13 13 14 14 #endif /* __INTEL_CLOCK_GATING_H__ */
+1 -1
drivers/gpu/drm/i915/vlv_suspend.c
··· 453 453 vlv_check_no_gt_access(dev_priv); 454 454 455 455 if (rpm_resume) 456 - intel_clock_gating_init(dev_priv); 456 + intel_clock_gating_init(&dev_priv->drm); 457 457 458 458 return ret; 459 459 }