Lines Matching refs:vpu
11 static void handle_enc_init_msg(struct venc_vpu_inst *vpu, void *data) in handle_enc_init_msg() argument
15 vpu->inst_addr = msg->vpu_inst_addr; in handle_enc_init_msg()
16 vpu->vsi = vpu_mapping_dm_addr(vpu->dev, msg->vpu_inst_addr); in handle_enc_init_msg()
19 static void handle_enc_encode_msg(struct venc_vpu_inst *vpu, void *data) in handle_enc_encode_msg() argument
23 vpu->state = msg->state; in handle_enc_encode_msg()
24 vpu->bs_size = msg->bs_size; in handle_enc_encode_msg()
25 vpu->is_key_frm = msg->is_key_frm; in handle_enc_encode_msg()
31 struct venc_vpu_inst *vpu = in vpu_enc_ipi_handler() local
34 mtk_vcodec_debug(vpu, "msg_id %x inst %p status %d", in vpu_enc_ipi_handler()
35 msg->msg_id, vpu, msg->status); in vpu_enc_ipi_handler()
39 handle_enc_init_msg(vpu, data); in vpu_enc_ipi_handler()
44 handle_enc_encode_msg(vpu, data); in vpu_enc_ipi_handler()
49 mtk_vcodec_err(vpu, "unknown msg id %x", msg->msg_id); in vpu_enc_ipi_handler()
53 vpu->signaled = 1; in vpu_enc_ipi_handler()
54 vpu->failure = (msg->status != VENC_IPI_MSG_STATUS_OK); in vpu_enc_ipi_handler()
56 mtk_vcodec_debug_leave(vpu); in vpu_enc_ipi_handler()
59 static int vpu_enc_send_msg(struct venc_vpu_inst *vpu, void *msg, in vpu_enc_send_msg() argument
64 mtk_vcodec_debug_enter(vpu); in vpu_enc_send_msg()
66 if (!vpu->dev) { in vpu_enc_send_msg()
67 mtk_vcodec_err(vpu, "inst dev is NULL"); in vpu_enc_send_msg()
71 status = vpu_ipi_send(vpu->dev, vpu->id, msg, len); in vpu_enc_send_msg()
73 mtk_vcodec_err(vpu, "vpu_ipi_send msg_id %x len %d fail %d", in vpu_enc_send_msg()
77 if (vpu->failure) in vpu_enc_send_msg()
80 mtk_vcodec_debug_leave(vpu); in vpu_enc_send_msg()
85 int vpu_enc_init(struct venc_vpu_inst *vpu) in vpu_enc_init() argument
90 mtk_vcodec_debug_enter(vpu); in vpu_enc_init()
92 init_waitqueue_head(&vpu->wq_hd); in vpu_enc_init()
93 vpu->signaled = 0; in vpu_enc_init()
94 vpu->failure = 0; in vpu_enc_init()
96 status = vpu_ipi_register(vpu->dev, vpu->id, vpu_enc_ipi_handler, in vpu_enc_init()
99 mtk_vcodec_err(vpu, "vpu_ipi_register fail %d", status); in vpu_enc_init()
105 out.venc_inst = (unsigned long)vpu; in vpu_enc_init()
106 if (vpu_enc_send_msg(vpu, &out, sizeof(out))) { in vpu_enc_init()
107 mtk_vcodec_err(vpu, "AP_IPIMSG_ENC_INIT fail"); in vpu_enc_init()
111 mtk_vcodec_debug_leave(vpu); in vpu_enc_init()
116 int vpu_enc_set_param(struct venc_vpu_inst *vpu, in vpu_enc_set_param() argument
122 mtk_vcodec_debug(vpu, "id %d ->", id); in vpu_enc_set_param()
126 out.vpu_inst_addr = vpu->inst_addr; in vpu_enc_set_param()
155 mtk_vcodec_err(vpu, "id %d not supported", id); in vpu_enc_set_param()
158 if (vpu_enc_send_msg(vpu, &out, sizeof(out))) { in vpu_enc_set_param()
159 mtk_vcodec_err(vpu, in vpu_enc_set_param()
164 mtk_vcodec_debug(vpu, "id %d <-", id); in vpu_enc_set_param()
169 int vpu_enc_encode(struct venc_vpu_inst *vpu, unsigned int bs_mode, in vpu_enc_encode() argument
176 mtk_vcodec_debug(vpu, "bs_mode %d ->", bs_mode); in vpu_enc_encode()
180 out.vpu_inst_addr = vpu->inst_addr; in vpu_enc_encode()
190 mtk_vcodec_err(vpu, "dma_addr not align to 16"); in vpu_enc_encode()
198 if (vpu_enc_send_msg(vpu, &out, sizeof(out))) { in vpu_enc_encode()
199 mtk_vcodec_err(vpu, "AP_IPIMSG_ENC_ENCODE %d fail", in vpu_enc_encode()
204 mtk_vcodec_debug(vpu, "bs_mode %d state %d size %d key_frm %d <-", in vpu_enc_encode()
205 bs_mode, vpu->state, vpu->bs_size, vpu->is_key_frm); in vpu_enc_encode()
210 int vpu_enc_deinit(struct venc_vpu_inst *vpu) in vpu_enc_deinit() argument
214 mtk_vcodec_debug_enter(vpu); in vpu_enc_deinit()
218 out.vpu_inst_addr = vpu->inst_addr; in vpu_enc_deinit()
219 if (vpu_enc_send_msg(vpu, &out, sizeof(out))) { in vpu_enc_deinit()
220 mtk_vcodec_err(vpu, "AP_IPIMSG_ENC_DEINIT fail"); in vpu_enc_deinit()
224 mtk_vcodec_debug_leave(vpu); in vpu_enc_deinit()