tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: i915drmkms debug log issue
On Wed, 29 Apr 2026, Rui-Xiang Guo wrote:
I test them on NetBSD/amd64 10.0 and the results are:
1.
[ 4.5991173] {drm:netbsd:intel_update_max_cdclk+0x8d} Max CD clock rate: 200000 kHz
[ 4.5991173] {drm:netbsd:intel_update_max_cdclk+0xa6} Max dotclock rate: 360000 kHz
[ 4.6117287] {drm:netbsd:intel_modeset_init+0x174f} test with adding DRM_DEBUG_DRIVER
2.
[ 4.5992919] {drm:netbsd:intel_update_max_cdclk+0x8d} Max CD clock rate: 200000 kHz
[ 4.5992919] {drm:netbsd:intel_update_max_cdclk+0xa6} Max dotclock rate: 360000 kHz
[ 4.6119114] test with adding printf
Right, so this is as I suspected. (It's is harmless and you can ignore it.)
If you look at the intel_update_max_cdclk() function, the 2 calls to DRM_DEBUG_DRIVER()
are back-to-back and after the second one, the function exits, so we have this
situation:
```
2512 DRM_DEBUG_DRIVER("Max CD clock rate: %d kHz\n",
2513 dev_priv->max_cdclk_freq);
2514 <--- 1st __builtin_return_address(0) points here.
2515 DRM_DEBUG_DRIVER("Max dotclock rate: %d kHz\n",
2516 dev_priv->max_dotclk_freq);
2517 } <--- 2nd __builtin_return_address(0)
```
The 1st __builtin_return_address(0) returns an address inside intel_update_max_cdclk(),
but for the 2nd __builtin_return_address(0), since the function is ending right
afterwards, gcc(1) will return an address in this functions caller, intel_mode_config_init().
This is with any kind of optimization. Without any `-O' flag, I suspect gcc(1)'ll
do the right thing. And, I'm pretty sure that you'll see this same behaviour in
userspace too.
Haven't looked to see how Linux handles this situation.
-RVP
Refs:
https://github.com/NetBSD/src/blob/trunk/sys/external/bsd/drm2/dist/include/drm/drm_print.h#L526
https://github.com/NetBSD/src/blob/trunk/sys/external/bsd/drm2/dist/drm/drm_print.c#L393
https://github.com/NetBSD/src/blob/trunk/sys/external/bsd/drm2/dist/drm/drm_print.c#L83
https://github.com/NetBSD/src/blob/trunk/sys/external/bsd/drm2/dist/drm/i915/display/intel_cdclk.c#L2512
https://github.com/NetBSD/src/blob/trunk/sys/external/bsd/drm2/dist/drm/i915/display/intel_display.c#L17637
Home |
Main Index |
Thread Index |
Old Index