Lines Matching refs:ctx

727 static int s5p_mfc_ctx_ready(struct s5p_mfc_ctx *ctx)  in s5p_mfc_ctx_ready()  argument
730 ctx->src_queue_cnt, ctx->dst_queue_cnt, ctx->state); in s5p_mfc_ctx_ready()
732 if (ctx->state == MFCINST_GOT_INST && ctx->dst_queue_cnt >= 1) in s5p_mfc_ctx_ready()
735 if ((ctx->state == MFCINST_RUNNING || in s5p_mfc_ctx_ready()
736 ctx->state == MFCINST_HEAD_PRODUCED) && in s5p_mfc_ctx_ready()
737 ctx->src_queue_cnt >= 1 && ctx->dst_queue_cnt >= 1) in s5p_mfc_ctx_ready()
740 if (ctx->state == MFCINST_FINISHING && in s5p_mfc_ctx_ready()
741 ctx->dst_queue_cnt >= 1) in s5p_mfc_ctx_ready()
747 static void cleanup_ref_queue(struct s5p_mfc_ctx *ctx) in cleanup_ref_queue() argument
752 while (!list_empty(&ctx->ref_queue)) { in cleanup_ref_queue()
753 mb_entry = list_entry((&ctx->ref_queue)->next, in cleanup_ref_queue()
756 ctx->ref_queue_cnt--; in cleanup_ref_queue()
757 list_add_tail(&mb_entry->list, &ctx->src_queue); in cleanup_ref_queue()
758 ctx->src_queue_cnt++; in cleanup_ref_queue()
761 ctx->src_queue_cnt, ctx->ref_queue_cnt); in cleanup_ref_queue()
762 INIT_LIST_HEAD(&ctx->ref_queue); in cleanup_ref_queue()
763 ctx->ref_queue_cnt = 0; in cleanup_ref_queue()
766 static int enc_pre_seq_start(struct s5p_mfc_ctx *ctx) in enc_pre_seq_start() argument
768 struct s5p_mfc_dev *dev = ctx->dev; in enc_pre_seq_start()
775 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list); in enc_pre_seq_start()
778 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_stream_buffer, ctx, dst_addr, in enc_pre_seq_start()
784 static int enc_post_seq_start(struct s5p_mfc_ctx *ctx) in enc_post_seq_start() argument
786 struct s5p_mfc_dev *dev = ctx->dev; in enc_post_seq_start()
787 struct s5p_mfc_enc_params *p = &ctx->enc_params; in enc_post_seq_start()
794 if (!list_empty(&ctx->dst_queue)) { in enc_post_seq_start()
795 dst_mb = list_entry(ctx->dst_queue.next, in enc_post_seq_start()
798 ctx->dst_queue_cnt--; in enc_post_seq_start()
808 ctx->state = MFCINST_RUNNING; in enc_post_seq_start()
809 if (s5p_mfc_ctx_ready(ctx)) in enc_post_seq_start()
810 set_work_bit_irqsave(ctx); in enc_post_seq_start()
815 if (ctx->pb_count < enc_pb_count) in enc_post_seq_start()
816 ctx->pb_count = enc_pb_count; in enc_post_seq_start()
817 ctx->state = MFCINST_HEAD_PRODUCED; in enc_post_seq_start()
823 static int enc_pre_frame_start(struct s5p_mfc_ctx *ctx) in enc_pre_frame_start() argument
825 struct s5p_mfc_dev *dev = ctx->dev; in enc_pre_frame_start()
833 src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list); in enc_pre_frame_start()
836 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_frame_buffer, ctx, in enc_pre_frame_start()
841 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list); in enc_pre_frame_start()
844 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_stream_buffer, ctx, dst_addr, in enc_pre_frame_start()
851 static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) in enc_post_frame_start() argument
853 struct s5p_mfc_dev *dev = ctx->dev; in enc_post_frame_start()
869 s5p_mfc_hw_call_void(dev->mfc_ops, get_enc_frame_buffer, ctx, in enc_post_frame_start()
871 list_for_each_entry(mb_entry, &ctx->src_queue, list) { in enc_post_frame_start()
877 ctx->src_queue_cnt--; in enc_post_frame_start()
883 list_for_each_entry(mb_entry, &ctx->ref_queue, list) { in enc_post_frame_start()
889 ctx->ref_queue_cnt--; in enc_post_frame_start()
896 if ((ctx->src_queue_cnt > 0) && (ctx->state == MFCINST_RUNNING)) { in enc_post_frame_start()
897 mb_entry = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, in enc_post_frame_start()
901 ctx->src_queue_cnt--; in enc_post_frame_start()
902 list_add_tail(&mb_entry->list, &ctx->ref_queue); in enc_post_frame_start()
903 ctx->ref_queue_cnt++; in enc_post_frame_start()
906 ctx->src_queue_cnt, ctx->ref_queue_cnt); in enc_post_frame_start()
908 if ((ctx->dst_queue_cnt > 0) && (strm_size > 0)) { in enc_post_frame_start()
909 mb_entry = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, in enc_post_frame_start()
912 ctx->dst_queue_cnt--; in enc_post_frame_start()
928 if ((ctx->src_queue_cnt == 0) || (ctx->dst_queue_cnt == 0)) in enc_post_frame_start()
929 clear_work_bit(ctx); in enc_post_frame_start()
1000 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_g_fmt() local
1003 mfc_debug(2, "f->type = %d ctx->state = %d\n", f->type, ctx->state); in vidioc_g_fmt()
1009 pix_fmt_mp->pixelformat = ctx->dst_fmt->fourcc; in vidioc_g_fmt()
1010 pix_fmt_mp->num_planes = ctx->dst_fmt->num_planes; in vidioc_g_fmt()
1012 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->enc_dst_buf_size; in vidioc_g_fmt()
1013 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->enc_dst_buf_size; in vidioc_g_fmt()
1016 pix_fmt_mp->width = ctx->img_width; in vidioc_g_fmt()
1017 pix_fmt_mp->height = ctx->img_height; in vidioc_g_fmt()
1020 pix_fmt_mp->pixelformat = ctx->src_fmt->fourcc; in vidioc_g_fmt()
1021 pix_fmt_mp->num_planes = ctx->src_fmt->num_planes; in vidioc_g_fmt()
1023 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width; in vidioc_g_fmt()
1024 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size; in vidioc_g_fmt()
1025 pix_fmt_mp->plane_fmt[1].bytesperline = ctx->buf_width; in vidioc_g_fmt()
1026 pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size; in vidioc_g_fmt()
1085 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_s_fmt() local
1092 if (ctx->vq_src.streaming || ctx->vq_dst.streaming) { in vidioc_s_fmt()
1099 ctx->dst_fmt = find_format(f, MFC_FMT_ENC); in vidioc_s_fmt()
1100 ctx->state = MFCINST_INIT; in vidioc_s_fmt()
1101 ctx->codec_mode = ctx->dst_fmt->codec_mode; in vidioc_s_fmt()
1102 ctx->enc_dst_buf_size = pix_fmt_mp->plane_fmt[0].sizeimage; in vidioc_s_fmt()
1104 ctx->dst_bufs_cnt = 0; in vidioc_s_fmt()
1105 ctx->capture_state = QUEUE_FREE; in vidioc_s_fmt()
1106 ret = s5p_mfc_open_mfc_inst(dev, ctx); in vidioc_s_fmt()
1109 ctx->src_fmt = find_format(f, MFC_FMT_RAW); in vidioc_s_fmt()
1110 ctx->img_width = pix_fmt_mp->width; in vidioc_s_fmt()
1111 ctx->img_height = pix_fmt_mp->height; in vidioc_s_fmt()
1112 mfc_debug(2, "codec number: %d\n", ctx->src_fmt->codec_mode); in vidioc_s_fmt()
1115 ctx->img_width, ctx->img_height); in vidioc_s_fmt()
1117 s5p_mfc_hw_call_void(dev->mfc_ops, enc_calc_src_size, ctx); in vidioc_s_fmt()
1118 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size; in vidioc_s_fmt()
1119 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width; in vidioc_s_fmt()
1120 pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size; in vidioc_s_fmt()
1121 pix_fmt_mp->plane_fmt[1].bytesperline = ctx->buf_width; in vidioc_s_fmt()
1123 ctx->src_bufs_cnt = 0; in vidioc_s_fmt()
1124 ctx->output_state = QUEUE_FREE; in vidioc_s_fmt()
1138 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_reqbufs() local
1147 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); in vidioc_reqbufs()
1148 ctx->capture_state = QUEUE_FREE; in vidioc_reqbufs()
1151 if (ctx->capture_state != QUEUE_FREE) { in vidioc_reqbufs()
1153 ctx->capture_state); in vidioc_reqbufs()
1156 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); in vidioc_reqbufs()
1161 ctx->capture_state = QUEUE_BUFS_REQUESTED; in vidioc_reqbufs()
1163 ret = s5p_mfc_hw_call(ctx->dev->mfc_ops, in vidioc_reqbufs()
1164 alloc_codec_buffers, ctx); in vidioc_reqbufs()
1168 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); in vidioc_reqbufs()
1174 ret = vb2_reqbufs(&ctx->vq_src, reqbufs); in vidioc_reqbufs()
1176 ctx); in vidioc_reqbufs()
1177 ctx->output_state = QUEUE_FREE; in vidioc_reqbufs()
1180 if (ctx->output_state != QUEUE_FREE) { in vidioc_reqbufs()
1182 ctx->output_state); in vidioc_reqbufs()
1188 if (ctx->pb_count && in vidioc_reqbufs()
1189 (reqbufs->count < ctx->pb_count)) { in vidioc_reqbufs()
1190 reqbufs->count = ctx->pb_count; in vidioc_reqbufs()
1192 ctx->pb_count); in vidioc_reqbufs()
1194 ctx->pb_count = reqbufs->count; in vidioc_reqbufs()
1198 ret = vb2_reqbufs(&ctx->vq_src, reqbufs); in vidioc_reqbufs()
1203 ctx->output_state = QUEUE_BUFS_REQUESTED; in vidioc_reqbufs()
1214 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_querybuf() local
1222 if (ctx->state != MFCINST_GOT_INST) { in vidioc_querybuf()
1223 mfc_err("invalid context state: %d\n", ctx->state); in vidioc_querybuf()
1226 ret = vb2_querybuf(&ctx->vq_dst, buf); in vidioc_querybuf()
1233 ret = vb2_querybuf(&ctx->vq_src, buf); in vidioc_querybuf()
1248 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_qbuf() local
1250 if (ctx->state == MFCINST_ERROR) { in vidioc_qbuf()
1255 if (ctx->state == MFCINST_FINISHING) { in vidioc_qbuf()
1259 return vb2_qbuf(&ctx->vq_src, buf); in vidioc_qbuf()
1261 return vb2_qbuf(&ctx->vq_dst, buf); in vidioc_qbuf()
1272 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_dqbuf() local
1275 if (ctx->state == MFCINST_ERROR) { in vidioc_dqbuf()
1280 ret = vb2_dqbuf(&ctx->vq_src, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1282 ret = vb2_dqbuf(&ctx->vq_dst, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1283 if (ret == 0 && ctx->state == MFCINST_FINISHED in vidioc_dqbuf()
1284 && list_empty(&ctx->vq_dst.done_list)) in vidioc_dqbuf()
1285 v4l2_event_queue_fh(&ctx->fh, &ev); in vidioc_dqbuf()
1297 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_expbuf() local
1300 return vb2_expbuf(&ctx->vq_src, eb); in vidioc_expbuf()
1302 return vb2_expbuf(&ctx->vq_dst, eb); in vidioc_expbuf()
1310 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_streamon() local
1313 return vb2_streamon(&ctx->vq_src, type); in vidioc_streamon()
1315 return vb2_streamon(&ctx->vq_dst, type); in vidioc_streamon()
1323 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_streamoff() local
1326 return vb2_streamoff(&ctx->vq_src, type); in vidioc_streamoff()
1328 return vb2_streamoff(&ctx->vq_dst, type); in vidioc_streamoff()
1393 struct s5p_mfc_ctx *ctx = ctrl_to_ctx(ctrl); in s5p_mfc_enc_s_ctrl() local
1394 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_enc_s_ctrl()
1395 struct s5p_mfc_enc_params *p = &ctx->enc_params; in s5p_mfc_enc_s_ctrl()
1432 ctx->force_frame_type = ctrl->val; in s5p_mfc_enc_s_ctrl()
1648 struct s5p_mfc_ctx *ctx = ctrl_to_ctx(ctrl); in s5p_mfc_enc_g_v_ctrl() local
1649 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_enc_g_v_ctrl()
1653 if (ctx->state >= MFCINST_HEAD_PARSED && in s5p_mfc_enc_g_v_ctrl()
1654 ctx->state < MFCINST_ABORT) { in s5p_mfc_enc_g_v_ctrl()
1655 ctrl->val = ctx->pb_count; in s5p_mfc_enc_g_v_ctrl()
1657 } else if (ctx->state != MFCINST_INIT) { in s5p_mfc_enc_g_v_ctrl()
1662 s5p_mfc_wait_for_done_ctx(ctx, in s5p_mfc_enc_g_v_ctrl()
1664 if (ctx->state >= MFCINST_HEAD_PARSED && in s5p_mfc_enc_g_v_ctrl()
1665 ctx->state < MFCINST_ABORT) { in s5p_mfc_enc_g_v_ctrl()
1666 ctrl->val = ctx->pb_count; in s5p_mfc_enc_g_v_ctrl()
1684 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_s_parm() local
1687 ctx->enc_params.rc_framerate_num = in vidioc_s_parm()
1689 ctx->enc_params.rc_framerate_denom = in vidioc_s_parm()
1701 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_g_parm() local
1705 ctx->enc_params.rc_framerate_num; in vidioc_g_parm()
1707 ctx->enc_params.rc_framerate_denom; in vidioc_g_parm()
1718 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_encoder_cmd() local
1719 struct s5p_mfc_dev *dev = ctx->dev; in vidioc_encoder_cmd()
1728 if (!ctx->vq_src.streaming) in vidioc_encoder_cmd()
1732 if (list_empty(&ctx->src_queue)) { in vidioc_encoder_cmd()
1734 ctx->state = MFCINST_FINISHING; in vidioc_encoder_cmd()
1735 if (s5p_mfc_ctx_ready(ctx)) in vidioc_encoder_cmd()
1736 set_work_bit_irqsave(ctx); in vidioc_encoder_cmd()
1741 buf = list_entry(ctx->src_queue.prev, in vidioc_encoder_cmd()
1744 ctx->state = MFCINST_FINISHING; in vidioc_encoder_cmd()
1819 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_queue_setup() local
1820 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_queue_setup()
1822 if (ctx->state != MFCINST_GOT_INST) { in s5p_mfc_queue_setup()
1823 mfc_err("inavlid state: %d\n", ctx->state); in s5p_mfc_queue_setup()
1827 if (ctx->dst_fmt) in s5p_mfc_queue_setup()
1828 *plane_count = ctx->dst_fmt->num_planes; in s5p_mfc_queue_setup()
1835 psize[0] = ctx->enc_dst_buf_size; in s5p_mfc_queue_setup()
1836 allocators[0] = ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX]; in s5p_mfc_queue_setup()
1838 if (ctx->src_fmt) in s5p_mfc_queue_setup()
1839 *plane_count = ctx->src_fmt->num_planes; in s5p_mfc_queue_setup()
1848 psize[0] = ctx->luma_size; in s5p_mfc_queue_setup()
1849 psize[1] = ctx->chroma_size; in s5p_mfc_queue_setup()
1853 ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX]; in s5p_mfc_queue_setup()
1855 ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX]; in s5p_mfc_queue_setup()
1858 ctx->dev->alloc_ctx[MFC_BANK2_ALLOC_CTX]; in s5p_mfc_queue_setup()
1860 ctx->dev->alloc_ctx[MFC_BANK2_ALLOC_CTX]; in s5p_mfc_queue_setup()
1872 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_buf_init() local
1877 ret = check_vb_with_fmt(ctx->dst_fmt, vb); in s5p_mfc_buf_init()
1881 ctx->dst_bufs[i].b = vb; in s5p_mfc_buf_init()
1882 ctx->dst_bufs[i].cookie.stream = in s5p_mfc_buf_init()
1884 ctx->dst_bufs_cnt++; in s5p_mfc_buf_init()
1886 ret = check_vb_with_fmt(ctx->src_fmt, vb); in s5p_mfc_buf_init()
1890 ctx->src_bufs[i].b = vb; in s5p_mfc_buf_init()
1891 ctx->src_bufs[i].cookie.raw.luma = in s5p_mfc_buf_init()
1893 ctx->src_bufs[i].cookie.raw.chroma = in s5p_mfc_buf_init()
1895 ctx->src_bufs_cnt++; in s5p_mfc_buf_init()
1906 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_buf_prepare() local
1910 ret = check_vb_with_fmt(ctx->dst_fmt, vb); in s5p_mfc_buf_prepare()
1914 vb2_plane_size(vb, 0), ctx->enc_dst_buf_size); in s5p_mfc_buf_prepare()
1915 if (vb2_plane_size(vb, 0) < ctx->enc_dst_buf_size) { in s5p_mfc_buf_prepare()
1920 ret = check_vb_with_fmt(ctx->src_fmt, vb); in s5p_mfc_buf_prepare()
1924 vb2_plane_size(vb, 0), ctx->luma_size); in s5p_mfc_buf_prepare()
1926 vb2_plane_size(vb, 1), ctx->chroma_size); in s5p_mfc_buf_prepare()
1927 if (vb2_plane_size(vb, 0) < ctx->luma_size || in s5p_mfc_buf_prepare()
1928 vb2_plane_size(vb, 1) < ctx->chroma_size) { in s5p_mfc_buf_prepare()
1941 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); in s5p_mfc_start_streaming() local
1942 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_start_streaming()
1947 if ((ctx->state == MFCINST_GOT_INST) && in s5p_mfc_start_streaming()
1948 (dev->curr_ctx == ctx->num) && dev->hw_lock) { in s5p_mfc_start_streaming()
1949 s5p_mfc_wait_for_done_ctx(ctx, in s5p_mfc_start_streaming()
1954 if (ctx->src_bufs_cnt < ctx->pb_count) { in s5p_mfc_start_streaming()
1956 ctx->pb_count); in s5p_mfc_start_streaming()
1962 if (s5p_mfc_ctx_ready(ctx)) in s5p_mfc_start_streaming()
1963 set_work_bit_irqsave(ctx); in s5p_mfc_start_streaming()
1972 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); in s5p_mfc_stop_streaming() local
1973 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_stop_streaming()
1975 if ((ctx->state == MFCINST_FINISHING || in s5p_mfc_stop_streaming()
1976 ctx->state == MFCINST_RUNNING) && in s5p_mfc_stop_streaming()
1977 dev->curr_ctx == ctx->num && dev->hw_lock) { in s5p_mfc_stop_streaming()
1978 ctx->state = MFCINST_ABORT; in s5p_mfc_stop_streaming()
1979 s5p_mfc_wait_for_done_ctx(ctx, S5P_MFC_R2H_CMD_FRAME_DONE_RET, in s5p_mfc_stop_streaming()
1982 ctx->state = MFCINST_FINISHED; in s5p_mfc_stop_streaming()
1986 &ctx->dst_queue, &ctx->vq_dst); in s5p_mfc_stop_streaming()
1987 INIT_LIST_HEAD(&ctx->dst_queue); in s5p_mfc_stop_streaming()
1988 ctx->dst_queue_cnt = 0; in s5p_mfc_stop_streaming()
1991 cleanup_ref_queue(ctx); in s5p_mfc_stop_streaming()
1992 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, &ctx->src_queue, in s5p_mfc_stop_streaming()
1993 &ctx->vq_src); in s5p_mfc_stop_streaming()
1994 INIT_LIST_HEAD(&ctx->src_queue); in s5p_mfc_stop_streaming()
1995 ctx->src_queue_cnt = 0; in s5p_mfc_stop_streaming()
2003 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_buf_queue() local
2004 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_buf_queue()
2008 if (ctx->state == MFCINST_ERROR) { in s5p_mfc_buf_queue()
2010 cleanup_ref_queue(ctx); in s5p_mfc_buf_queue()
2014 mfc_buf = &ctx->dst_bufs[vb->v4l2_buf.index]; in s5p_mfc_buf_queue()
2018 list_add_tail(&mfc_buf->list, &ctx->dst_queue); in s5p_mfc_buf_queue()
2019 ctx->dst_queue_cnt++; in s5p_mfc_buf_queue()
2022 mfc_buf = &ctx->src_bufs[vb->v4l2_buf.index]; in s5p_mfc_buf_queue()
2025 list_add_tail(&mfc_buf->list, &ctx->src_queue); in s5p_mfc_buf_queue()
2026 ctx->src_queue_cnt++; in s5p_mfc_buf_queue()
2031 if (s5p_mfc_ctx_ready(ctx)) in s5p_mfc_buf_queue()
2032 set_work_bit_irqsave(ctx); in s5p_mfc_buf_queue()
2065 int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx) in s5p_mfc_enc_ctrls_setup() argument
2070 v4l2_ctrl_handler_init(&ctx->ctrl_handler, NUM_CTRLS); in s5p_mfc_enc_ctrls_setup()
2071 if (ctx->ctrl_handler.error) { in s5p_mfc_enc_ctrls_setup()
2073 return ctx->ctrl_handler.error; in s5p_mfc_enc_ctrls_setup()
2095 ctx->ctrls[i] = v4l2_ctrl_new_custom(&ctx->ctrl_handler, in s5p_mfc_enc_ctrls_setup()
2101 ctx->ctrls[i] = v4l2_ctrl_new_std_menu( in s5p_mfc_enc_ctrls_setup()
2102 &ctx->ctrl_handler, in s5p_mfc_enc_ctrls_setup()
2107 ctx->ctrls[i] = v4l2_ctrl_new_std( in s5p_mfc_enc_ctrls_setup()
2108 &ctx->ctrl_handler, in s5p_mfc_enc_ctrls_setup()
2115 if (ctx->ctrl_handler.error) { in s5p_mfc_enc_ctrls_setup()
2117 return ctx->ctrl_handler.error; in s5p_mfc_enc_ctrls_setup()
2119 if (controls[i].is_volatile && ctx->ctrls[i]) in s5p_mfc_enc_ctrls_setup()
2120 ctx->ctrls[i]->flags |= V4L2_CTRL_FLAG_VOLATILE; in s5p_mfc_enc_ctrls_setup()
2122 v4l2_ctrl_handler_setup(&ctx->ctrl_handler); in s5p_mfc_enc_ctrls_setup()
2126 void s5p_mfc_enc_ctrls_delete(struct s5p_mfc_ctx *ctx) in s5p_mfc_enc_ctrls_delete() argument
2130 v4l2_ctrl_handler_free(&ctx->ctrl_handler); in s5p_mfc_enc_ctrls_delete()
2132 ctx->ctrls[i] = NULL; in s5p_mfc_enc_ctrls_delete()
2135 void s5p_mfc_enc_init(struct s5p_mfc_ctx *ctx) in s5p_mfc_enc_init() argument
2139 ctx->src_fmt = find_format(&f, MFC_FMT_RAW); in s5p_mfc_enc_init()
2141 ctx->dst_fmt = find_format(&f, MFC_FMT_ENC); in s5p_mfc_enc_init()