Lines Matching refs:ring
69 struct amdgpu_ring *ring; in jpeg_v2_0_sw_init() local
86 ring = &adev->jpeg.inst->ring_dec; in jpeg_v2_0_sw_init()
87 ring->use_doorbell = true; in jpeg_v2_0_sw_init()
88 ring->doorbell_index = (adev->doorbell_index.vcn.vcn_ring0_1 << 1) + 1; in jpeg_v2_0_sw_init()
89 sprintf(ring->name, "jpeg_dec"); in jpeg_v2_0_sw_init()
90 r = amdgpu_ring_init(adev, ring, 512, &adev->jpeg.inst->irq, in jpeg_v2_0_sw_init()
131 struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec; in jpeg_v2_0_hw_init() local
134 adev->nbio.funcs->vcn_doorbell_range(adev, ring->use_doorbell, in jpeg_v2_0_hw_init()
137 r = amdgpu_ring_test_helper(ring); in jpeg_v2_0_hw_init()
314 struct amdgpu_ring *ring = &adev->jpeg.inst->ring_dec; in jpeg_v2_0_start() local
342 lower_32_bits(ring->gpu_addr)); in jpeg_v2_0_start()
344 upper_32_bits(ring->gpu_addr)); in jpeg_v2_0_start()
348 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_SIZE, ring->ring_size / 4); in jpeg_v2_0_start()
349 ring->wptr = RREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR); in jpeg_v2_0_start()
391 static uint64_t jpeg_v2_0_dec_ring_get_rptr(struct amdgpu_ring *ring) in jpeg_v2_0_dec_ring_get_rptr() argument
393 struct amdgpu_device *adev = ring->adev; in jpeg_v2_0_dec_ring_get_rptr()
405 static uint64_t jpeg_v2_0_dec_ring_get_wptr(struct amdgpu_ring *ring) in jpeg_v2_0_dec_ring_get_wptr() argument
407 struct amdgpu_device *adev = ring->adev; in jpeg_v2_0_dec_ring_get_wptr()
409 if (ring->use_doorbell) in jpeg_v2_0_dec_ring_get_wptr()
410 return adev->wb.wb[ring->wptr_offs]; in jpeg_v2_0_dec_ring_get_wptr()
422 static void jpeg_v2_0_dec_ring_set_wptr(struct amdgpu_ring *ring) in jpeg_v2_0_dec_ring_set_wptr() argument
424 struct amdgpu_device *adev = ring->adev; in jpeg_v2_0_dec_ring_set_wptr()
426 if (ring->use_doorbell) { in jpeg_v2_0_dec_ring_set_wptr()
427 adev->wb.wb[ring->wptr_offs] = lower_32_bits(ring->wptr); in jpeg_v2_0_dec_ring_set_wptr()
428 WDOORBELL32(ring->doorbell_index, lower_32_bits(ring->wptr)); in jpeg_v2_0_dec_ring_set_wptr()
430 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR, lower_32_bits(ring->wptr)); in jpeg_v2_0_dec_ring_set_wptr()
441 void jpeg_v2_0_dec_ring_insert_start(struct amdgpu_ring *ring) in jpeg_v2_0_dec_ring_insert_start() argument
443 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_insert_start()
445 amdgpu_ring_write(ring, 0x68e04); in jpeg_v2_0_dec_ring_insert_start()
447 amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, in jpeg_v2_0_dec_ring_insert_start()
449 amdgpu_ring_write(ring, 0x80010000); in jpeg_v2_0_dec_ring_insert_start()
459 void jpeg_v2_0_dec_ring_insert_end(struct amdgpu_ring *ring) in jpeg_v2_0_dec_ring_insert_end() argument
461 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_insert_end()
463 amdgpu_ring_write(ring, 0x68e04); in jpeg_v2_0_dec_ring_insert_end()
465 amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, in jpeg_v2_0_dec_ring_insert_end()
467 amdgpu_ring_write(ring, 0x00010000); in jpeg_v2_0_dec_ring_insert_end()
480 void jpeg_v2_0_dec_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, u64 seq, in jpeg_v2_0_dec_ring_emit_fence() argument
485 amdgpu_ring_write(ring, PACKETJ(mmUVD_JPEG_GPCOM_DATA0_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_fence()
487 amdgpu_ring_write(ring, seq); in jpeg_v2_0_dec_ring_emit_fence()
489 amdgpu_ring_write(ring, PACKETJ(mmUVD_JPEG_GPCOM_DATA1_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_fence()
491 amdgpu_ring_write(ring, seq); in jpeg_v2_0_dec_ring_emit_fence()
493 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_RB_MEM_WR_64BIT_BAR_LOW_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_fence()
495 amdgpu_ring_write(ring, lower_32_bits(addr)); in jpeg_v2_0_dec_ring_emit_fence()
497 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_RB_MEM_WR_64BIT_BAR_HIGH_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_fence()
499 amdgpu_ring_write(ring, upper_32_bits(addr)); in jpeg_v2_0_dec_ring_emit_fence()
501 amdgpu_ring_write(ring, PACKETJ(mmUVD_JPEG_GPCOM_CMD_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_fence()
503 amdgpu_ring_write(ring, 0x8); in jpeg_v2_0_dec_ring_emit_fence()
505 amdgpu_ring_write(ring, PACKETJ(mmUVD_JPEG_GPCOM_CMD_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_fence()
507 amdgpu_ring_write(ring, 0); in jpeg_v2_0_dec_ring_emit_fence()
509 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_fence()
511 amdgpu_ring_write(ring, 0x3fbc); in jpeg_v2_0_dec_ring_emit_fence()
513 amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, in jpeg_v2_0_dec_ring_emit_fence()
515 amdgpu_ring_write(ring, 0x1); in jpeg_v2_0_dec_ring_emit_fence()
517 amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE7)); in jpeg_v2_0_dec_ring_emit_fence()
518 amdgpu_ring_write(ring, 0); in jpeg_v2_0_dec_ring_emit_fence()
531 void jpeg_v2_0_dec_ring_emit_ib(struct amdgpu_ring *ring, in jpeg_v2_0_dec_ring_emit_ib() argument
538 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_IB_VMID_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
540 amdgpu_ring_write(ring, (vmid | (vmid << 4))); in jpeg_v2_0_dec_ring_emit_ib()
542 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JPEG_VMID_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
544 amdgpu_ring_write(ring, (vmid | (vmid << 4))); in jpeg_v2_0_dec_ring_emit_ib()
546 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_IB_64BIT_BAR_LOW_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
548 amdgpu_ring_write(ring, lower_32_bits(ib->gpu_addr)); in jpeg_v2_0_dec_ring_emit_ib()
550 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_IB_64BIT_BAR_HIGH_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
552 amdgpu_ring_write(ring, upper_32_bits(ib->gpu_addr)); in jpeg_v2_0_dec_ring_emit_ib()
554 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_IB_SIZE_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
556 amdgpu_ring_write(ring, ib->length_dw); in jpeg_v2_0_dec_ring_emit_ib()
558 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_RB_MEM_RD_64BIT_BAR_LOW_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
560 amdgpu_ring_write(ring, lower_32_bits(ring->gpu_addr)); in jpeg_v2_0_dec_ring_emit_ib()
562 amdgpu_ring_write(ring, PACKETJ(mmUVD_LMI_JRBC_RB_MEM_RD_64BIT_BAR_HIGH_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
564 amdgpu_ring_write(ring, upper_32_bits(ring->gpu_addr)); in jpeg_v2_0_dec_ring_emit_ib()
566 amdgpu_ring_write(ring, PACKETJ(0, 0, PACKETJ_CONDITION_CHECK0, PACKETJ_TYPE2)); in jpeg_v2_0_dec_ring_emit_ib()
567 amdgpu_ring_write(ring, 0); in jpeg_v2_0_dec_ring_emit_ib()
569 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_RB_COND_RD_TIMER_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
571 amdgpu_ring_write(ring, 0x01400200); in jpeg_v2_0_dec_ring_emit_ib()
573 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_RB_REF_DATA_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
575 amdgpu_ring_write(ring, 0x2); in jpeg_v2_0_dec_ring_emit_ib()
577 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_STATUS_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_ib()
579 amdgpu_ring_write(ring, 0x2); in jpeg_v2_0_dec_ring_emit_ib()
582 void jpeg_v2_0_dec_ring_emit_reg_wait(struct amdgpu_ring *ring, uint32_t reg, in jpeg_v2_0_dec_ring_emit_reg_wait() argument
587 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_RB_COND_RD_TIMER_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_reg_wait()
589 amdgpu_ring_write(ring, 0x01400200); in jpeg_v2_0_dec_ring_emit_reg_wait()
591 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_RB_REF_DATA_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_reg_wait()
593 amdgpu_ring_write(ring, val); in jpeg_v2_0_dec_ring_emit_reg_wait()
595 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_reg_wait()
598 amdgpu_ring_write(ring, 0); in jpeg_v2_0_dec_ring_emit_reg_wait()
599 amdgpu_ring_write(ring, in jpeg_v2_0_dec_ring_emit_reg_wait()
602 amdgpu_ring_write(ring, reg_offset); in jpeg_v2_0_dec_ring_emit_reg_wait()
603 amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, in jpeg_v2_0_dec_ring_emit_reg_wait()
606 amdgpu_ring_write(ring, mask); in jpeg_v2_0_dec_ring_emit_reg_wait()
609 void jpeg_v2_0_dec_ring_emit_vm_flush(struct amdgpu_ring *ring, in jpeg_v2_0_dec_ring_emit_vm_flush() argument
612 struct amdgpu_vmhub *hub = &ring->adev->vmhub[ring->funcs->vmhub]; in jpeg_v2_0_dec_ring_emit_vm_flush()
615 pd_addr = amdgpu_gmc_emit_flush_gpu_tlb(ring, vmid, pd_addr); in jpeg_v2_0_dec_ring_emit_vm_flush()
621 jpeg_v2_0_dec_ring_emit_reg_wait(ring, data0, data1, mask); in jpeg_v2_0_dec_ring_emit_vm_flush()
624 void jpeg_v2_0_dec_ring_emit_wreg(struct amdgpu_ring *ring, uint32_t reg, uint32_t val) in jpeg_v2_0_dec_ring_emit_wreg() argument
628 amdgpu_ring_write(ring, PACKETJ(mmUVD_JRBC_EXTERNAL_REG_INTERNAL_OFFSET, in jpeg_v2_0_dec_ring_emit_wreg()
631 amdgpu_ring_write(ring, 0); in jpeg_v2_0_dec_ring_emit_wreg()
632 amdgpu_ring_write(ring, in jpeg_v2_0_dec_ring_emit_wreg()
635 amdgpu_ring_write(ring, reg_offset); in jpeg_v2_0_dec_ring_emit_wreg()
636 amdgpu_ring_write(ring, PACKETJ(JRBC_DEC_EXTERNAL_REG_WRITE_ADDR, in jpeg_v2_0_dec_ring_emit_wreg()
639 amdgpu_ring_write(ring, val); in jpeg_v2_0_dec_ring_emit_wreg()
642 void jpeg_v2_0_dec_ring_nop(struct amdgpu_ring *ring, uint32_t count) in jpeg_v2_0_dec_ring_nop() argument
646 WARN_ON(ring->wptr % 2 || count % 2); in jpeg_v2_0_dec_ring_nop()
649 amdgpu_ring_write(ring, PACKETJ(0, 0, 0, PACKETJ_TYPE6)); in jpeg_v2_0_dec_ring_nop()
650 amdgpu_ring_write(ring, 0); in jpeg_v2_0_dec_ring_nop()