Lines Matching full:vgpu

49 	struct intel_vgpu *vgpu;  in vgpu_gem_get_pages()  local
65 vgpu = fb_info->obj->vgpu; in vgpu_gem_get_pages()
66 if (drm_WARN_ON(&dev_priv->drm, !vgpu)) in vgpu_gem_get_pages()
83 if (intel_gvt_dma_pin_guest_page(vgpu, dma_addr)) { in vgpu_gem_get_pages()
102 intel_gvt_dma_unmap_guest_page(vgpu, dma_addr); in vgpu_gem_get_pages()
120 struct intel_vgpu *vgpu = obj->vgpu; in vgpu_gem_put_pages() local
124 intel_gvt_dma_unmap_guest_page(vgpu, in vgpu_gem_put_pages()
136 struct intel_vgpu *vgpu = obj->vgpu; in dmabuf_gem_object_free() local
140 if (vgpu && test_bit(INTEL_VGPU_STATUS_ACTIVE, vgpu->status) && in dmabuf_gem_object_free()
141 !list_empty(&vgpu->dmabuf_obj_list_head)) { in dmabuf_gem_object_free()
142 list_for_each(pos, &vgpu->dmabuf_obj_list_head) { in dmabuf_gem_object_free()
146 idr_remove(&vgpu->object_idr, in dmabuf_gem_object_free()
176 struct intel_vgpu *vgpu = obj->vgpu; in vgpu_gem_release() local
178 if (vgpu) { in vgpu_gem_release()
179 mutex_lock(&vgpu->dmabuf_lock); in vgpu_gem_release()
182 mutex_unlock(&vgpu->dmabuf_lock); in vgpu_gem_release()
184 /* vgpu is NULL, as it has been removed already */ in vgpu_gem_release()
255 struct intel_vgpu *vgpu, in vgpu_get_plane_info() argument
266 ret = intel_vgpu_decode_primary_plane(vgpu, &p); in vgpu_get_plane_info()
296 ret = intel_vgpu_decode_cursor_plane(vgpu, &c); in vgpu_get_plane_info()
332 if (!intel_gvt_ggtt_validate_range(vgpu, info->start, info->size)) { in vgpu_get_plane_info()
341 pick_dmabuf_by_info(struct intel_vgpu *vgpu, in pick_dmabuf_by_info() argument
349 list_for_each(pos, &vgpu->dmabuf_obj_list_head) { in pick_dmabuf_by_info()
371 pick_dmabuf_by_num(struct intel_vgpu *vgpu, u32 id) in pick_dmabuf_by_num() argument
377 list_for_each(pos, &vgpu->dmabuf_obj_list_head) { in pick_dmabuf_by_num()
403 int intel_vgpu_query_plane(struct intel_vgpu *vgpu, void *args) in intel_vgpu_query_plane() argument
405 struct drm_device *dev = &vgpu->gvt->gt->i915->drm; in intel_vgpu_query_plane()
418 ret = vgpu_get_plane_info(dev, vgpu, &fb_info, in intel_vgpu_query_plane()
423 mutex_lock(&vgpu->dmabuf_lock); in intel_vgpu_query_plane()
425 dmabuf_obj = pick_dmabuf_by_info(vgpu, &fb_info); in intel_vgpu_query_plane()
439 gvt_dbg_dpy("vgpu%d: re-use dmabuf_obj ref %d, id %d\n", in intel_vgpu_query_plane()
440 vgpu->id, kref_read(&dmabuf_obj->kref), in intel_vgpu_query_plane()
442 mutex_unlock(&vgpu->dmabuf_lock); in intel_vgpu_query_plane()
446 mutex_unlock(&vgpu->dmabuf_lock); in intel_vgpu_query_plane()
459 gvt_vgpu_err("allocate intel vgpu fb info failed\n"); in intel_vgpu_query_plane()
467 dmabuf_obj->vgpu = vgpu; in intel_vgpu_query_plane()
469 ret = idr_alloc(&vgpu->object_idr, dmabuf_obj, 1, 0, GFP_NOWAIT); in intel_vgpu_query_plane()
482 mutex_lock(&vgpu->dmabuf_lock); in intel_vgpu_query_plane()
483 list_add_tail(&dmabuf_obj->list, &vgpu->dmabuf_obj_list_head); in intel_vgpu_query_plane()
484 mutex_unlock(&vgpu->dmabuf_lock); in intel_vgpu_query_plane()
486 gvt_dbg_dpy("vgpu%d: %s new dmabuf_obj ref %d, id %d\n", vgpu->id, in intel_vgpu_query_plane()
501 int intel_vgpu_get_dmabuf(struct intel_vgpu *vgpu, unsigned int dmabuf_id) in intel_vgpu_get_dmabuf() argument
503 struct drm_device *dev = &vgpu->gvt->gt->i915->drm; in intel_vgpu_get_dmabuf()
510 mutex_lock(&vgpu->dmabuf_lock); in intel_vgpu_get_dmabuf()
512 dmabuf_obj = pick_dmabuf_by_num(vgpu, dmabuf_id); in intel_vgpu_get_dmabuf()
549 mutex_unlock(&vgpu->dmabuf_lock); in intel_vgpu_get_dmabuf()
551 gvt_dbg_dpy("vgpu%d: dmabuf:%d, dmabuf ref %d, fd:%d\n" in intel_vgpu_get_dmabuf()
553 vgpu->id, dmabuf_obj->dmabuf_id, in intel_vgpu_get_dmabuf()
568 mutex_unlock(&vgpu->dmabuf_lock); in intel_vgpu_get_dmabuf()
572 void intel_vgpu_dmabuf_cleanup(struct intel_vgpu *vgpu) in intel_vgpu_dmabuf_cleanup() argument
577 mutex_lock(&vgpu->dmabuf_lock); in intel_vgpu_dmabuf_cleanup()
578 list_for_each_safe(pos, n, &vgpu->dmabuf_obj_list_head) { in intel_vgpu_dmabuf_cleanup()
580 dmabuf_obj->vgpu = NULL; in intel_vgpu_dmabuf_cleanup()
582 idr_remove(&vgpu->object_idr, dmabuf_obj->dmabuf_id); in intel_vgpu_dmabuf_cleanup()
592 mutex_unlock(&vgpu->dmabuf_lock); in intel_vgpu_dmabuf_cleanup()