Lines Matching full:count

58 	weight = bitmap_weight(dbm->bitmap, dbm->count);  in __fini_dbm()
63 weight, dbm->count); in __fini_dbm()
69 dbm->count = 0; in __fini_dbm()
77 * @count: number of doorbells to manage
79 * The bare-metal or PF driver can pass ~0 as &count to indicate that all
87 int xe_guc_db_mgr_init(struct xe_guc_db_mgr *dbm, unsigned int count) in xe_guc_db_mgr_init() argument
91 if (count == ~0) in xe_guc_db_mgr_init()
92 count = GUC_NUM_DOORBELLS; in xe_guc_db_mgr_init()
95 dbm_assert(dbm, count <= GUC_NUM_DOORBELLS); in xe_guc_db_mgr_init()
97 if (!count) in xe_guc_db_mgr_init()
100 dbm->bitmap = bitmap_zalloc(count, GFP_KERNEL); in xe_guc_db_mgr_init()
103 dbm->count = count; in xe_guc_db_mgr_init()
110 dbm->count, str_plural(dbm->count)); in xe_guc_db_mgr_init()
115 unsigned int count, unsigned int spare) in dbm_reserve_chunk_locked() argument
120 dbm_assert(dbm, count); in dbm_reserve_chunk_locked()
121 dbm_assert(dbm, count <= GUC_NUM_DOORBELLS); in dbm_reserve_chunk_locked()
122 dbm_assert(dbm, dbm->count <= GUC_NUM_DOORBELLS); in dbm_reserve_chunk_locked()
125 if (!dbm->count) in dbm_reserve_chunk_locked()
129 used = bitmap_weight(dbm->bitmap, dbm->count); in dbm_reserve_chunk_locked()
130 if (used + count + spare > dbm->count) in dbm_reserve_chunk_locked()
134 index = bitmap_find_next_zero_area(dbm->bitmap, dbm->count, 0, count, 0); in dbm_reserve_chunk_locked()
135 if (index >= dbm->count) in dbm_reserve_chunk_locked()
138 bitmap_set(dbm->bitmap, index, count); in dbm_reserve_chunk_locked()
144 unsigned int start, unsigned int count) in dbm_release_chunk_locked() argument
146 dbm_assert(dbm, count); in dbm_release_chunk_locked()
147 dbm_assert(dbm, count <= GUC_NUM_DOORBELLS); in dbm_release_chunk_locked()
148 dbm_assert(dbm, dbm->count); in dbm_release_chunk_locked()
149 dbm_assert(dbm, dbm->count <= GUC_NUM_DOORBELLS); in dbm_release_chunk_locked()
155 for (n = 0; n < count; n++) in dbm_release_chunk_locked()
158 bitmap_clear(dbm->bitmap, start, count); in dbm_release_chunk_locked()
189 * @count: number of GuC doorbell IDs to reserve
200 unsigned int count, unsigned int spare) in xe_guc_db_mgr_reserve_range() argument
205 ret = dbm_reserve_chunk_locked(dbm, count, spare); in xe_guc_db_mgr_reserve_range()
215 * @count: number of GuC doorbell IDs to release
218 unsigned int start, unsigned int count) in xe_guc_db_mgr_release_range() argument
221 dbm_release_chunk_locked(dbm, start, count); in xe_guc_db_mgr_release_range()
230 drm_printf_indent(p, indent, "count: %u\n", dbm->count); in dbm_print_locked()
235 for_each_clear_bitrange(rs, re, dbm->bitmap, dbm->count) { in dbm_print_locked()
243 for_each_set_bitrange(rs, re, dbm->bitmap, dbm->count) { in dbm_print_locked()