56 for (i = 0; i < p->
nrelocs; i++) {
61 for (j = 0; j <
i; j++) {
73 DRM_ERROR(
"gem object lookup failed 0x%x\n",
100 DRM_ERROR(
"unknown ring id: %d\n", ring);
126 other = p->
ib.sync_to[fence->
ring];
127 p->
ib.sync_to[fence->
ring] = radeon_fence_later(fence, other);
134 for (i = 0; i < p->
nrelocs; i++) {
138 radeon_cs_sync_to(p, p->
relocs[i].robj->tbo.sync_obj);
180 for (i = 0; i < p->
nchunks; i++) {
200 if (p->
chunks[i].length_dw == 0)
206 if (p->
chunks[i].length_dw == 0)
212 if (p->
chunks[i].length_dw == 0)
228 p->
chunks[i].user_ptr, size)) {
233 if (p->
chunks[i].length_dw > 1)
235 if (p->
chunks[i].length_dw > 2)
244 !p->
rdev->vm_manager.enabled) {
245 DRM_ERROR(
"VM not active on asic!\n");
252 DRM_ERROR(
"VM required on SI+!\n");
256 if (radeon_cs_get_ring(p, ring, priority))
265 DRM_ERROR(
"cs IB too big: %d\n",
309 for (i = 0; i < parser->
nrelocs; i++) {
310 if (parser->
relocs[i].gobj)
311 drm_gem_object_unreference_unlocked(parser->
relocs[i].gobj);
317 for (i = 0; i < parser->
nchunks; i++) {
350 DRM_ERROR(
"Failed to get ib !\n");
356 DRM_ERROR(
"Invalid command stream !\n");
361 DRM_ERROR(
"Invalid command stream !\n");
364 radeon_cs_sync_rings(parser);
367 DRM_ERROR(
"Failed to schedule IB !\n");
411 DRM_ERROR(
"cs IB CONST too big: %d\n", ib_chunk->
length_dw);
417 DRM_ERROR(
"Failed to get const ib !\n");
420 parser->
const_ib.is_const_ib =
true;
435 DRM_ERROR(
"cs IB too big: %d\n", ib_chunk->
length_dw);
441 DRM_ERROR(
"Failed to get ib !\n");
461 r = radeon_bo_vm_update_pte(parser, vm);
465 radeon_cs_sync_rings(parser);
466 radeon_cs_sync_to(parser, vm->
fence);
487 static int radeon_cs_handle_lockup(
struct radeon_device *rdev,
int r)
516 DRM_ERROR(
"Failed to initialize parser !\n");
517 radeon_cs_parser_fini(&parser, r);
519 r = radeon_cs_handle_lockup(rdev, r);
522 r = radeon_cs_parser_relocs(&parser);
525 DRM_ERROR(
"Failed to parse relocation %d!\n", r);
526 radeon_cs_parser_fini(&parser, r);
528 r = radeon_cs_handle_lockup(rdev, r);
531 r = radeon_cs_ib_chunk(rdev, &parser);
535 r = radeon_cs_ib_vm_chunk(rdev, &parser);
540 radeon_cs_parser_fini(&parser, r);
542 r = radeon_cs_handle_lockup(rdev, r);
603 memcpy((
void *)(p->
ib.ptr+(pg_idx*(PAGE_SIZE/4))), ibc->
kpage[new_page], size);
614 u32 pg_idx, pg_offset;
618 pg_idx = (idx * 4) / PAGE_SIZE;
619 pg_offset = (idx * 4) % PAGE_SIZE;
622 return ibc->
kpage[0][pg_offset/4];
624 return ibc->
kpage[1][pg_offset/4];
626 new_page = radeon_cs_update_pages(p, pg_idx);
632 idx_value = ibc->
kpage[new_page][pg_offset/4];