Lines Matching refs:list
69 /* Extract the fence and usage flags from an RCU protected entry in the list. */
70 static void dma_resv_list_entry(struct dma_resv_list *list, unsigned int index,
76 tmp = (long)rcu_dereference_check(list->table[index],
83 /* Set the fence and usage flags at the specific index in the list. */
84 static void dma_resv_list_set(struct dma_resv_list *list,
91 RCU_INIT_POINTER(list->table[index], (struct dma_fence *)tmp);
100 struct dma_resv_list *list;
104 size = kmalloc_size_roundup(struct_size(list, table, max_fences));
106 list = kmalloc(size, GFP_KERNEL);
107 if (!list)
111 list->max_fences = (size - offsetof(typeof(*list), table)) /
112 sizeof(*list->table);
114 return list;
118 static void dma_resv_list_free(struct dma_resv_list *list)
122 if (!list)
125 for (i = 0; i < list->num_fences; ++i) {
128 dma_resv_list_entry(list, i, NULL, &fence, NULL);
131 kfree_rcu(list, rcu);
339 struct dma_resv_list *list;
344 list = dma_resv_fences_list(obj);
345 for (i = 0; list && i < list->num_fences; ++i) {
348 dma_resv_list_entry(list, i, obj, &old, NULL);
352 dma_resv_list_set(list, i, dma_fence_get(replacement), usage);
516 struct dma_resv_list *list;
521 list = NULL;
527 dma_resv_list_free(list);
529 list = dma_resv_list_alloc(cursor.num_fences);
530 if (!list) {
534 list->num_fences = 0;
538 dma_resv_list_set(list, list->num_fences++, f,
543 list = rcu_replace_pointer(dst->fences, list, dma_resv_held(dst));
544 dma_resv_list_free(list);