Lines Matching full:jpeg
60 adev->jpeg.num_jpeg_inst = 1; in jpeg_v4_0_early_init()
61 adev->jpeg.num_jpeg_rings = 1; in jpeg_v4_0_early_init()
71 * jpeg_v4_0_sw_init - sw init for JPEG block
83 /* JPEG TRAP */ in jpeg_v4_0_sw_init()
85 VCN_4_0__SRCID__JPEG_DECODE, &adev->jpeg.inst->irq); in jpeg_v4_0_sw_init()
89 /* JPEG DJPEG POISON EVENT */ in jpeg_v4_0_sw_init()
91 VCN_4_0__SRCID_DJPEG0_POISON, &adev->jpeg.inst->ras_poison_irq); in jpeg_v4_0_sw_init()
95 /* JPEG EJPEG POISON EVENT */ in jpeg_v4_0_sw_init()
97 VCN_4_0__SRCID_EJPEG0_POISON, &adev->jpeg.inst->ras_poison_irq); in jpeg_v4_0_sw_init()
109 ring = adev->jpeg.inst->ring_dec; in jpeg_v4_0_sw_init()
115 r = amdgpu_ring_init(adev, ring, 512, &adev->jpeg.inst->irq, 0, in jpeg_v4_0_sw_init()
120 adev->jpeg.internal.jpeg_pitch[0] = regUVD_JPEG_PITCH_INTERNAL_OFFSET; in jpeg_v4_0_sw_init()
121 adev->jpeg.inst->external.jpeg_pitch[0] = SOC15_REG_OFFSET(JPEG, 0, regUVD_JPEG_PITCH); in jpeg_v4_0_sw_init()
131 * jpeg_v4_0_sw_fini - sw fini for JPEG block
135 * JPEG suspend and free up sw allocation
152 * jpeg_v4_0_hw_init - start and test JPEG block
160 struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec; in jpeg_v4_0_hw_init()
192 * Stop the JPEG block, mark ring as not ready any more
200 if (adev->jpeg.cur_state != AMD_PG_STATE_GATE && in jpeg_v4_0_hw_fini()
201 RREG32_SOC15(JPEG, 0, regUVD_JRBC_STATUS)) in jpeg_v4_0_hw_fini()
205 amdgpu_irq_put(adev, &adev->jpeg.inst->ras_poison_irq, 0); in jpeg_v4_0_hw_fini()
211 * jpeg_v4_0_suspend - suspend JPEG block
215 * HW fini and suspend JPEG block
232 * jpeg_v4_0_resume - resume JPEG block
236 * Resume firmware and hw init JPEG block
256 data = RREG32_SOC15(JPEG, 0, regJPEG_CGC_CTRL); in jpeg_v4_0_disable_clock_gating()
266 WREG32_SOC15(JPEG, 0, regJPEG_CGC_CTRL, data); in jpeg_v4_0_disable_clock_gating()
268 data = RREG32_SOC15(JPEG, 0, regJPEG_CGC_GATE); in jpeg_v4_0_disable_clock_gating()
273 WREG32_SOC15(JPEG, 0, regJPEG_CGC_GATE, data); in jpeg_v4_0_disable_clock_gating()
280 data = RREG32_SOC15(JPEG, 0, regJPEG_CGC_CTRL); in jpeg_v4_0_enable_clock_gating()
290 WREG32_SOC15(JPEG, 0, regJPEG_CGC_CTRL, data); in jpeg_v4_0_enable_clock_gating()
292 data = RREG32_SOC15(JPEG, 0, regJPEG_CGC_GATE); in jpeg_v4_0_enable_clock_gating()
297 WREG32_SOC15(JPEG, 0, regJPEG_CGC_GATE, data); in jpeg_v4_0_enable_clock_gating()
307 WREG32(SOC15_REG_OFFSET(JPEG, 0, regUVD_PGFSM_CONFIG), data); in jpeg_v4_0_disable_static_power_gating()
309 r = SOC15_WAIT_ON_RREG(JPEG, 0, in jpeg_v4_0_disable_static_power_gating()
314 DRM_DEV_ERROR(adev->dev, "amdgpu: JPEG disable power gating failed\n"); in jpeg_v4_0_disable_static_power_gating()
320 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, regUVD_JPEG_POWER_STATUS), 0, in jpeg_v4_0_disable_static_power_gating()
323 /* keep the JPEG in static PG mode */ in jpeg_v4_0_disable_static_power_gating()
324 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, regUVD_JPEG_POWER_STATUS), 0, in jpeg_v4_0_disable_static_power_gating()
333 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, regUVD_JPEG_POWER_STATUS), in jpeg_v4_0_enable_static_power_gating()
342 WREG32(SOC15_REG_OFFSET(JPEG, 0, regUVD_PGFSM_CONFIG), data); in jpeg_v4_0_enable_static_power_gating()
344 r = SOC15_WAIT_ON_RREG(JPEG, 0, regUVD_PGFSM_STATUS, in jpeg_v4_0_enable_static_power_gating()
349 DRM_DEV_ERROR(adev->dev, "amdgpu: JPEG enable power gating failed\n"); in jpeg_v4_0_enable_static_power_gating()
358 * jpeg_v4_0_start - start JPEG block
362 * Setup and start the JPEG block
366 struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec; in jpeg_v4_0_start()
377 /* JPEG disable CGC */ in jpeg_v4_0_start()
381 WREG32_SOC15(JPEG, 0, regJPEG_DEC_GFX10_ADDR_CONFIG, in jpeg_v4_0_start()
386 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, regUVD_JMI_CNTL), 0, in jpeg_v4_0_start()
390 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, regJPEG_SYS_INT_EN), in jpeg_v4_0_start()
394 WREG32_SOC15(JPEG, 0, regUVD_LMI_JRBC_RB_VMID, 0); in jpeg_v4_0_start()
395 WREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_CNTL, (0x00000001L | 0x00000002L)); in jpeg_v4_0_start()
396 WREG32_SOC15(JPEG, 0, regUVD_LMI_JRBC_RB_64BIT_BAR_LOW, in jpeg_v4_0_start()
398 WREG32_SOC15(JPEG, 0, regUVD_LMI_JRBC_RB_64BIT_BAR_HIGH, in jpeg_v4_0_start()
400 WREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_RPTR, 0); in jpeg_v4_0_start()
401 WREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_WPTR, 0); in jpeg_v4_0_start()
402 WREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_CNTL, 0x00000002L); in jpeg_v4_0_start()
403 WREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_SIZE, ring->ring_size / 4); in jpeg_v4_0_start()
404 ring->wptr = RREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_WPTR); in jpeg_v4_0_start()
448 ring = adev->jpeg.inst->ring_dec; in jpeg_v4_0_start_sriov()
450 MMSCH_V4_0_INSERT_DIRECT_WT(SOC15_REG_OFFSET(JPEG, 0, in jpeg_v4_0_start_sriov()
453 MMSCH_V4_0_INSERT_DIRECT_WT(SOC15_REG_OFFSET(JPEG, 0, in jpeg_v4_0_start_sriov()
456 MMSCH_V4_0_INSERT_DIRECT_WT(SOC15_REG_OFFSET(JPEG, 0, in jpeg_v4_0_start_sriov()
525 …DRM_ERROR("MMSCH init status is incorrect! readback=0x%08x, header init status for jpeg: %x\n", re… in jpeg_v4_0_start_sriov()
534 * jpeg_v4_0_stop - stop JPEG block
538 * stop the JPEG block
545 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, regUVD_JMI_CNTL), in jpeg_v4_0_stop()
573 return RREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_RPTR); in jpeg_v4_0_dec_ring_get_rptr()
590 return RREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_WPTR); in jpeg_v4_0_dec_ring_get_wptr()
608 WREG32_SOC15(JPEG, 0, regUVD_JRBC_RB_WPTR, lower_32_bits(ring->wptr)); in jpeg_v4_0_dec_ring_set_wptr()
617 ret &= (((RREG32_SOC15(JPEG, 0, regUVD_JRBC_STATUS) & in jpeg_v4_0_is_idle()
628 return SOC15_WAIT_ON_RREG(JPEG, 0, regUVD_JRBC_STATUS, in jpeg_v4_0_wait_for_idle()
657 adev->jpeg.cur_state = AMD_PG_STATE_UNGATE; in jpeg_v4_0_set_powergating_state()
661 if (state == adev->jpeg.cur_state) in jpeg_v4_0_set_powergating_state()
670 adev->jpeg.cur_state = state; in jpeg_v4_0_set_powergating_state()
687 DRM_DEBUG("IH: JPEG TRAP\n"); in jpeg_v4_0_process_interrupt()
691 amdgpu_fence_process(adev->jpeg.inst->ring_dec); in jpeg_v4_0_process_interrupt()
756 adev->jpeg.inst->ring_dec->funcs = &jpeg_v4_0_dec_ring_vm_funcs; in jpeg_v4_0_set_dec_ring_funcs()
770 adev->jpeg.inst->irq.num_types = 1; in jpeg_v4_0_set_irq_funcs()
771 adev->jpeg.inst->irq.funcs = &jpeg_v4_0_irq_funcs; in jpeg_v4_0_set_irq_funcs()
773 adev->jpeg.inst->ras_poison_irq.num_types = 1; in jpeg_v4_0_set_irq_funcs()
774 adev->jpeg.inst->ras_poison_irq.funcs = &jpeg_v4_0_ras_irq_funcs; in jpeg_v4_0_set_irq_funcs()
792 reg_value = RREG32_SOC15(JPEG, instance, regUVD_RAS_JPEG0_STATUS); in jpeg_v4_0_query_poison_by_instance()
796 reg_value = RREG32_SOC15(JPEG, instance, regUVD_RAS_JPEG1_STATUS); in jpeg_v4_0_query_poison_by_instance()
804 dev_info(adev->dev, "Poison detected in JPEG%d sub_block%d\n", in jpeg_v4_0_query_poison_by_instance()
814 for (inst = 0; inst < adev->jpeg.num_jpeg_inst; inst++) in jpeg_v4_0_query_ras_poison_status()
837 adev->jpeg.ras = &jpeg_v4_0_ras; in jpeg_v4_0_set_ras_funcs()