Lines Matching refs:ctch

143 static bool ctch_is_open(struct intel_guc_ct_channel *ctch)  in ctch_is_open()  argument
145 return ctch->vma != NULL; in ctch_is_open()
149 struct intel_guc_ct_channel *ctch) in ctch_init() argument
156 GEM_BUG_ON(ctch->vma); in ctch_init()
186 ctch->vma = vma; in ctch_init()
195 intel_guc_ggtt_offset(guc, ctch->vma)); in ctch_init()
198 for (i = 0; i < ARRAY_SIZE(ctch->ctbs); i++) { in ctch_init()
200 ctch->ctbs[i].desc = blob + PAGE_SIZE/4 * i; in ctch_init()
201 ctch->ctbs[i].cmds = blob + PAGE_SIZE/4 * i + PAGE_SIZE/2; in ctch_init()
207 i915_vma_unpin_and_release(&ctch->vma); in ctch_init()
210 ctch->owner, err); in ctch_init()
215 struct intel_guc_ct_channel *ctch) in ctch_fini() argument
217 GEM_BUG_ON(!ctch->vma); in ctch_fini()
219 i915_gem_object_unpin_map(ctch->vma->obj); in ctch_fini()
220 i915_vma_unpin_and_release(&ctch->vma); in ctch_fini()
224 struct intel_guc_ct_channel *ctch) in ctch_open() argument
231 ctch->owner, yesno(ctch_is_open(ctch))); in ctch_open()
233 if (!ctch->vma) { in ctch_open()
234 err = ctch_init(guc, ctch); in ctch_open()
237 GEM_BUG_ON(!ctch->vma); in ctch_open()
241 base = intel_guc_ggtt_offset(guc, ctch->vma); in ctch_open()
246 for (i = 0; i < ARRAY_SIZE(ctch->ctbs); i++) { in ctch_open()
248 guc_ct_buffer_desc_init(ctch->ctbs[i].desc, in ctch_open()
251 ctch->owner); in ctch_open()
273 ctch->owner, in ctch_open()
276 ctch_fini(guc, ctch); in ctch_open()
278 DRM_ERROR("CT: can't open channel %d; err=%d\n", ctch->owner, err); in ctch_open()
283 struct intel_guc_ct_channel *ctch) in ctch_close() argument
285 GEM_BUG_ON(!ctch_is_open(ctch)); in ctch_close()
288 ctch->owner, in ctch_close()
291 ctch->owner, in ctch_close()
293 ctch_fini(guc, ctch); in ctch_close()
296 static u32 ctch_get_next_fence(struct intel_guc_ct_channel *ctch) in ctch_get_next_fence() argument
299 return ++ctch->next_fence; in ctch_get_next_fence()
473 struct intel_guc_ct_channel *ctch, in ctch_send() argument
480 struct intel_guc_ct_buffer *ctb = &ctch->ctbs[CTB_SEND]; in ctch_send()
487 GEM_BUG_ON(!ctch_is_open(ctch)); in ctch_send()
492 fence = ctch_get_next_fence(ctch); in ctch_send()
547 struct intel_guc_ct_channel *ctch = &ct->host_channel; in intel_guc_send_ct() local
553 ret = ctch_send(ct, ctch, action, len, response_buf, response_buf_size, in intel_guc_send_ct()
818 struct intel_guc_ct_channel *ctch = &ct->host_channel; in ct_process_host_channel() local
819 struct intel_guc_ct_buffer *ctb = &ctch->ctbs[CTB_RECV]; in ct_process_host_channel()
823 if (!ctch_is_open(ctch)) in ct_process_host_channel()
866 struct intel_guc_ct_channel *ctch = &ct->host_channel; in intel_guc_ct_enable() local
871 err = ctch_open(guc, ctch); in intel_guc_ct_enable()
892 struct intel_guc_ct_channel *ctch = &ct->host_channel; in intel_guc_ct_disable() local
896 if (!ctch_is_open(ctch)) in intel_guc_ct_disable()
899 ctch_close(guc, ctch); in intel_guc_ct_disable()