Hi Krzysztof,
On 2026-08-28 at 10:03:36 +0000, Krzysztof Karas wrote:
> Move away from generic pr prints to device context aware drm
> versions.
>
> Assisted-by: GitHub-Copilot:claude-opus-5
> Signed-off-by: Krzysztof Karas <[email protected]>
> ---
> drivers/gpu/drm/i915/gt/selftest_rc6.c | 59 +++--
> drivers/gpu/drm/i915/gt/selftest_rps.c | 297 ++++++++++++++-----------
> 2 files changed, 203 insertions(+), 153 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/gt/selftest_rc6.c
> b/drivers/gpu/drm/i915/gt/selftest_rc6.c
> index 68fb1830d411..c744579a942f 100644
> --- a/drivers/gpu/drm/i915/gt/selftest_rc6.c
> +++ b/drivers/gpu/drm/i915/gt/selftest_rc6.c
> @@ -14,6 +14,8 @@
> #include "selftests/i915_random.h"
> #include "selftests/librapl.h"
>
> +#include <drm/drm_print.h>
> +
Nit for include
> static u64 rc6_residency(struct intel_rc6 *rc6)
> {
> u64 result;
> @@ -32,6 +34,7 @@ static u64 rc6_residency(struct intel_rc6 *rc6)
> int live_rc6_manual(void *arg)
> {
> struct intel_gt *gt = arg;
> + struct drm_i915_private *i915 = gt->i915;
> struct intel_rc6 *rc6 = >->rc6;
> struct intel_rps *rps = >->rps;
> intel_wakeref_t wakeref;
> @@ -80,8 +83,9 @@ int live_rc6_manual(void *arg)
> res[1] = rc6_residency(rc6);
> rc0_freq = intel_rps_read_actual_frequency_fw(rps);
> if ((res[1] - res[0]) >> 10) {
> - pr_err("RC6 residency increased by %lldus while disabled for
> 1000ms!\n",
> - (res[1] - res[0]) >> 10);
> + drm_err(&i915->drm,
> + "RC6 residency increased by %lldus while disabled for
> 1000ms!\n",
> + (res[1] - res[0]) >> 10);
To drive the point home, this is another place where gt_err would be
better, since the test is concerned with a specific gt, and all kinds of
values can differ between different gts on the same multi-gt system.
I'm pretty sure the pr_err was written before multi-gt was a thing (last
two commits changing that line were 599b0d8ce6eda in 2024 that only
changed the string, and before that 730eaeb524261 was in 2019), so there
was no gt id to report. But now having the gt id stated in the error log
could be really valuable for debugging, so this series is a good chance
to improve the logging with gt_prints instead of drm_prints, unless it's
considered out of scope.
(In this case this specific test is always run on the gt with id 0, because
the file that runs it is not adapted for multi gt, but that's another
issue entirely and I hope you see my point)
Snipping the rest, looks okay to me.
Thanks
Krzysztof