Lines Matching full:cx

105 static void dump_mb(struct cx18 *cx, struct cx18_mailbox *mb, char *name)  in dump_mb()  argument
203 static void cx18_mdl_send_to_alsa(struct cx18 *cx, struct cx18_stream *s, in cx18_mdl_send_to_alsa() argument
218 cx->pcm_announce_callback(cx->alsa, buf->buf, in cx18_mdl_send_to_alsa()
226 cx->pcm_announce_callback(cx->alsa, buf->buf, buf->bytesused); in cx18_mdl_send_to_alsa()
230 static void epu_dma_done(struct cx18 *cx, struct cx18_in_work_order *order) in epu_dma_done() argument
241 s = cx18_handle_to_stream(cx, handle); in epu_dma_done()
300 if (cx->pcm_announce_callback != NULL) { in epu_dma_done()
301 cx18_mdl_send_to_alsa(cx, s, mdl); in epu_dma_done()
312 cx18_stream_rotate_idx_mdls(cx); in epu_dma_done()
318 wake_up(&cx->dma_waitq); in epu_dma_done()
323 static void epu_debug(struct cx18 *cx, struct cx18_in_work_order *order) in epu_debug() argument
330 if (!test_bit(CX18_F_I_LOADED_FW, &cx->i_flags) && p && p > str) in epu_debug()
334 static void epu_cmd(struct cx18 *cx, struct cx18_in_work_order *order) in epu_cmd() argument
341 epu_dma_done(cx, order); in epu_cmd()
344 epu_debug(cx, order); in epu_cmd()
363 void free_in_work_order(struct cx18 *cx, struct cx18_in_work_order *order) in free_in_work_order() argument
372 struct cx18 *cx = order->cx; in cx18_in_work_handler() local
373 epu_cmd(cx, order); in cx18_in_work_handler()
374 free_in_work_order(cx, order); in cx18_in_work_handler()
382 static void mb_ack_irq(struct cx18 *cx, struct cx18_in_work_order *order) in mb_ack_irq() argument
390 ack_mb = &cx->scb->apu2epu_mb; in mb_ack_irq()
394 ack_mb = &cx->scb->cpu2epu_mb; in mb_ack_irq()
404 if (req != cx18_readl(cx, &ack_mb->request) || in mb_ack_irq()
405 req == cx18_readl(cx, &ack_mb->ack)) { in mb_ack_irq()
411 cx18_writel(cx, req, &ack_mb->ack); in mb_ack_irq()
412 cx18_write_reg_expect(cx, ack_irq, SW2_INT_SET, ack_irq, ack_irq); in mb_ack_irq()
416 static int epu_dma_done_irq(struct cx18 *cx, struct cx18_in_work_order *order) in epu_dma_done_irq() argument
430 mb_ack_irq(cx, order); in epu_dma_done_irq()
436 cx18_readl(cx, cx->enc_mem + mdl_ack_offset + i); in epu_dma_done_irq()
439 mb_ack_irq(cx, order); in epu_dma_done_irq()
444 int epu_debug_irq(struct cx18 *cx, struct cx18_in_work_order *order) in epu_debug_irq() argument
452 cx18_setup_page(cx, str_offset); in epu_debug_irq()
453 cx18_memcpy_fromio(cx, str, cx->enc_mem + str_offset, 252); in epu_debug_irq()
455 cx18_setup_page(cx, SCB_OFFSET); in epu_debug_irq()
459 mb_ack_irq(cx, order); in epu_debug_irq()
465 int epu_cmd_irq(struct cx18 *cx, struct cx18_in_work_order *order) in epu_cmd_irq() argument
474 ret = epu_dma_done_irq(cx, order); in epu_cmd_irq()
477 ret = epu_debug_irq(cx, order); in epu_cmd_irq()
497 struct cx18_in_work_order *alloc_in_work_order_irq(struct cx18 *cx) in alloc_in_work_order_irq() argument
511 if (atomic_read(&cx->in_work_order[i].pending) == 0) { in alloc_in_work_order_irq()
512 order = &cx->in_work_order[i]; in alloc_in_work_order_irq()
520 void cx18_api_epu_cmd_irq(struct cx18 *cx, int rpu) in cx18_api_epu_cmd_irq() argument
530 mb = &cx->scb->cpu2epu_mb; in cx18_api_epu_cmd_irq()
533 mb = &cx->scb->apu2epu_mb; in cx18_api_epu_cmd_irq()
539 order = alloc_in_work_order_irq(cx); in cx18_api_epu_cmd_irq()
551 (&order_mb->cmd)[i] = cx18_readl(cx, &mb->cmd + i); in cx18_api_epu_cmd_irq()
555 (&order_mb->request)[i] = cx18_readl(cx, &mb->request + i); in cx18_api_epu_cmd_irq()
561 dump_mb(cx, order_mb, "incoming"); in cx18_api_epu_cmd_irq()
569 submit = epu_cmd_irq(cx, order); in cx18_api_epu_cmd_irq()
571 queue_work(cx->in_work_queue, &order->work); in cx18_api_epu_cmd_irq()
580 static int cx18_api_call(struct cx18 *cx, u32 cmd, int args, u32 data[]) in cx18_api_call() argument
611 waitq = &cx->mb_apu_waitq; in cx18_api_call()
612 mb_lock = &cx->epu2apu_mb_lock; in cx18_api_call()
614 mb = &cx->scb->epu2apu_mb; in cx18_api_call()
617 waitq = &cx->mb_cpu_waitq; in cx18_api_call()
618 mb_lock = &cx->epu2cpu_mb_lock; in cx18_api_call()
620 mb = &cx->scb->epu2cpu_mb; in cx18_api_call()
638 req = cx18_readl(cx, &mb->request); in cx18_api_call()
641 (ack = cx18_readl(cx, &mb->ack)) == req, in cx18_api_call()
645 cx18_writel(cx, req, &mb->ack); in cx18_api_call()
655 cx18_writel(cx, cmd, &mb->cmd); in cx18_api_call()
657 cx18_writel(cx, data[i], &mb->args[i]); in cx18_api_call()
658 cx18_writel(cx, 0, &mb->error); in cx18_api_call()
659 cx18_writel(cx, req, &mb->request); in cx18_api_call()
660 cx18_writel(cx, req - 1, &mb->ack); /* ensure ack & req are distinct */ in cx18_api_call()
672 cx18_write_reg_expect(cx, irq, SW1_INT_SET, irq, irq); in cx18_api_call()
675 ack = cx18_readl(cx, &mb->ack); in cx18_api_call()
679 ack = cx18_readl(cx, &mb->ack); in cx18_api_call()
710 data[i] = cx18_readl(cx, &mb->args[i]); in cx18_api_call()
711 err = cx18_readl(cx, &mb->error); in cx18_api_call()
728 int cx18_api(struct cx18 *cx, u32 cmd, int args, u32 data[]) in cx18_api() argument
730 return cx18_api_call(cx, cmd, args, data); in cx18_api()
735 struct cx18 *cx = s->cx; in cx18_set_filter_param() local
739 mode = (cx->filter_mode & 1) ? 2 : (cx->spatial_strength ? 1 : 0); in cx18_set_filter_param()
740 ret = cx18_vapi(cx, CX18_CPU_SET_FILTER_PARAM, 4, in cx18_set_filter_param()
741 s->handle, 1, mode, cx->spatial_strength); in cx18_set_filter_param()
742 mode = (cx->filter_mode & 2) ? 2 : (cx->temporal_strength ? 1 : 0); in cx18_set_filter_param()
743 ret = ret ? ret : cx18_vapi(cx, CX18_CPU_SET_FILTER_PARAM, 4, in cx18_set_filter_param()
744 s->handle, 0, mode, cx->temporal_strength); in cx18_set_filter_param()
745 ret = ret ? ret : cx18_vapi(cx, CX18_CPU_SET_FILTER_PARAM, 4, in cx18_set_filter_param()
746 s->handle, 2, cx->filter_mode >> 2, 0); in cx18_set_filter_param()
754 struct cx18 *cx = s->cx; in cx18_api_func() local
760 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_IN, 6, in cx18_api_func()
763 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_RESOLUTION, 3, in cx18_api_func()
766 return cx18_vapi(cx, CX18_CPU_SET_STREAM_OUTPUT_TYPE, 2, in cx18_api_func()
769 return cx18_vapi(cx, CX18_CPU_SET_ASPECT_RATIO, 2, in cx18_api_func()
773 return cx18_vapi(cx, CX18_CPU_SET_GOP_STRUCTURE, 3, in cx18_api_func()
778 return cx18_vapi(cx, CX18_CPU_SET_AUDIO_PARAMETERS, 2, in cx18_api_func()
781 return cx18_vapi(cx, CX18_CPU_SET_AUDIO_MUTE, 2, in cx18_api_func()
784 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_RATE, 5, in cx18_api_func()
787 return cx18_vapi(cx, CX18_CPU_SET_VIDEO_MUTE, 2, in cx18_api_func()
790 return cx18_vapi(cx, CX18_CPU_SET_SKIP_INPUT_FRAME, 2, in cx18_api_func()
793 return cx18_vapi(cx, CX18_CPU_SET_MISC_PARAMETERS, 4, in cx18_api_func()
796 cx->filter_mode = (data[0] & 3) | (data[1] << 2); in cx18_api_func()
799 cx->spatial_strength = data[0]; in cx18_api_func()
800 cx->temporal_strength = data[1]; in cx18_api_func()
803 return cx18_vapi(cx, CX18_CPU_SET_SPATIAL_FILTER_TYPE, 3, in cx18_api_func()
806 return cx18_vapi(cx, CX18_CPU_SET_MEDIAN_CORING, 5, in cx18_api_func()
813 int cx18_vapi_result(struct cx18 *cx, u32 data[MAX_MB_ARGUMENTS], in cx18_vapi_result() argument
823 return cx18_api(cx, cmd, args, data); in cx18_vapi_result()
826 int cx18_vapi(struct cx18 *cx, u32 cmd, int args, ...) in cx18_vapi() argument
832 if (cx == NULL) { in cx18_vapi()
833 CX18_ERR("cx == NULL (cmd=%x)\n", cmd); in cx18_vapi()
844 return cx18_api(cx, cmd, args, data); in cx18_vapi()