Lines Matching refs:release

87 	struct qxl_release *release;  in qxl_release_alloc()  local
89 size_t size = sizeof(*release); in qxl_release_alloc()
91 release = kmalloc(size, GFP_KERNEL); in qxl_release_alloc()
92 if (!release) { in qxl_release_alloc()
96 release->base.ops = NULL; in qxl_release_alloc()
97 release->type = type; in qxl_release_alloc()
98 release->release_offset = 0; in qxl_release_alloc()
99 release->surface_release_id = 0; in qxl_release_alloc()
100 INIT_LIST_HEAD(&release->bos); in qxl_release_alloc()
104 handle = idr_alloc(&qdev->release_idr, release, 1, 0, GFP_NOWAIT); in qxl_release_alloc()
105 release->base.seqno = ++qdev->release_seqno; in qxl_release_alloc()
109 kfree(release); in qxl_release_alloc()
113 *ret = release; in qxl_release_alloc()
115 release->id = handle; in qxl_release_alloc()
120 qxl_release_free_list(struct qxl_release *release) in qxl_release_free_list() argument
122 while (!list_empty(&release->bos)) { in qxl_release_free_list()
126 entry = container_of(release->bos.next, in qxl_release_free_list()
133 release->release_bo = NULL; in qxl_release_free_list()
138 struct qxl_release *release) in qxl_release_free() argument
140 DRM_DEBUG_DRIVER("release %d, type %d\n", release->id, release->type); in qxl_release_free()
142 if (release->surface_release_id) in qxl_release_free()
143 qxl_surface_id_dealloc(qdev, release->surface_release_id); in qxl_release_free()
146 idr_remove(&qdev->release_idr, release->id); in qxl_release_free()
149 if (release->base.ops) { in qxl_release_free()
150 WARN_ON(list_empty(&release->bos)); in qxl_release_free()
151 qxl_release_free_list(release); in qxl_release_free()
153 dma_fence_signal(&release->base); in qxl_release_free()
154 dma_fence_put(&release->base); in qxl_release_free()
156 qxl_release_free_list(release); in qxl_release_free()
157 kfree(release); in qxl_release_free()
171 int qxl_release_list_add(struct qxl_release *release, struct qxl_bo *bo) in qxl_release_list_add() argument
175 list_for_each_entry(entry, &release->bos, tv.head) { in qxl_release_list_add()
187 list_add_tail(&entry->tv.head, &release->bos); in qxl_release_list_add()
214 int qxl_release_reserve_list(struct qxl_release *release, bool no_intr) in qxl_release_reserve_list() argument
221 if (list_is_singular(&release->bos)) in qxl_release_reserve_list()
224 ret = ttm_eu_reserve_buffers(&release->ticket, &release->bos, in qxl_release_reserve_list()
229 list_for_each_entry(entry, &release->bos, tv.head) { in qxl_release_reserve_list()
234 ttm_eu_backoff_reservation(&release->ticket, &release->bos); in qxl_release_reserve_list()
241 void qxl_release_backoff_reserve_list(struct qxl_release *release) in qxl_release_backoff_reserve_list() argument
245 if (list_is_singular(&release->bos)) in qxl_release_backoff_reserve_list()
248 ttm_eu_backoff_reservation(&release->ticket, &release->bos); in qxl_release_backoff_reserve_list()
254 struct qxl_release **release) in qxl_alloc_surface_release_reserved() argument
262 idr_ret = qxl_release_alloc(qdev, QXL_RELEASE_SURFACE_CMD, release); in qxl_alloc_surface_release_reserved()
267 (*release)->release_bo = bo; in qxl_alloc_surface_release_reserved()
268 (*release)->release_offset = create_rel->release_offset + 64; in qxl_alloc_surface_release_reserved()
270 qxl_release_list_add(*release, bo); in qxl_alloc_surface_release_reserved()
272 info = qxl_release_map(qdev, *release); in qxl_alloc_surface_release_reserved()
274 qxl_release_unmap(qdev, *release, info); in qxl_alloc_surface_release_reserved()
279 QXL_RELEASE_SURFACE_CMD, release, NULL); in qxl_alloc_surface_release_reserved()
283 int type, struct qxl_release **release, in qxl_alloc_release_reserved() argument
308 idr_ret = qxl_release_alloc(qdev, type, release); in qxl_alloc_release_reserved()
330 qxl_release_free(qdev, *release); in qxl_alloc_release_reserved()
337 (*release)->release_bo = bo; in qxl_alloc_release_reserved()
338 …(*release)->release_offset = qdev->current_release_bo_offset[cur_idx] * release_size_per_bo[cur_id… in qxl_alloc_release_reserved()
350 ret = qxl_release_list_add(*release, bo); in qxl_alloc_release_reserved()
353 qxl_release_free(qdev, *release); in qxl_alloc_release_reserved()
357 info = qxl_release_map(qdev, *release); in qxl_alloc_release_reserved()
359 qxl_release_unmap(qdev, *release, info); in qxl_alloc_release_reserved()
367 struct qxl_release *release; in qxl_release_from_id_locked() local
370 release = idr_find(&qdev->release_idr, id); in qxl_release_from_id_locked()
372 if (!release) { in qxl_release_from_id_locked()
377 return release; in qxl_release_from_id_locked()
381 struct qxl_release *release) in qxl_release_map() argument
385 struct qxl_bo *bo = release->release_bo; in qxl_release_map()
387 ptr = qxl_bo_kmap_atomic_page(qdev, bo, release->release_offset & PAGE_MASK); in qxl_release_map()
390 info = ptr + (release->release_offset & ~PAGE_MASK); in qxl_release_map()
395 struct qxl_release *release, in qxl_release_unmap() argument
398 struct qxl_bo *bo = release->release_bo; in qxl_release_unmap()
401 ptr = ((void *)info) - (release->release_offset & ~PAGE_MASK); in qxl_release_unmap()
405 void qxl_release_fence_buffer_objects(struct qxl_release *release) in qxl_release_fence_buffer_objects() argument
414 if (list_is_singular(&release->bos) || list_empty(&release->bos)) in qxl_release_fence_buffer_objects()
417 bo = list_first_entry(&release->bos, struct ttm_validate_buffer, head)->bo; in qxl_release_fence_buffer_objects()
425 dma_fence_init(&release->base, &qxl_fence_ops, &qdev->release_lock, in qxl_release_fence_buffer_objects()
426 release->id | 0xf0000000, release->base.seqno); in qxl_release_fence_buffer_objects()
427 trace_dma_fence_emit(&release->base); in qxl_release_fence_buffer_objects()
429 list_for_each_entry(entry, &release->bos, head) { in qxl_release_fence_buffer_objects()
432 dma_resv_add_fence(bo->base.resv, &release->base, in qxl_release_fence_buffer_objects()
437 ww_acquire_fini(&release->ticket); in qxl_release_fence_buffer_objects()