Lines Matching refs:client

133 				      struct i915_guc_client *client)  in host2guc_allocate_doorbell()  argument
138 data[1] = client->ctx_index; in host2guc_allocate_doorbell()
144 struct i915_guc_client *client) in host2guc_release_doorbell() argument
149 data[1] = client->ctx_index; in host2guc_release_doorbell()
155 struct i915_guc_client *client) in host2guc_sample_forcewake() argument
183 struct i915_guc_client *client) in guc_init_doorbell() argument
188 base = kmap_atomic(i915_gem_object_get_page(client->client_obj, 0)); in guc_init_doorbell()
189 doorbell = base + client->doorbell_offset; in guc_init_doorbell()
256 struct i915_guc_client *client) in guc_disable_doorbell() argument
261 int drbreg = GEN8_DRBREGL(client->doorbell_id); in guc_disable_doorbell()
264 base = kmap_atomic(i915_gem_object_get_page(client->client_obj, 0)); in guc_disable_doorbell()
265 doorbell = base + client->doorbell_offset; in guc_disable_doorbell()
276 I915_WRITE(GEN8_DRBREGU(client->doorbell_id), 0); in guc_disable_doorbell()
350 struct i915_guc_client *client) in guc_init_proc_desc() argument
355 base = kmap_atomic(i915_gem_object_get_page(client->client_obj, 0)); in guc_init_proc_desc()
356 desc = base + client->proc_desc_offset; in guc_init_proc_desc()
369 desc->context_id = client->ctx_index; in guc_init_proc_desc()
370 desc->wq_size_bytes = client->wq_size; in guc_init_proc_desc()
372 desc->priority = client->priority; in guc_init_proc_desc()
386 struct i915_guc_client *client) in guc_init_ctx_desc() argument
388 struct intel_context *ctx = client->owner; in guc_init_ctx_desc()
396 desc.context_id = client->ctx_index; in guc_init_ctx_desc()
397 desc.priority = client->priority; in guc_init_ctx_desc()
398 desc.db_id = client->doorbell_id; in guc_init_ctx_desc()
425 lrc->context_id = (client->ctx_index << GUC_ELC_CTXID_OFFSET) | in guc_init_ctx_desc()
446 desc.db_trigger_uk = client->doorbell_offset + in guc_init_ctx_desc()
447 i915_gem_obj_ggtt_offset(client->client_obj); in guc_init_ctx_desc()
448 desc.db_trigger_phy = client->doorbell_offset + in guc_init_ctx_desc()
449 sg_dma_address(client->client_obj->pages->sgl); in guc_init_ctx_desc()
451 desc.process_desc = client->proc_desc_offset + in guc_init_ctx_desc()
452 i915_gem_obj_ggtt_offset(client->client_obj); in guc_init_ctx_desc()
454 desc.wq_addr = client->wq_offset + in guc_init_ctx_desc()
455 i915_gem_obj_ggtt_offset(client->client_obj); in guc_init_ctx_desc()
457 desc.wq_size = client->wq_size; in guc_init_ctx_desc()
463 desc.desc_private = (uintptr_t)client; in guc_init_ctx_desc()
468 sizeof(desc) * client->ctx_index); in guc_init_ctx_desc()
472 struct i915_guc_client *client) in guc_fini_ctx_desc() argument
481 sizeof(desc) * client->ctx_index); in guc_fini_ctx_desc()
596 int i915_guc_submit(struct i915_guc_client *client, in i915_guc_submit() argument
599 struct intel_guc *guc = client->guc; in i915_guc_submit()
608 spin_lock_irqsave(&client->wq_lock, flags); in i915_guc_submit()
610 q_ret = guc_add_workqueue_item(client, rq); in i915_guc_submit()
612 b_ret = guc_ring_doorbell(client); in i915_guc_submit()
614 client->submissions[ring_id] += 1; in i915_guc_submit()
616 client->q_fail += 1; in i915_guc_submit()
617 client->retcode = q_ret; in i915_guc_submit()
619 client->b_fail += 1; in i915_guc_submit()
620 client->retcode = q_ret = b_ret; in i915_guc_submit()
622 client->retcode = 0; in i915_guc_submit()
624 spin_unlock_irqrestore(&client->wq_lock, flags); in i915_guc_submit()
694 struct i915_guc_client *client) in guc_client_free() argument
699 if (!client) in guc_client_free()
702 if (client->doorbell_id != GUC_INVALID_DOORBELL_ID) { in guc_client_free()
707 guc_disable_doorbell(guc, client); in guc_client_free()
708 host2guc_release_doorbell(guc, client); in guc_client_free()
709 release_doorbell(guc, client->doorbell_id); in guc_client_free()
717 gem_release_guc_obj(client->client_obj); in guc_client_free()
719 if (client->ctx_index != GUC_INVALID_CTX_ID) { in guc_client_free()
720 guc_fini_ctx_desc(guc, client); in guc_client_free()
721 ida_simple_remove(&guc->ctx_ids, client->ctx_index); in guc_client_free()
724 kfree(client); in guc_client_free()
742 struct i915_guc_client *client; in guc_client_alloc() local
747 client = kzalloc(sizeof(*client), GFP_KERNEL); in guc_client_alloc()
748 if (!client) in guc_client_alloc()
751 client->doorbell_id = GUC_INVALID_DOORBELL_ID; in guc_client_alloc()
752 client->priority = priority; in guc_client_alloc()
753 client->owner = ctx; in guc_client_alloc()
754 client->guc = guc; in guc_client_alloc()
756 client->ctx_index = (uint32_t)ida_simple_get(&guc->ctx_ids, 0, in guc_client_alloc()
758 if (client->ctx_index >= GUC_MAX_GPU_CONTEXTS) { in guc_client_alloc()
759 client->ctx_index = GUC_INVALID_CTX_ID; in guc_client_alloc()
768 client->client_obj = obj; in guc_client_alloc()
769 client->wq_offset = GUC_DB_SIZE; in guc_client_alloc()
770 client->wq_size = GUC_WQ_SIZE; in guc_client_alloc()
771 spin_lock_init(&client->wq_lock); in guc_client_alloc()
773 client->doorbell_offset = select_doorbell_cacheline(guc); in guc_client_alloc()
780 if (client->doorbell_offset >= (GUC_DB_SIZE / 2)) in guc_client_alloc()
781 client->proc_desc_offset = 0; in guc_client_alloc()
783 client->proc_desc_offset = (GUC_DB_SIZE / 2); in guc_client_alloc()
785 client->doorbell_id = assign_doorbell(guc, client->priority); in guc_client_alloc()
786 if (client->doorbell_id == GUC_INVALID_DOORBELL_ID) in guc_client_alloc()
790 guc_init_proc_desc(guc, client); in guc_client_alloc()
791 guc_init_ctx_desc(guc, client); in guc_client_alloc()
792 guc_init_doorbell(guc, client); in guc_client_alloc()
796 if (host2guc_allocate_doorbell(guc, client)) in guc_client_alloc()
800 priority, client, client->ctx_index, client->doorbell_id); in guc_client_alloc()
802 return client; in guc_client_alloc()
807 guc_client_free(dev, client); in guc_client_alloc()
888 struct i915_guc_client *client; in i915_guc_submission_enable() local
891 client = guc_client_alloc(dev, GUC_CTX_PRIORITY_KMD_NORMAL, ctx); in i915_guc_submission_enable()
892 if (!client) { in i915_guc_submission_enable()
897 guc->execbuf_client = client; in i915_guc_submission_enable()
899 host2guc_sample_forcewake(guc, client); in i915_guc_submission_enable()