Lines Matching full:jpeg
52 adev->jpeg.num_jpeg_inst = 1; in jpeg_v2_0_early_init()
53 adev->jpeg.num_jpeg_rings = 1; in jpeg_v2_0_early_init()
62 * jpeg_v2_0_sw_init - sw init for JPEG block
74 /* JPEG TRAP */ in jpeg_v2_0_sw_init()
76 VCN_2_0__SRCID__JPEG_DECODE, &adev->jpeg.inst->irq); in jpeg_v2_0_sw_init()
88 ring = adev->jpeg.inst->ring_dec; in jpeg_v2_0_sw_init()
93 r = amdgpu_ring_init(adev, ring, 512, &adev->jpeg.inst->irq, in jpeg_v2_0_sw_init()
98 adev->jpeg.internal.jpeg_pitch[0] = mmUVD_JPEG_PITCH_INTERNAL_OFFSET; in jpeg_v2_0_sw_init()
99 adev->jpeg.inst->external.jpeg_pitch[0] = SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_PITCH); in jpeg_v2_0_sw_init()
105 * jpeg_v2_0_sw_fini - sw fini for JPEG block
109 * JPEG suspend and free up sw allocation
126 * jpeg_v2_0_hw_init - start and test JPEG block
134 struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec; in jpeg_v2_0_hw_init()
147 * Stop the JPEG block, mark ring as not ready any more
155 if (adev->jpeg.cur_state != AMD_PG_STATE_GATE && in jpeg_v2_0_hw_fini()
156 RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS)) in jpeg_v2_0_hw_fini()
163 * jpeg_v2_0_suspend - suspend JPEG block
167 * HW fini and suspend JPEG block
184 * jpeg_v2_0_resume - resume JPEG block
188 * Resume firmware and hw init JPEG block
211 WREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_PGFSM_CONFIG), data); in jpeg_v2_0_disable_power_gating()
213 r = SOC15_WAIT_ON_RREG(JPEG, 0, in jpeg_v2_0_disable_power_gating()
218 DRM_ERROR("amdgpu: JPEG disable power gating failed\n"); in jpeg_v2_0_disable_power_gating()
224 data = RREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_POWER_STATUS)) & ~0x1; in jpeg_v2_0_disable_power_gating()
225 WREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_POWER_STATUS), data); in jpeg_v2_0_disable_power_gating()
236 data = RREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_POWER_STATUS)); in jpeg_v2_0_enable_power_gating()
239 WREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_POWER_STATUS), data); in jpeg_v2_0_enable_power_gating()
242 WREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_PGFSM_CONFIG), data); in jpeg_v2_0_enable_power_gating()
244 r = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_PGFSM_STATUS, in jpeg_v2_0_enable_power_gating()
249 DRM_ERROR("amdgpu: JPEG enable power gating failed\n"); in jpeg_v2_0_enable_power_gating()
261 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL); in jpeg_v2_0_disable_clock_gating()
269 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL, data); in jpeg_v2_0_disable_clock_gating()
271 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE); in jpeg_v2_0_disable_clock_gating()
277 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE, data); in jpeg_v2_0_disable_clock_gating()
284 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL); in jpeg_v2_0_enable_clock_gating()
292 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL, data); in jpeg_v2_0_enable_clock_gating()
294 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE); in jpeg_v2_0_enable_clock_gating()
300 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE, data); in jpeg_v2_0_enable_clock_gating()
304 * jpeg_v2_0_start - start JPEG block
308 * Setup and start the JPEG block
312 struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec; in jpeg_v2_0_start()
323 /* JPEG disable CGC */ in jpeg_v2_0_start()
326 WREG32_SOC15(JPEG, 0, mmJPEG_DEC_GFX10_ADDR_CONFIG, adev->gfx.config.gb_addr_config); in jpeg_v2_0_start()
329 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JMI_CNTL), 0, in jpeg_v2_0_start()
333 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmJPEG_SYS_INT_EN), in jpeg_v2_0_start()
337 WREG32_SOC15(JPEG, 0, mmUVD_LMI_JRBC_RB_VMID, 0); in jpeg_v2_0_start()
338 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_CNTL, (0x00000001L | 0x00000002L)); in jpeg_v2_0_start()
339 WREG32_SOC15(JPEG, 0, mmUVD_LMI_JRBC_RB_64BIT_BAR_LOW, in jpeg_v2_0_start()
341 WREG32_SOC15(JPEG, 0, mmUVD_LMI_JRBC_RB_64BIT_BAR_HIGH, in jpeg_v2_0_start()
343 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_RPTR, 0); in jpeg_v2_0_start()
344 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR, 0); in jpeg_v2_0_start()
345 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_CNTL, 0x00000002L); in jpeg_v2_0_start()
346 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_SIZE, ring->ring_size / 4); in jpeg_v2_0_start()
347 ring->wptr = RREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR); in jpeg_v2_0_start()
353 * jpeg_v2_0_stop - stop JPEG block
357 * stop the JPEG block
364 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JMI_CNTL), in jpeg_v2_0_stop()
368 /* enable JPEG CGC */ in jpeg_v2_0_stop()
393 return RREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_RPTR); in jpeg_v2_0_dec_ring_get_rptr()
410 return RREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR); in jpeg_v2_0_dec_ring_get_wptr()
428 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR, lower_32_bits(ring->wptr)); in jpeg_v2_0_dec_ring_set_wptr()
664 return ((RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS) & in jpeg_v2_0_is_idle()
674 ret = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS, UVD_JRBC_STATUS__RB_JOB_DONE_MASK, in jpeg_v2_0_wait_for_idle()
703 if (state == adev->jpeg.cur_state) in jpeg_v2_0_set_powergating_state()
712 adev->jpeg.cur_state = state; in jpeg_v2_0_set_powergating_state()
729 DRM_DEBUG("IH: JPEG TRAP\n"); in jpeg_v2_0_process_interrupt()
733 amdgpu_fence_process(adev->jpeg.inst->ring_dec); in jpeg_v2_0_process_interrupt()
798 adev->jpeg.inst->ring_dec->funcs = &jpeg_v2_0_dec_ring_vm_funcs; in jpeg_v2_0_set_dec_ring_funcs()
808 adev->jpeg.inst->irq.num_types = 1; in jpeg_v2_0_set_irq_funcs()
809 adev->jpeg.inst->irq.funcs = &jpeg_v2_0_irq_funcs; in jpeg_v2_0_set_irq_funcs()