Skip to content

Commit 2af231e

Browse files
tititiou36rodrigovivi
authored andcommitted
drm/i915/guc: Remove usage of the deprecated ida_simple_xx() API
ida_alloc() and ida_free() should be preferred to the deprecated ida_simple_get() and ida_simple_remove(). Note that the upper limit of ida_simple_get() is exclusive, but the one of ida_alloc_range() is inclusive. So a -1 has been added when needed. Signed-off-by: Christophe JAILLET <[email protected]> Reviewed-by: Matthew Brost <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/7108c1871c6cb08d403c4fa6534bc7e6de4cb23d.1705245316.git.christophe.jaillet@wanadoo.fr Signed-off-by: Rodrigo Vivi <[email protected]>
1 parent 3563d85 commit 2af231e

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

drivers/gpu/drm/i915/gt/uc/intel_guc_submission.c

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2215,11 +2215,10 @@ static int new_guc_id(struct intel_guc *guc, struct intel_context *ce)
22152215
order_base_2(ce->parallel.number_children
22162216
+ 1));
22172217
else
2218-
ret = ida_simple_get(&guc->submission_state.guc_ids,
2219-
NUMBER_MULTI_LRC_GUC_ID(guc),
2220-
guc->submission_state.num_guc_ids,
2221-
GFP_KERNEL | __GFP_RETRY_MAYFAIL |
2222-
__GFP_NOWARN);
2218+
ret = ida_alloc_range(&guc->submission_state.guc_ids,
2219+
NUMBER_MULTI_LRC_GUC_ID(guc),
2220+
guc->submission_state.num_guc_ids - 1,
2221+
GFP_KERNEL | __GFP_RETRY_MAYFAIL | __GFP_NOWARN);
22232222
if (unlikely(ret < 0))
22242223
return ret;
22252224

@@ -2242,8 +2241,8 @@ static void __release_guc_id(struct intel_guc *guc, struct intel_context *ce)
22422241
+ 1));
22432242
} else {
22442243
--guc->submission_state.guc_ids_in_use;
2245-
ida_simple_remove(&guc->submission_state.guc_ids,
2246-
ce->guc_id.id);
2244+
ida_free(&guc->submission_state.guc_ids,
2245+
ce->guc_id.id);
22472246
}
22482247
clr_ctx_id_mapping(guc, ce->guc_id.id);
22492248
set_context_guc_id_invalid(ce);

0 commit comments

Comments
 (0)