Home | History | Annotate | Download | only in radeon

Lines Matching refs:vce

93  * radeon_vce_init - allocate memory, load vce firmware
97 * First step to get VCE online, allocate memory and load the firmware
108 INIT_DELAYED_WORK(&rdev->vce.idle_work, radeon_vce_idle_work_handler);
175 if (!scan_2dec_uint(&c, ']', &rdev->vce.fb_version))
178 if (sscanf(c, "%2u]", &rdev->vce.fb_version) != 1)
182 DRM_INFO("Found VCE firmware/feedback version %hhd.%hhd.%hhd / %d!\n",
183 start, mid, end, rdev->vce.fb_version);
185 rdev->vce.fw_version = (start << 24) | (mid << 16) | (end << 8);
188 if ((rdev->vce.fw_version != ((40 << 24) | (2 << 16) | (2 << 8))) &&
189 (rdev->vce.fw_version != ((50 << 24) | (0 << 16) | (1 << 8))) &&
190 (rdev->vce.fw_version != ((50 << 24) | (1 << 16) | (2 << 8))))
201 &rdev->vce.vcpu_bo);
203 dev_err(rdev->dev, "(%d) failed to allocate VCE bo\n", r);
207 r = radeon_bo_reserve(rdev->vce.vcpu_bo, false);
209 radeon_bo_unref(&rdev->vce.vcpu_bo);
210 dev_err(rdev->dev, "(%d) failed to reserve VCE bo\n", r);
214 r = radeon_bo_pin(rdev->vce.vcpu_bo, RADEON_GEM_DOMAIN_VRAM,
215 &rdev->vce.gpu_addr);
216 radeon_bo_unreserve(rdev->vce.vcpu_bo);
218 radeon_bo_unref(&rdev->vce.vcpu_bo);
219 dev_err(rdev->dev, "(%d) VCE bo pin failed\n", r);
224 atomic_set(&rdev->vce.handles[i], 0);
225 rdev->vce.filp[i] = NULL;
236 * Last step on VCE teardown, free firmware memory
240 if (rdev->vce.vcpu_bo == NULL)
243 radeon_bo_unref(&rdev->vce.vcpu_bo);
249 * radeon_vce_suspend - unpin VCE fw memory
258 if (rdev->vce.vcpu_bo == NULL)
262 if (atomic_read(&rdev->vce.handles[i]))
273 * radeon_vce_resume - pin VCE fw memory
283 if (rdev->vce.vcpu_bo == NULL)
286 r = radeon_bo_reserve(rdev->vce.vcpu_bo, false);
288 dev_err(rdev->dev, "(%d) failed to reserve VCE bo\n", r);
292 r = radeon_bo_kmap(rdev->vce.vcpu_bo, &cpu_addr);
294 radeon_bo_unreserve(rdev->vce.vcpu_bo);
295 dev_err(rdev->dev, "(%d) VCE map failed\n", r);
299 memset(cpu_addr, 0, radeon_bo_size(rdev->vce.vcpu_bo));
305 radeon_bo_kunmap(rdev->vce.vcpu_bo);
307 radeon_bo_unreserve(rdev->vce.vcpu_bo);
313 * radeon_vce_idle_work_handler - power off VCE
317 * power of VCE when it's not used any more
322 container_of(work, struct radeon_device, vce.idle_work.work);
332 schedule_delayed_work(&rdev->vce.idle_work,
338 * radeon_vce_note_usage - power up VCE
342 * Make sure VCE is powerd up when we want to use it
347 bool set_clocks = !cancel_delayed_work_sync(&rdev->vce.idle_work);
348 set_clocks &= schedule_delayed_work(&rdev->vce.idle_work,
366 * radeon_vce_free_handles - free still open VCE handles
371 * Close all VCE handles still open by this file pointer
377 uint32_t handle = atomic_read(&rdev->vce.handles[i]);
378 if (!handle || rdev->vce.filp[i] != filp)
386 DRM_ERROR("Error destroying VCE handle (%d)!\n", r);
388 rdev->vce.filp[i] = NULL;
389 atomic_set(&rdev->vce.handles[i], 0);
394 * radeon_vce_get_create_msg - generate a VCE create msg
398 * @handle: VCE session handle to use
419 /* stitch together an VCE create msg */
461 * radeon_vce_get_destroy_msg - generate a VCE destroy msg
465 * @handle: VCE session handle to use
486 /* stitch together an VCE destroy msg */
585 if (atomic_read(&p->rdev->vce.handles[i]) == handle) {
586 if (p->rdev->vce.filp[i] != p->filp) {
587 DRM_ERROR("VCE handle collision detected!\n");
596 if (!atomic_cmpxchg(&p->rdev->vce.handles[i], 0, handle)) {
597 p->rdev->vce.filp[i] = p->filp;
598 p->rdev->vce.img_size[i] = 0;
604 DRM_ERROR("No more free VCE handles!\n");
627 DRM_ERROR("invalid VCE command length (%d)!\n", len);
645 size = &p->rdev->vce.img_size[session_idx];
711 DRM_ERROR("invalid VCE command (0x%x)!\n", cmd);
737 atomic_cmpxchg(&p->rdev->vce.handles[i], handle, 0);
807 * radeon_vce_ring_test - test if VCE ring is working
821 DRM_ERROR("radeon: vce failed to lock ring %d (%d).\n",
847 * radeon_vce_ib_test - test if VCE IBs are working