Lines Matching refs:dmabuf_obj
137 struct intel_vgpu_dmabuf_obj *dmabuf_obj; in dmabuf_gem_object_free() local
142 dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list); in dmabuf_gem_object_free()
143 if (dmabuf_obj == obj) { in dmabuf_gem_object_free()
146 dmabuf_obj->dmabuf_id); in dmabuf_gem_object_free()
147 kfree(dmabuf_obj->info); in dmabuf_gem_object_free()
148 kfree(dmabuf_obj); in dmabuf_gem_object_free()
345 struct intel_vgpu_dmabuf_obj *dmabuf_obj = NULL; in pick_dmabuf_by_info() local
349 dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list); in pick_dmabuf_by_info()
350 if (!dmabuf_obj->info) in pick_dmabuf_by_info()
353 fb_info = (struct intel_vgpu_fb_info *)dmabuf_obj->info; in pick_dmabuf_by_info()
361 ret = dmabuf_obj; in pick_dmabuf_by_info()
373 struct intel_vgpu_dmabuf_obj *dmabuf_obj = NULL; in pick_dmabuf_by_num() local
377 dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list); in pick_dmabuf_by_num()
378 if (dmabuf_obj->dmabuf_id == id) { in pick_dmabuf_by_num()
379 ret = dmabuf_obj; in pick_dmabuf_by_num()
406 struct intel_vgpu_dmabuf_obj *dmabuf_obj; in intel_vgpu_query_plane() local
424 dmabuf_obj = pick_dmabuf_by_info(vgpu, &fb_info); in intel_vgpu_query_plane()
425 if (dmabuf_obj) { in intel_vgpu_query_plane()
427 gfx_plane_info->dmabuf_id = dmabuf_obj->dmabuf_id; in intel_vgpu_query_plane()
433 if (!dmabuf_obj->initref) { in intel_vgpu_query_plane()
434 dmabuf_obj->initref = true; in intel_vgpu_query_plane()
435 dmabuf_obj_get(dmabuf_obj); in intel_vgpu_query_plane()
439 vgpu->id, kref_read(&dmabuf_obj->kref), in intel_vgpu_query_plane()
448 dmabuf_obj = kmalloc(sizeof(struct intel_vgpu_dmabuf_obj), GFP_KERNEL); in intel_vgpu_query_plane()
449 if (unlikely(!dmabuf_obj)) { in intel_vgpu_query_plane()
455 dmabuf_obj->info = kmalloc(sizeof(struct intel_vgpu_fb_info), in intel_vgpu_query_plane()
457 if (unlikely(!dmabuf_obj->info)) { in intel_vgpu_query_plane()
462 memcpy(dmabuf_obj->info, &fb_info, sizeof(struct intel_vgpu_fb_info)); in intel_vgpu_query_plane()
464 ((struct intel_vgpu_fb_info *)dmabuf_obj->info)->obj = dmabuf_obj; in intel_vgpu_query_plane()
466 dmabuf_obj->vgpu = vgpu; in intel_vgpu_query_plane()
468 ret = idr_alloc(&vgpu->object_idr, dmabuf_obj, 1, 0, GFP_NOWAIT); in intel_vgpu_query_plane()
472 dmabuf_obj->dmabuf_id = ret; in intel_vgpu_query_plane()
474 dmabuf_obj->initref = true; in intel_vgpu_query_plane()
476 kref_init(&dmabuf_obj->kref); in intel_vgpu_query_plane()
480 INIT_LIST_HEAD(&dmabuf_obj->list); in intel_vgpu_query_plane()
482 list_add_tail(&dmabuf_obj->list, &vgpu->dmabuf_obj_list_head); in intel_vgpu_query_plane()
486 __func__, kref_read(&dmabuf_obj->kref), ret); in intel_vgpu_query_plane()
491 kfree(dmabuf_obj->info); in intel_vgpu_query_plane()
493 kfree(dmabuf_obj); in intel_vgpu_query_plane()
503 struct intel_vgpu_dmabuf_obj *dmabuf_obj; in intel_vgpu_get_dmabuf() local
511 dmabuf_obj = pick_dmabuf_by_num(vgpu, dmabuf_id); in intel_vgpu_get_dmabuf()
512 if (dmabuf_obj == NULL) { in intel_vgpu_get_dmabuf()
518 obj = vgpu_create_gem(dev, dmabuf_obj->info); in intel_vgpu_get_dmabuf()
525 obj->gvt_info = dmabuf_obj->info; in intel_vgpu_get_dmabuf()
541 dmabuf_obj_get(dmabuf_obj); in intel_vgpu_get_dmabuf()
543 if (dmabuf_obj->initref) { in intel_vgpu_get_dmabuf()
544 dmabuf_obj->initref = false; in intel_vgpu_get_dmabuf()
545 dmabuf_obj_put(dmabuf_obj); in intel_vgpu_get_dmabuf()
552 vgpu->id, dmabuf_obj->dmabuf_id, in intel_vgpu_get_dmabuf()
553 kref_read(&dmabuf_obj->kref), in intel_vgpu_get_dmabuf()
574 struct intel_vgpu_dmabuf_obj *dmabuf_obj; in intel_vgpu_dmabuf_cleanup() local
578 dmabuf_obj = list_entry(pos, struct intel_vgpu_dmabuf_obj, list); in intel_vgpu_dmabuf_cleanup()
579 dmabuf_obj->vgpu = NULL; in intel_vgpu_dmabuf_cleanup()
581 idr_remove(&vgpu->object_idr, dmabuf_obj->dmabuf_id); in intel_vgpu_dmabuf_cleanup()
585 if (dmabuf_obj->initref) { in intel_vgpu_dmabuf_cleanup()
586 dmabuf_obj->initref = false; in intel_vgpu_dmabuf_cleanup()
587 dmabuf_obj_put(dmabuf_obj); in intel_vgpu_dmabuf_cleanup()