Lines Matching refs:count

58 	weight = bitmap_weight(dbm->bitmap, dbm->count);
63 weight, dbm->count);
69 dbm->count = 0;
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)
91 if (count == ~0)
92 count = GUC_NUM_DOORBELLS;
95 dbm_assert(dbm, count <= GUC_NUM_DOORBELLS);
97 if (!count)
100 dbm->bitmap = bitmap_zalloc(count, GFP_KERNEL);
103 dbm->count = count;
109 xe_gt_dbg(dbm_to_gt(dbm), "using %u doorbell(s)\n", dbm->count);
114 unsigned int count, unsigned int spare)
119 dbm_assert(dbm, count);
120 dbm_assert(dbm, count <= GUC_NUM_DOORBELLS);
121 dbm_assert(dbm, dbm->count <= GUC_NUM_DOORBELLS);
124 if (!dbm->count)
128 used = bitmap_weight(dbm->bitmap, dbm->count);
129 if (used + count + spare > dbm->count)
133 index = bitmap_find_next_zero_area(dbm->bitmap, dbm->count, 0, count, 0);
134 if (index >= dbm->count)
137 bitmap_set(dbm->bitmap, index, count);
143 unsigned int start, unsigned int count)
145 dbm_assert(dbm, count);
146 dbm_assert(dbm, count <= GUC_NUM_DOORBELLS);
147 dbm_assert(dbm, dbm->count);
148 dbm_assert(dbm, dbm->count <= GUC_NUM_DOORBELLS);
154 for (n = 0; n < count; n++)
157 bitmap_clear(dbm->bitmap, start, count);
188 * @count: number of GuC doorbell IDs to reserve
199 unsigned int count, unsigned int spare)
204 ret = dbm_reserve_chunk_locked(dbm, count, spare);
214 * @count: number of GuC doorbell IDs to release
217 unsigned int start, unsigned int count)
220 dbm_release_chunk_locked(dbm, start, count);
229 drm_printf_indent(p, indent, "count: %u\n", dbm->count);
234 for_each_clear_bitrange(rs, re, dbm->bitmap, dbm->count) {
242 for_each_set_bitrange(rs, re, dbm->bitmap, dbm->count) {