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

drm/i915/vblank: fix context imbalance warnings

When building for xe, we get the context imbalance warning as the actual
locking/unlocking is not compiled:

../drivers/gpu/drm/i915/display/intel_vblank.c:306:13: warning: context imbalance in 'intel_vblank_section_enter' - wrong count at exit
../drivers/gpu/drm/i915/display/intel_vblank.c:314:13: warning: context imbalance in 'intel_vblank_section_exit' - wrong count at exit

Fix by adding separata stubs for xe without __acquires/__releases
annotation.

Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/111de5bee15f408de65b19ece4b68a7ac66b30cf.1724342644.git.jani.nikula@intel.com
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

+10 -4
+10 -4
drivers/gpu/drm/i915/display/intel_vblank.c
··· 303 303 * all register accesses to the same cacheline to be serialized, 304 304 * otherwise they may hang. 305 305 */ 306 + #ifdef I915 306 307 static void intel_vblank_section_enter(struct drm_i915_private *i915) 307 308 __acquires(i915->uncore.lock) 308 309 { 309 - #ifdef I915 310 310 spin_lock(&i915->uncore.lock); 311 - #endif 312 311 } 313 312 314 313 static void intel_vblank_section_exit(struct drm_i915_private *i915) 315 314 __releases(i915->uncore.lock) 316 315 { 317 - #ifdef I915 318 316 spin_unlock(&i915->uncore.lock); 319 - #endif 320 317 } 318 + #else 319 + static void intel_vblank_section_enter(struct drm_i915_private *i915) 320 + { 321 + } 322 + 323 + static void intel_vblank_section_exit(struct drm_i915_private *i915) 324 + { 325 + } 326 + #endif 321 327 322 328 static bool i915_get_crtc_scanoutpos(struct drm_crtc *_crtc, 323 329 bool in_vblank_irq,