Lines Matching full:jpeg
60 harvest = RREG32_SOC15(JPEG, 0, mmCC_UVD_HARVESTING); in jpeg_v3_0_early_init()
66 adev->jpeg.num_jpeg_inst = 1; in jpeg_v3_0_early_init()
67 adev->jpeg.num_jpeg_rings = 1; in jpeg_v3_0_early_init()
76 * jpeg_v3_0_sw_init - sw init for JPEG block
88 /* JPEG TRAP */ in jpeg_v3_0_sw_init()
90 VCN_2_0__SRCID__JPEG_DECODE, &adev->jpeg.inst->irq); in jpeg_v3_0_sw_init()
102 ring = adev->jpeg.inst->ring_dec; in jpeg_v3_0_sw_init()
107 r = amdgpu_ring_init(adev, ring, 512, &adev->jpeg.inst->irq, 0, in jpeg_v3_0_sw_init()
112 adev->jpeg.internal.jpeg_pitch[0] = mmUVD_JPEG_PITCH_INTERNAL_OFFSET; in jpeg_v3_0_sw_init()
113 adev->jpeg.inst->external.jpeg_pitch[0] = SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_PITCH); in jpeg_v3_0_sw_init()
119 * jpeg_v3_0_sw_fini - sw fini for JPEG block
123 * JPEG suspend and free up sw allocation
140 * jpeg_v3_0_hw_init - start and test JPEG block
148 struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec; in jpeg_v3_0_hw_init()
161 * Stop the JPEG block, mark ring as not ready any more
169 if (adev->jpeg.cur_state != AMD_PG_STATE_GATE && in jpeg_v3_0_hw_fini()
170 RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS)) in jpeg_v3_0_hw_fini()
177 * jpeg_v3_0_suspend - suspend JPEG block
181 * HW fini and suspend JPEG block
198 * jpeg_v3_0_resume - resume JPEG block
202 * Resume firmware and hw init JPEG block
222 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL); in jpeg_v3_0_disable_clock_gating()
230 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL, data); in jpeg_v3_0_disable_clock_gating()
232 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE); in jpeg_v3_0_disable_clock_gating()
238 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE, data); in jpeg_v3_0_disable_clock_gating()
240 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL); in jpeg_v3_0_disable_clock_gating()
245 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_CTRL, data); in jpeg_v3_0_disable_clock_gating()
252 data = RREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE); in jpeg_v3_0_enable_clock_gating()
258 WREG32_SOC15(JPEG, 0, mmJPEG_CGC_GATE, data); in jpeg_v3_0_enable_clock_gating()
268 WREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_PGFSM_CONFIG), data); in jpeg_v3_0_disable_static_power_gating()
270 r = SOC15_WAIT_ON_RREG(JPEG, 0, in jpeg_v3_0_disable_static_power_gating()
275 DRM_ERROR("amdgpu: JPEG disable power gating failed\n"); in jpeg_v3_0_disable_static_power_gating()
281 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_POWER_STATUS), 0, in jpeg_v3_0_disable_static_power_gating()
284 /* keep the JPEG in static PG mode */ in jpeg_v3_0_disable_static_power_gating()
285 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_POWER_STATUS), 0, in jpeg_v3_0_disable_static_power_gating()
294 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JPEG_POWER_STATUS), in jpeg_v3_0_enable_static_power_gating()
303 WREG32(SOC15_REG_OFFSET(JPEG, 0, mmUVD_PGFSM_CONFIG), data); in jpeg_v3_0_enable_static_power_gating()
305 r = SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_PGFSM_STATUS, in jpeg_v3_0_enable_static_power_gating()
310 DRM_ERROR("amdgpu: JPEG enable power gating failed\n"); in jpeg_v3_0_enable_static_power_gating()
319 * jpeg_v3_0_start - start JPEG block
323 * Setup and start the JPEG block
327 struct amdgpu_ring *ring = adev->jpeg.inst->ring_dec; in jpeg_v3_0_start()
338 /* JPEG disable CGC */ in jpeg_v3_0_start()
342 WREG32_SOC15(JPEG, 0, mmJPEG_DEC_GFX10_ADDR_CONFIG, in jpeg_v3_0_start()
344 WREG32_SOC15(JPEG, 0, mmJPEG_ENC_GFX10_ADDR_CONFIG, in jpeg_v3_0_start()
348 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JMI_CNTL), 0, in jpeg_v3_0_start()
352 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmJPEG_SYS_INT_EN), in jpeg_v3_0_start()
356 WREG32_SOC15(JPEG, 0, mmUVD_LMI_JRBC_RB_VMID, 0); in jpeg_v3_0_start()
357 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_CNTL, (0x00000001L | 0x00000002L)); in jpeg_v3_0_start()
358 WREG32_SOC15(JPEG, 0, mmUVD_LMI_JRBC_RB_64BIT_BAR_LOW, in jpeg_v3_0_start()
360 WREG32_SOC15(JPEG, 0, mmUVD_LMI_JRBC_RB_64BIT_BAR_HIGH, in jpeg_v3_0_start()
362 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_RPTR, 0); in jpeg_v3_0_start()
363 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR, 0); in jpeg_v3_0_start()
364 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_CNTL, 0x00000002L); in jpeg_v3_0_start()
365 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_SIZE, ring->ring_size / 4); in jpeg_v3_0_start()
366 ring->wptr = RREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR); in jpeg_v3_0_start()
372 * jpeg_v3_0_stop - stop JPEG block
376 * stop the JPEG block
383 WREG32_P(SOC15_REG_OFFSET(JPEG, 0, mmUVD_JMI_CNTL), in jpeg_v3_0_stop()
411 return RREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_RPTR); in jpeg_v3_0_dec_ring_get_rptr()
428 return RREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR); in jpeg_v3_0_dec_ring_get_wptr()
446 WREG32_SOC15(JPEG, 0, mmUVD_JRBC_RB_WPTR, lower_32_bits(ring->wptr)); in jpeg_v3_0_dec_ring_set_wptr()
455 ret &= (((RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS) & in jpeg_v3_0_is_idle()
466 return SOC15_WAIT_ON_RREG(JPEG, 0, mmUVD_JRBC_STATUS, in jpeg_v3_0_wait_for_idle()
494 if(state == adev->jpeg.cur_state) in jpeg_v3_0_set_powergating_state()
503 adev->jpeg.cur_state = state; in jpeg_v3_0_set_powergating_state()
520 DRM_DEBUG("IH: JPEG TRAP\n"); in jpeg_v3_0_process_interrupt()
524 amdgpu_fence_process(adev->jpeg.inst->ring_dec); in jpeg_v3_0_process_interrupt()
589 adev->jpeg.inst->ring_dec->funcs = &jpeg_v3_0_dec_ring_vm_funcs; in jpeg_v3_0_set_dec_ring_funcs()
599 adev->jpeg.inst->irq.num_types = 1; in jpeg_v3_0_set_irq_funcs()
600 adev->jpeg.inst->irq.funcs = &jpeg_v3_0_irq_funcs; in jpeg_v3_0_set_irq_funcs()