]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/i915: use drm_modeset_lock_assert_held() in intel_connector_get_pipe()
authorLuca Coelho <luciano.coelho@intel.com>
Tue, 20 May 2025 09:53:53 +0000 (12:53 +0300)
committerMika Kahola <mika.kahola@intel.com>
Thu, 5 Jun 2025 13:07:54 +0000 (16:07 +0300)
In the intel_connector_get_pipe() function, we check if
connection_mutex is held and generate our own WARN_ON if that's the
case.  Instead of generating a non-standard warning for a mutex issue,
we should use the standard lockdep framework.

Change the function to use drm_modeset_lock_assert_held() instead.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Mika Kahola <mika.kahola@intel.com>
Link: https://lore.kernel.org/r/20250520095408.1310440-1-luciano.coelho@intel.com
drivers/gpu/drm/i915/display/intel_connector.c

index 6c81c9f2fd09a76a54c1afa63c1ab4053cac6ed1..9a61c972dce94109caf807a7dd605c5e0d5f64a7 100644 (file)
@@ -209,8 +209,7 @@ enum pipe intel_connector_get_pipe(struct intel_connector *connector)
 {
        struct intel_display *display = to_intel_display(connector);
 
-       drm_WARN_ON(display->drm,
-                   !drm_modeset_is_locked(&display->drm->mode_config.connection_mutex));
+       drm_modeset_lock_assert_held(&display->drm->mode_config.connection_mutex);
 
        if (!connector->base.state->crtc)
                return INVALID_PIPE;