diff options
author | Lucas De Marchi <lucas.demarchi@intel.com> | 2024-07-27 03:59:05 +0200 |
---|---|---|
committer | Lucas De Marchi <lucas.demarchi@intel.com> | 2024-07-29 20:19:40 +0200 |
commit | d51a75ac975a6147a4dea2d68cef4566f5c2ecaf (patch) | |
tree | 451b52ce6daab0dcce72eabd0565e867a7d8d4e4 /drivers/gpu/drm/xe/xe_rtp.c | |
parent | drm/xe/kunit: Test rtp with no actions (diff) | |
download | linux-d51a75ac975a6147a4dea2d68cef4566f5c2ecaf.tar.xz linux-d51a75ac975a6147a4dea2d68cef4566f5c2ecaf.zip |
drm/xe/rtp: Simplify marking active workarounds
Stop doing the calculation both in rtp_mark_active() and in its caller.
The caller easily knows the number of entries to mark, so just pass it
forward. That also simplifies rtp_mark_active() since now it doesn't
have a special case when handling 1 entry.
Reviewed-by: Gustavo Sousa <gustavo.sousa@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240727015907.899192-7-lucas.demarchi@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
Diffstat (limited to 'drivers/gpu/drm/xe/xe_rtp.c')
-rw-r--r-- | drivers/gpu/drm/xe/xe_rtp.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/drm/xe/xe_rtp.c b/drivers/gpu/drm/xe/xe_rtp.c index 1c641cc0f5a1..86727f34ca25 100644 --- a/drivers/gpu/drm/xe/xe_rtp.c +++ b/drivers/gpu/drm/xe/xe_rtp.c @@ -221,18 +221,15 @@ EXPORT_SYMBOL_IF_KUNIT(xe_rtp_process_ctx_enable_active_tracking); static void rtp_mark_active(struct xe_device *xe, struct xe_rtp_process_ctx *ctx, - unsigned int first, unsigned int last) + unsigned int first, unsigned int n_entries) { if (!ctx->active_entries) return; - if (drm_WARN_ON(&xe->drm, last > ctx->n_entries)) + if (drm_WARN_ON(&xe->drm, first + n_entries > ctx->n_entries)) return; - if (first == last) - bitmap_set(ctx->active_entries, first, 1); - else - bitmap_set(ctx->active_entries, first, last - first + 1); + bitmap_set(ctx->active_entries, first, n_entries); } /** @@ -277,8 +274,7 @@ void xe_rtp_process_to_sr(struct xe_rtp_process_ctx *ctx, } if (match) - rtp_mark_active(xe, ctx, entry - entries, - entry - entries); + rtp_mark_active(xe, ctx, entry - entries, 1); } } EXPORT_SYMBOL_IF_KUNIT(xe_rtp_process_to_sr); @@ -324,7 +320,7 @@ void xe_rtp_process(struct xe_rtp_process_ctx *ctx, entry--; rtp_mark_active(xe, ctx, first_entry - entries, - entry - entries); + entry - first_entry + 1); } } EXPORT_SYMBOL_IF_KUNIT(xe_rtp_process); |