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