Lines Matching full:jpeg

41 	INIT_DELAYED_WORK(&adev->jpeg.idle_work, amdgpu_jpeg_idle_work_handler);  in amdgpu_jpeg_sw_init()
42 mutex_init(&adev->jpeg.jpeg_pg_lock); in amdgpu_jpeg_sw_init()
43 atomic_set(&adev->jpeg.total_submission_cnt, 0); in amdgpu_jpeg_sw_init()
47 adev->jpeg.indirect_sram = true; in amdgpu_jpeg_sw_init()
49 for (i = 0; i < adev->jpeg.num_jpeg_inst; i++) { in amdgpu_jpeg_sw_init()
50 if (adev->jpeg.harvest_config & (1 << i)) in amdgpu_jpeg_sw_init()
53 if (adev->jpeg.indirect_sram) { in amdgpu_jpeg_sw_init()
57 &adev->jpeg.inst[i].dpg_sram_bo, in amdgpu_jpeg_sw_init()
58 &adev->jpeg.inst[i].dpg_sram_gpu_addr, in amdgpu_jpeg_sw_init()
59 &adev->jpeg.inst[i].dpg_sram_cpu_addr); in amdgpu_jpeg_sw_init()
62 "JPEG %d (%d) failed to allocate DPG bo\n", i, r); in amdgpu_jpeg_sw_init()
75 for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) { in amdgpu_jpeg_sw_fini()
76 if (adev->jpeg.harvest_config & (1 << i)) in amdgpu_jpeg_sw_fini()
80 &adev->jpeg.inst[i].dpg_sram_bo, in amdgpu_jpeg_sw_fini()
81 &adev->jpeg.inst[i].dpg_sram_gpu_addr, in amdgpu_jpeg_sw_fini()
82 (void **)&adev->jpeg.inst[i].dpg_sram_cpu_addr); in amdgpu_jpeg_sw_fini()
84 for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j) in amdgpu_jpeg_sw_fini()
85 amdgpu_ring_fini(&adev->jpeg.inst[i].ring_dec[j]); in amdgpu_jpeg_sw_fini()
88 mutex_destroy(&adev->jpeg.jpeg_pg_lock); in amdgpu_jpeg_sw_fini()
95 cancel_delayed_work_sync(&adev->jpeg.idle_work); in amdgpu_jpeg_suspend()
108 container_of(work, struct amdgpu_device, jpeg.idle_work.work); in amdgpu_jpeg_idle_work_handler()
112 for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) { in amdgpu_jpeg_idle_work_handler()
113 if (adev->jpeg.harvest_config & (1 << i)) in amdgpu_jpeg_idle_work_handler()
116 for (j = 0; j < adev->jpeg.num_jpeg_rings; ++j) in amdgpu_jpeg_idle_work_handler()
117 fences += amdgpu_fence_count_emitted(&adev->jpeg.inst[i].ring_dec[j]); in amdgpu_jpeg_idle_work_handler()
120 if (!fences && !atomic_read(&adev->jpeg.total_submission_cnt)) in amdgpu_jpeg_idle_work_handler()
124 schedule_delayed_work(&adev->jpeg.idle_work, JPEG_IDLE_TIMEOUT); in amdgpu_jpeg_idle_work_handler()
131 atomic_inc(&adev->jpeg.total_submission_cnt); in amdgpu_jpeg_ring_begin_use()
132 cancel_delayed_work_sync(&adev->jpeg.idle_work); in amdgpu_jpeg_ring_begin_use()
134 mutex_lock(&adev->jpeg.jpeg_pg_lock); in amdgpu_jpeg_ring_begin_use()
137 mutex_unlock(&adev->jpeg.jpeg_pg_lock); in amdgpu_jpeg_ring_begin_use()
142 atomic_dec(&ring->adev->jpeg.total_submission_cnt); in amdgpu_jpeg_ring_end_use()
143 schedule_delayed_work(&ring->adev->jpeg.idle_work, JPEG_IDLE_TIMEOUT); in amdgpu_jpeg_ring_end_use()
153 /* JPEG in SRIOV does not support direct register read/write */ in amdgpu_jpeg_dec_ring_test_ring()
161 WREG32(adev->jpeg.inst[ring->me].external.jpeg_pitch[ring->pipe], 0xCAFEDEAD); in amdgpu_jpeg_dec_ring_test_ring()
163 RREG32(adev->jpeg.inst[ring->me].external.jpeg_pitch[ring->pipe]); in amdgpu_jpeg_dec_ring_test_ring()
165 amdgpu_ring_write(ring, PACKET0(adev->jpeg.internal.jpeg_pitch[ring->pipe], 0)); in amdgpu_jpeg_dec_ring_test_ring()
170 tmp = RREG32(adev->jpeg.inst[ring->me].external.jpeg_pitch[ring->pipe]); in amdgpu_jpeg_dec_ring_test_ring()
199 ib->ptr[0] = PACKETJ(adev->jpeg.internal.jpeg_pitch[ring->pipe], 0, 0, PACKETJ_TYPE0); in amdgpu_jpeg_dec_set_reg()
246 tmp = RREG32(adev->jpeg.inst[ring->me].external.jpeg_pitch[ring->pipe]); in amdgpu_jpeg_dec_ring_test_ib()
267 struct ras_common_if *ras_if = adev->jpeg.ras_if; in amdgpu_jpeg_process_poison_irq()
290 for (i = 0; i < adev->jpeg.num_jpeg_inst; ++i) { in amdgpu_jpeg_ras_late_init()
291 if (adev->jpeg.harvest_config & (1 << i) || in amdgpu_jpeg_ras_late_init()
292 !adev->jpeg.inst[i].ras_poison_irq.funcs) in amdgpu_jpeg_ras_late_init()
295 r = amdgpu_irq_get(adev, &adev->jpeg.inst[i].ras_poison_irq, 0); in amdgpu_jpeg_ras_late_init()
312 if (!adev->jpeg.ras) in amdgpu_jpeg_ras_sw_init()
315 ras = adev->jpeg.ras; in amdgpu_jpeg_ras_sw_init()
318 dev_err(adev->dev, "Failed to register jpeg ras block!\n"); in amdgpu_jpeg_ras_sw_init()
322 strcpy(ras->ras_block.ras_comm.name, "jpeg"); in amdgpu_jpeg_ras_sw_init()
325 adev->jpeg.ras_if = &ras->ras_block.ras_comm; in amdgpu_jpeg_ras_sw_init()
338 .mc_addr = adev->jpeg.inst[inst_idx].dpg_sram_gpu_addr, in amdgpu_jpeg_psp_update_sram()
339 .ucode_size = ((uintptr_t)adev->jpeg.inst[inst_idx].dpg_sram_curr_addr - in amdgpu_jpeg_psp_update_sram()
340 (uintptr_t)adev->jpeg.inst[inst_idx].dpg_sram_cpu_addr), in amdgpu_jpeg_psp_update_sram()