From nobody Tue Apr 7 12:55:31 2026 Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5BB073BD225 for ; Fri, 13 Mar 2026 13:25:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.167.177 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408312; cv=none; b=Wp+nLzqo0bLpCW1EFhn9opMmZxyv1SJViXz9r6+QOzXKNVrDVFyg4O0yLscexj4mHjRcSOGlAbDXbvQ9Qh28+x9cOvvx5OMsjsOMnAcXmtcRvf69JSDvNQUDVGzE7WmBXqYahvfQlLKO+5hMeo+YkJJL+8WHgEAW+eq1vmWPfUI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773408312; c=relaxed/simple; bh=WZngrojUvz5q82ybHwgvtDZoge1DVAZUgBqmVpCiQOY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=JsjfvpaMR7QrKImMMCNN7yv/lXvR30lrUA6+pvHsesMLi7sWV2JbTl+YWZQw4s5kIUH6tsVG7SP09Mz1MYfPBBK4XIJewcB2x8sKuBWKcdI49TLNMr0pluWP/qI4gT1+fx8Crb4lSiGNxlur3PwSWYFgjnI96Jo09OoFPoFP7Lo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=TNSwXxiM; arc=none smtp.client-ip=209.85.167.177 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TNSwXxiM" Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-4672076355aso1531452b6e.2 for ; Fri, 13 Mar 2026 06:25:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773408310; x=1774013110; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=BxHe4+DOmq20FSC3herHJvg5metbXtBJFuJ219tBZ0M=; b=TNSwXxiMEDaa6OVypmewt/gAS6oxQtQSq/iG03kT1i5Ha5VcRahYFr60F7S8JoHB6t LX1BhI9OGlMvz0zRyrsCwfGYsuzdKWUaCgsrC4qzp9pglsQynTW9CmS/kgzfOm+/EvUx 6o+vcB2TxE/j19Rlft98sc1EJaEg/vi9dKVaPLQocgzsvkuYml7pY6uMN49yNaaG//ie +2Fg7P5dutlN0o0iImCvUoP7ajXnWERcDPA7n4/n73eGYbUmT6lBTCELyIZjIooPB92O pCrEH7AQtaqtc2R8L0NcERzfiteTx0Y3zeXRb010bU+GZ05h1pd2XNdHwsStlnXJkGks JFsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773408310; x=1774013110; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=BxHe4+DOmq20FSC3herHJvg5metbXtBJFuJ219tBZ0M=; b=N7JlQNdKw3hOo5hECDwxghG2oSyN00WqDLXpfsGtbU+4wm1LxRyhXyVG+Pil/r6rBz Qe+TMFAZ6RlLWSUPblQaV9q9tUIIeSyLtfMQ+FytBE9JXN8GsHm1xZWyo/lfOBwZ00tV XE4GaA/wCM7FS2pSuKy7oqhjxYHM70qblCxQYH93G3i71h+1hQdfDkuzgBo1Bfnfj98U ByfPEAHnPUdJUNQI+e/S3dajxOSwE8xBG5hKrwMqwCrW8gJVyCiTf7vqcwcIAkawf7O8 7KKMGi/Ke+bGaARSrbV/z1Jwcr1OV8c3JeHwMI2Kcs+MNfEMXPPJhGWKps35HhIPCKrG 55hQ== X-Forwarded-Encrypted: i=1; AJvYcCVs1Hi5X4MVrYafeJlb+gQ5sRbe9Ihp5Auxt5VD16fdVZUB/od+cSCI4w5mWIhnTMZcvG6i6Ihb4K5z6gY=@vger.kernel.org X-Gm-Message-State: AOJu0YxSr8K/u21imMFsI8JgxmE5hBR1kDqMXt63hHuWppSTXZct6aUi E6ZCOVmbaDXTv0kkvusy/51tIhfglcyjkunk2AP97DsCm9trpLEYPUVY X-Gm-Gg: ATEYQzzwOLX117XL79LhmLOTFOeREx2bCu6r343PYoOzpiO7WHc3CYo935FiYWyxE5V w5WRqqYx+9s4u/K/AMWRrE9rn71/sg2tQ542iWSzQOvJFgXO4IMcKLzHo1yVfQVbizZyHxACOhh a0tFYuUsCVPX0GMiqQi1fO1peXidXldneb7VL/VtMohB7T/Nkx3fr6i3etu6xuJ8KHhJwgB2c/B wOfHaE9dw8ulazD7fEdMnoR+9vIeUkajgGINsDB5RsIjbveltkH+YYrBzC7VwJyKdRyi55mt9EP iEjeNE/tOHuvmuzuaNTBoZ8ABdcXsiq42LvHHy2Rn8cNGSKUkpR3T9qTr4LrFgwx8Zcmju7xVkr 1m2jhiB9EPFj8MP1LlwF+2RKZ4vUHpg62184HmUQEH8Up3nsB+AeF5h8XBUQCtmG2O/exaVTbsl G4Nxe/Of6/Cc3fOGVkm7uxJLOwLsrycyay6hwUxf+8QalnL0Ux X-Received: by 2002:a05:6808:118e:b0:467:268d:31cc with SMTP id 5614622812f47-46757144050mr1803892b6e.26.1773408310188; Fri, 13 Mar 2026 06:25:10 -0700 (PDT) Received: from frodo (c-98-38-17-99.hsd1.co.comcast.net. [98.38.17.99]) by smtp.googlemail.com with ESMTPSA id 5614622812f47-4673434a35csm4795987b6e.20.2026.03.13.06.25.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Mar 2026 06:25:09 -0700 (PDT) From: Jim Cromie To: airlied@gmail.com, simona@ffwll.ch, jbaron@akamai.com, gregkh@linuxfoundation.org, Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Jim Cromie , jani.nikula@intel.com, ville.syrjala@linux.intel.com, christian.koenig@amd.com, matthew.auld@intel.com, arunpravin.paneerselvam@amd.com, louis.chauvet@bootlin.com, skhan@linuxfoundation.org, pmladek@suse.com, ukaszb@chromium.org, intel-gfx@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Subject: [PATCH v11 65/65] drm_vblank: use dyndbg's static-key to avoid flag-check Date: Fri, 13 Mar 2026 07:20:30 -0600 Message-ID: <20260313132103.2529746-66-jim.cromie@gmail.com> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260313132103.2529746-1-jim.cromie@gmail.com> References: <20260313132103.2529746-1-jim.cromie@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" drm_crtc_vblank_helper_get_vblank_timestamp_internal() is called about ~100 times per sec, on a single display. It currently calls drm_debug_enabled(DRM_UT_VBL) to avoid doing ktime_to_timespec64() conversions when the debug logging is disabled. When CONFIG_DRM_USE_DYNAMIC_DEBUG=3DY, the drm_debug_enabled() is redundant, because the following drm_dbg_vbl() already carries a static-key optimization. So move the ktime conversions into the drm_dbg_vbl() argument list, then they are guarded natively by the static key. This avoids the double-check entirely. TBD: if CONFIG_DRM_USE_DYNAMIC_DEBUG=3DN, this does the ktime conversions unconditionally, so this might not be prudent (yet). Signed-off-by: Jim Cromie Reviewed-by: Louis Chauvet --- drivers/gpu/drm/drm_vblank.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/drm_vblank.c b/drivers/gpu/drm/drm_vblank.c index f78bf37f1e0a..0dac7eec2066 100644 --- a/drivers/gpu/drm/drm_vblank.c +++ b/drivers/gpu/drm/drm_vblank.c @@ -803,15 +803,11 @@ drm_crtc_vblank_helper_get_vblank_timestamp_internal( */ *vblank_time =3D ktime_sub_ns(etime, delta_ns); =20 - if (!drm_debug_enabled(DRM_UT_VBL)) - return true; - - ts_etime =3D ktime_to_timespec64(etime); - ts_vblank_time =3D ktime_to_timespec64(*vblank_time); - drm_dbg_vbl(dev, "crtc %u : v p(%d,%d)@ %ptSp -> %ptSp [e %d us, %d rep]\n", - pipe, hpos, vpos, &ts_etime, &ts_vblank_time, + pipe, hpos, vpos, + (ts_etime =3D ktime_to_timespec64(etime), &ts_etime), + (ts_vblank_time =3D ktime_to_timespec64(*vblank_time), &ts_vblank_ti= me), duration_ns / 1000, i); =20 return true; --=20 2.53.0