Lines Matching defs:bc
91 static void batch_init(struct batch_chunk *bc,
95 bc->vma = vma;
96 bc->offset = offset;
97 bc->start = start + bc->offset / sizeof(*bc->start);
98 bc->end = bc->start;
99 bc->max_items = max_bytes / sizeof(*bc->start);
102 static u32 batch_offset(const struct batch_chunk *bc, u32 *cs)
104 return (cs - bc->start) * sizeof(*bc->start) + bc->offset;
107 static u32 batch_addr(const struct batch_chunk *bc)
109 return i915_vma_offset(bc->vma);
112 static void batch_add(struct batch_chunk *bc, const u32 d)
114 GEM_BUG_ON((bc->end - bc->start) >= bc->max_items);
115 *bc->end++ = d;
118 static u32 *batch_alloc_items(struct batch_chunk *bc, u32 align, u32 items)
123 u32 *end = PTR_ALIGN(bc->end, align);
125 memset32(bc->end, 0, end - bc->end);
126 bc->end = end;
129 map = bc->end;
130 bc->end += items;
135 static u32 *batch_alloc_bytes(struct batch_chunk *bc, u32 align, u32 bytes)
137 GEM_BUG_ON(!IS_ALIGNED(bytes, sizeof(*bc->start)));
138 return batch_alloc_items(bc, align, bytes / sizeof(*bc->start));