Lines Matching refs:parser

420 static void radeon_cs_parser_fini(struct radeon_cs_parser *parser, int error, bool backoff)  in radeon_cs_parser_fini()  argument
435 list_sort(NULL, &parser->validated, cmp_size_smaller_first); in radeon_cs_parser_fini()
437 ttm_eu_fence_buffer_objects(&parser->ticket, in radeon_cs_parser_fini()
438 &parser->validated, in radeon_cs_parser_fini()
439 &parser->ib.fence->base); in radeon_cs_parser_fini()
441 ttm_eu_backoff_reservation(&parser->ticket, in radeon_cs_parser_fini()
442 &parser->validated); in radeon_cs_parser_fini()
445 if (parser->relocs != NULL) { in radeon_cs_parser_fini()
446 for (i = 0; i < parser->nrelocs; i++) { in radeon_cs_parser_fini()
447 struct radeon_bo *bo = parser->relocs[i].robj; in radeon_cs_parser_fini()
454 kfree(parser->track); in radeon_cs_parser_fini()
455 kvfree(parser->relocs); in radeon_cs_parser_fini()
456 kvfree(parser->vm_bos); in radeon_cs_parser_fini()
457 for (i = 0; i < parser->nchunks; i++) in radeon_cs_parser_fini()
458 kvfree(parser->chunks[i].kdata); in radeon_cs_parser_fini()
459 kvfree(parser->chunks); in radeon_cs_parser_fini()
460 kvfree(parser->chunks_array); in radeon_cs_parser_fini()
461 radeon_ib_free(parser->rdev, &parser->ib); in radeon_cs_parser_fini()
462 radeon_ib_free(parser->rdev, &parser->const_ib); in radeon_cs_parser_fini()
466 struct radeon_cs_parser *parser) in radeon_cs_ib_chunk() argument
470 if (parser->chunk_ib == NULL) in radeon_cs_ib_chunk()
473 if (parser->cs_flags & RADEON_CS_USE_VM) in radeon_cs_ib_chunk()
476 r = radeon_cs_parse(rdev, parser->ring, parser); in radeon_cs_ib_chunk()
477 if (r || parser->parser_error) { in radeon_cs_ib_chunk()
482 r = radeon_cs_sync_rings(parser); in radeon_cs_ib_chunk()
489 if (parser->ring == R600_RING_TYPE_UVD_INDEX) in radeon_cs_ib_chunk()
491 else if ((parser->ring == TN_RING_TYPE_VCE1_INDEX) || in radeon_cs_ib_chunk()
492 (parser->ring == TN_RING_TYPE_VCE2_INDEX)) in radeon_cs_ib_chunk()
495 r = radeon_ib_schedule(rdev, &parser->ib, NULL, true); in radeon_cs_ib_chunk()
552 struct radeon_cs_parser *parser) in radeon_cs_ib_vm_chunk() argument
554 struct radeon_fpriv *fpriv = parser->filp->driver_priv; in radeon_cs_ib_vm_chunk()
558 if (parser->chunk_ib == NULL) in radeon_cs_ib_vm_chunk()
560 if ((parser->cs_flags & RADEON_CS_USE_VM) == 0) in radeon_cs_ib_vm_chunk()
563 if (parser->const_ib.length_dw) { in radeon_cs_ib_vm_chunk()
564 r = radeon_ring_ib_parse(rdev, parser->ring, &parser->const_ib); in radeon_cs_ib_vm_chunk()
570 r = radeon_ring_ib_parse(rdev, parser->ring, &parser->ib); in radeon_cs_ib_vm_chunk()
575 if (parser->ring == R600_RING_TYPE_UVD_INDEX) in radeon_cs_ib_vm_chunk()
579 r = radeon_bo_vm_update_pte(parser, vm); in radeon_cs_ib_vm_chunk()
584 r = radeon_cs_sync_rings(parser); in radeon_cs_ib_vm_chunk()
592 (parser->chunk_const_ib != NULL)) { in radeon_cs_ib_vm_chunk()
593 r = radeon_ib_schedule(rdev, &parser->ib, &parser->const_ib, true); in radeon_cs_ib_vm_chunk()
595 r = radeon_ib_schedule(rdev, &parser->ib, NULL, true); in radeon_cs_ib_vm_chunk()
613 static int radeon_cs_ib_fill(struct radeon_device *rdev, struct radeon_cs_parser *parser) in radeon_cs_ib_fill() argument
619 if (parser->chunk_ib == NULL) in radeon_cs_ib_fill()
622 if (parser->cs_flags & RADEON_CS_USE_VM) { in radeon_cs_ib_fill()
623 struct radeon_fpriv *fpriv = parser->filp->driver_priv; in radeon_cs_ib_fill()
627 (parser->chunk_const_ib != NULL)) { in radeon_cs_ib_fill()
628 ib_chunk = parser->chunk_const_ib; in radeon_cs_ib_fill()
633 r = radeon_ib_get(rdev, parser->ring, &parser->const_ib, in radeon_cs_ib_fill()
639 parser->const_ib.is_const_ib = true; in radeon_cs_ib_fill()
640 parser->const_ib.length_dw = ib_chunk->length_dw; in radeon_cs_ib_fill()
641 if (copy_from_user(parser->const_ib.ptr, in radeon_cs_ib_fill()
647 ib_chunk = parser->chunk_ib; in radeon_cs_ib_fill()
653 ib_chunk = parser->chunk_ib; in radeon_cs_ib_fill()
655 r = radeon_ib_get(rdev, parser->ring, &parser->ib, in radeon_cs_ib_fill()
661 parser->ib.length_dw = ib_chunk->length_dw; in radeon_cs_ib_fill()
663 memcpy(parser->ib.ptr, ib_chunk->kdata, ib_chunk->length_dw * 4); in radeon_cs_ib_fill()
664 else if (copy_from_user(parser->ib.ptr, ib_chunk->user_ptr, ib_chunk->length_dw * 4)) in radeon_cs_ib_fill()
672 struct radeon_cs_parser parser; in radeon_cs_ioctl() local
688 memset(&parser, 0, sizeof(struct radeon_cs_parser)); in radeon_cs_ioctl()
689 parser.filp = filp; in radeon_cs_ioctl()
690 parser.rdev = rdev; in radeon_cs_ioctl()
691 parser.dev = rdev->dev; in radeon_cs_ioctl()
692 parser.family = rdev->family; in radeon_cs_ioctl()
693 r = radeon_cs_parser_init(&parser, data); in radeon_cs_ioctl()
696 radeon_cs_parser_fini(&parser, r, false); in radeon_cs_ioctl()
702 r = radeon_cs_ib_fill(rdev, &parser); in radeon_cs_ioctl()
704 r = radeon_cs_parser_relocs(&parser); in radeon_cs_ioctl()
710 radeon_cs_parser_fini(&parser, r, false); in radeon_cs_ioctl()
716 trace_radeon_cs(&parser); in radeon_cs_ioctl()
718 r = radeon_cs_ib_chunk(rdev, &parser); in radeon_cs_ioctl()
722 r = radeon_cs_ib_vm_chunk(rdev, &parser); in radeon_cs_ioctl()
727 radeon_cs_parser_fini(&parser, r, true); in radeon_cs_ioctl()