From: Ville Syrjälä Date: Thu, 15 Feb 2024 16:40:52 +0000 (+0200) Subject: drm/i915: Skip intel_crtc_state_dump() if debugs aren't enabled X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3cb1b6956b8e2d9b66840e22286d1a51258fecbf;p=linux.git drm/i915: Skip intel_crtc_state_dump() if debugs aren't enabled intel_crtc_state_dump() does a whole boatload of string formatting which is all wasted energy if the debugs aren't even enabled. Skip the whole thing in that case. Signed-off-by: Ville Syrjälä Link: https://patchwork.freedesktop.org/patch/msgid/20240215164055.30585-10-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula --- diff --git a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c index b5b9b99213cf5..cd78c200d4838 100644 --- a/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c +++ b/drivers/gpu/drm/i915/display/intel_crtc_state_dump.c @@ -192,6 +192,9 @@ void intel_crtc_state_dump(const struct intel_crtc_state *pipe_config, char buf[64]; int i; + if (!drm_debug_enabled(DRM_UT_KMS)) + return; + p = drm_dbg_printer(&i915->drm, DRM_UT_KMS, NULL); drm_printf(&p, "[CRTC:%d:%s] enable: %s [%s]\n",