• Home
  • Raw
  • Download

Lines Matching refs:csg

128     struct cs_gem *csg;  in cs_gem_create()  local
134 csg = (struct cs_gem*)calloc(1, sizeof(struct cs_gem)); in cs_gem_create()
135 if (csg == NULL) { in cs_gem_create()
138 csg->base.csm = csm; in cs_gem_create()
139 csg->base.ndw = 64 * 1024 / 4; in cs_gem_create()
140 csg->base.packets = (uint32_t*)calloc(1, 64 * 1024); in cs_gem_create()
141 if (csg->base.packets == NULL) { in cs_gem_create()
142 free(csg); in cs_gem_create()
145 csg->base.relocs_total_size = 0; in cs_gem_create()
146 csg->base.crelocs = 0; in cs_gem_create()
147 csg->base.id = generate_id(); in cs_gem_create()
148 csg->nrelocs = 4096 / (4 * 4) ; in cs_gem_create()
149 csg->relocs_bo = (struct radeon_bo_int**)calloc(1, in cs_gem_create()
150 csg->nrelocs*sizeof(void*)); in cs_gem_create()
151 if (csg->relocs_bo == NULL) { in cs_gem_create()
152 free(csg->base.packets); in cs_gem_create()
153 free(csg); in cs_gem_create()
156 csg->base.relocs = csg->relocs = (uint32_t*)calloc(1, 4096); in cs_gem_create()
157 if (csg->relocs == NULL) { in cs_gem_create()
158 free(csg->relocs_bo); in cs_gem_create()
159 free(csg->base.packets); in cs_gem_create()
160 free(csg); in cs_gem_create()
163 csg->chunks[0].chunk_id = RADEON_CHUNK_ID_IB; in cs_gem_create()
164 csg->chunks[0].length_dw = 0; in cs_gem_create()
165 csg->chunks[0].chunk_data = (uint64_t)(uintptr_t)csg->base.packets; in cs_gem_create()
166 csg->chunks[1].chunk_id = RADEON_CHUNK_ID_RELOCS; in cs_gem_create()
167 csg->chunks[1].length_dw = 0; in cs_gem_create()
168 csg->chunks[1].chunk_data = (uint64_t)(uintptr_t)csg->relocs; in cs_gem_create()
169 return (struct radeon_cs_int*)csg; in cs_gem_create()
179 struct cs_gem *csg = (struct cs_gem*)cs; in cs_gem_write_reloc() local
208 reloc = (struct cs_reloc_gem*)&csg->relocs[idx]; in cs_gem_write_reloc()
241 if (csg->base.crelocs >= csg->nrelocs) { in cs_gem_write_reloc()
244 size = ((csg->nrelocs + 1) * sizeof(struct radeon_bo*)); in cs_gem_write_reloc()
245 tmp = (uint32_t*)realloc(csg->relocs_bo, size); in cs_gem_write_reloc()
249 csg->relocs_bo = (struct radeon_bo_int **)tmp; in cs_gem_write_reloc()
250 size = ((csg->nrelocs + 1) * RELOC_SIZE * 4); in cs_gem_write_reloc()
251 tmp = (uint32_t*)realloc(csg->relocs, size); in cs_gem_write_reloc()
255 cs->relocs = csg->relocs = tmp; in cs_gem_write_reloc()
256 csg->nrelocs += 1; in cs_gem_write_reloc()
257 csg->chunks[1].chunk_data = (uint64_t)(uintptr_t)csg->relocs; in cs_gem_write_reloc()
259 csg->relocs_bo[csg->base.crelocs] = boi; in cs_gem_write_reloc()
260 idx = (csg->base.crelocs++) * RELOC_SIZE; in cs_gem_write_reloc()
261 reloc = (struct cs_reloc_gem*)&csg->relocs[idx]; in cs_gem_write_reloc()
266 csg->chunks[1].length_dw += RELOC_SIZE; in cs_gem_write_reloc()
339 struct cs_gem *csg = (struct cs_gem*)cs; in cs_gem_dump_bof() local
358 blob = bof_blob(csg->nrelocs * 16, csg->relocs); in cs_gem_dump_bof()
377 for (i = 0; i < csg->base.crelocs; i++) { in cs_gem_dump_bof()
381 size = bof_int32(csg->relocs_bo[i]->size); in cs_gem_dump_bof()
388 handle = bof_int32(csg->relocs_bo[i]->handle); in cs_gem_dump_bof()
395 radeon_bo_map((struct radeon_bo*)csg->relocs_bo[i], 0); in cs_gem_dump_bof()
396 blob = bof_blob(csg->relocs_bo[i]->size, csg->relocs_bo[i]->ptr); in cs_gem_dump_bof()
397 radeon_bo_unmap((struct radeon_bo*)csg->relocs_bo[i]); in cs_gem_dump_bof()
426 struct cs_gem *csg = (struct cs_gem*)cs; in cs_gem_emit() local
437 csg->chunks[0].length_dw = cs->cdw; in cs_gem_emit()
439 chunk_array[0] = (uint64_t)(uintptr_t)&csg->chunks[0]; in cs_gem_emit()
440 chunk_array[1] = (uint64_t)(uintptr_t)&csg->chunks[1]; in cs_gem_emit()
442 csg->cs.num_chunks = 2; in cs_gem_emit()
443 csg->cs.chunks = (uint64_t)(uintptr_t)chunk_array; in cs_gem_emit()
446 &csg->cs, sizeof(struct drm_radeon_cs)); in cs_gem_emit()
447 for (i = 0; i < csg->base.crelocs; i++) { in cs_gem_emit()
448 csg->relocs_bo[i]->space_accounted = 0; in cs_gem_emit()
450 … atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id); in cs_gem_emit()
451 radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]); in cs_gem_emit()
452 csg->relocs_bo[i] = NULL; in cs_gem_emit()
463 struct cs_gem *csg = (struct cs_gem*)cs; in cs_gem_destroy() local
466 free(csg->relocs_bo); in cs_gem_destroy()
475 struct cs_gem *csg = (struct cs_gem*)cs; in cs_gem_erase() local
478 if (csg->relocs_bo) { in cs_gem_erase()
479 for (i = 0; i < csg->base.crelocs; i++) { in cs_gem_erase()
480 if (csg->relocs_bo[i]) { in cs_gem_erase()
482 … atomic_dec((atomic_t *)radeon_gem_get_reloc_in_cs((struct radeon_bo*)csg->relocs_bo[i]), cs->id); in cs_gem_erase()
483 radeon_bo_unref((struct radeon_bo *)csg->relocs_bo[i]); in cs_gem_erase()
484 csg->relocs_bo[i] = NULL; in cs_gem_erase()
492 csg->chunks[0].length_dw = 0; in cs_gem_erase()
493 csg->chunks[1].length_dw = 0; in cs_gem_erase()