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()
809 ctx->state = MFCINST_RUNNING; in enc_post_seq_start()
810 if (s5p_mfc_ctx_ready(ctx)) in enc_post_seq_start()
811 set_work_bit_irqsave(ctx); in enc_post_seq_start()
816 if (ctx->pb_count < enc_pb_count) in enc_post_seq_start()
817 ctx->pb_count = enc_pb_count; in enc_post_seq_start()
818 ctx->state = MFCINST_HEAD_PRODUCED; in enc_post_seq_start()
824 static int enc_pre_frame_start(struct s5p_mfc_ctx *ctx) in enc_pre_frame_start() argument
826 struct s5p_mfc_dev *dev = ctx->dev; in enc_pre_frame_start()
834 src_mb = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list); in enc_pre_frame_start()
837 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_frame_buffer, ctx, in enc_pre_frame_start()
842 dst_mb = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, list); in enc_pre_frame_start()
845 s5p_mfc_hw_call_void(dev->mfc_ops, set_enc_stream_buffer, ctx, dst_addr, in enc_pre_frame_start()
852 static int enc_post_frame_start(struct s5p_mfc_ctx *ctx) in enc_post_frame_start() argument
854 struct s5p_mfc_dev *dev = ctx->dev; in enc_post_frame_start()
870 s5p_mfc_hw_call_void(dev->mfc_ops, get_enc_frame_buffer, ctx, in enc_post_frame_start()
872 list_for_each_entry(mb_entry, &ctx->src_queue, list) { in enc_post_frame_start()
880 ctx->src_queue_cnt--; in enc_post_frame_start()
886 list_for_each_entry(mb_entry, &ctx->ref_queue, list) { in enc_post_frame_start()
894 ctx->ref_queue_cnt--; in enc_post_frame_start()
901 if ((ctx->src_queue_cnt > 0) && (ctx->state == MFCINST_RUNNING)) { in enc_post_frame_start()
902 mb_entry = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, in enc_post_frame_start()
906 ctx->src_queue_cnt--; in enc_post_frame_start()
907 list_add_tail(&mb_entry->list, &ctx->ref_queue); in enc_post_frame_start()
908 ctx->ref_queue_cnt++; in enc_post_frame_start()
912 ctx->src_queue_cnt, ctx->ref_queue_cnt); in enc_post_frame_start()
913 if ((ctx->dst_queue_cnt > 0) && (strm_size > 0)) { in enc_post_frame_start()
914 mb_entry = list_entry(ctx->dst_queue.next, struct s5p_mfc_buf, in enc_post_frame_start()
917 ctx->dst_queue_cnt--; in enc_post_frame_start()
933 if ((ctx->src_queue_cnt == 0) || (ctx->dst_queue_cnt == 0)) in enc_post_frame_start()
934 clear_work_bit(ctx); in enc_post_frame_start()
1006 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_g_fmt() local
1009 mfc_debug(2, "f->type = %d ctx->state = %d\n", f->type, ctx->state); in vidioc_g_fmt()
1015 pix_fmt_mp->pixelformat = ctx->dst_fmt->fourcc; in vidioc_g_fmt()
1016 pix_fmt_mp->num_planes = ctx->dst_fmt->num_planes; in vidioc_g_fmt()
1018 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->enc_dst_buf_size; in vidioc_g_fmt()
1019 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->enc_dst_buf_size; in vidioc_g_fmt()
1022 pix_fmt_mp->width = ctx->img_width; in vidioc_g_fmt()
1023 pix_fmt_mp->height = ctx->img_height; in vidioc_g_fmt()
1026 pix_fmt_mp->pixelformat = ctx->src_fmt->fourcc; in vidioc_g_fmt()
1027 pix_fmt_mp->num_planes = ctx->src_fmt->num_planes; in vidioc_g_fmt()
1029 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width; in vidioc_g_fmt()
1030 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size; in vidioc_g_fmt()
1031 pix_fmt_mp->plane_fmt[1].bytesperline = ctx->buf_width; in vidioc_g_fmt()
1032 pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size; in vidioc_g_fmt()
1091 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_s_fmt() local
1098 if (ctx->vq_src.streaming || ctx->vq_dst.streaming) { in vidioc_s_fmt()
1105 ctx->dst_fmt = find_format(f, MFC_FMT_ENC); in vidioc_s_fmt()
1106 ctx->state = MFCINST_INIT; in vidioc_s_fmt()
1107 ctx->codec_mode = ctx->dst_fmt->codec_mode; in vidioc_s_fmt()
1108 ctx->enc_dst_buf_size = pix_fmt_mp->plane_fmt[0].sizeimage; in vidioc_s_fmt()
1110 ctx->dst_bufs_cnt = 0; in vidioc_s_fmt()
1111 ctx->capture_state = QUEUE_FREE; in vidioc_s_fmt()
1112 ret = s5p_mfc_open_mfc_inst(dev, ctx); in vidioc_s_fmt()
1115 ctx->src_fmt = find_format(f, MFC_FMT_RAW); in vidioc_s_fmt()
1116 ctx->img_width = pix_fmt_mp->width; in vidioc_s_fmt()
1117 ctx->img_height = pix_fmt_mp->height; in vidioc_s_fmt()
1118 mfc_debug(2, "codec number: %d\n", ctx->src_fmt->codec_mode); in vidioc_s_fmt()
1121 ctx->img_width, ctx->img_height); in vidioc_s_fmt()
1123 s5p_mfc_hw_call_void(dev->mfc_ops, enc_calc_src_size, ctx); in vidioc_s_fmt()
1124 pix_fmt_mp->plane_fmt[0].sizeimage = ctx->luma_size; in vidioc_s_fmt()
1125 pix_fmt_mp->plane_fmt[0].bytesperline = ctx->buf_width; in vidioc_s_fmt()
1126 pix_fmt_mp->plane_fmt[1].sizeimage = ctx->chroma_size; in vidioc_s_fmt()
1127 pix_fmt_mp->plane_fmt[1].bytesperline = ctx->buf_width; in vidioc_s_fmt()
1129 ctx->src_bufs_cnt = 0; in vidioc_s_fmt()
1130 ctx->output_state = QUEUE_FREE; in vidioc_s_fmt()
1144 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_reqbufs() local
1153 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); in vidioc_reqbufs()
1154 ctx->capture_state = QUEUE_FREE; in vidioc_reqbufs()
1157 if (ctx->capture_state != QUEUE_FREE) { in vidioc_reqbufs()
1159 ctx->capture_state); in vidioc_reqbufs()
1162 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); in vidioc_reqbufs()
1167 ctx->capture_state = QUEUE_BUFS_REQUESTED; in vidioc_reqbufs()
1169 ret = s5p_mfc_hw_call(ctx->dev->mfc_ops, in vidioc_reqbufs()
1170 alloc_codec_buffers, ctx); in vidioc_reqbufs()
1174 ret = vb2_reqbufs(&ctx->vq_dst, reqbufs); in vidioc_reqbufs()
1180 ret = vb2_reqbufs(&ctx->vq_src, reqbufs); in vidioc_reqbufs()
1182 ctx); in vidioc_reqbufs()
1183 ctx->output_state = QUEUE_FREE; in vidioc_reqbufs()
1186 if (ctx->output_state != QUEUE_FREE) { in vidioc_reqbufs()
1188 ctx->output_state); in vidioc_reqbufs()
1194 if (ctx->pb_count && in vidioc_reqbufs()
1195 (reqbufs->count < ctx->pb_count)) { in vidioc_reqbufs()
1196 reqbufs->count = ctx->pb_count; in vidioc_reqbufs()
1198 ctx->pb_count); in vidioc_reqbufs()
1200 ctx->pb_count = reqbufs->count; in vidioc_reqbufs()
1204 ret = vb2_reqbufs(&ctx->vq_src, reqbufs); in vidioc_reqbufs()
1209 ctx->output_state = QUEUE_BUFS_REQUESTED; in vidioc_reqbufs()
1220 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_querybuf() local
1228 if (ctx->state != MFCINST_GOT_INST) { in vidioc_querybuf()
1229 mfc_err("invalid context state: %d\n", ctx->state); in vidioc_querybuf()
1232 ret = vb2_querybuf(&ctx->vq_dst, buf); in vidioc_querybuf()
1239 ret = vb2_querybuf(&ctx->vq_src, buf); in vidioc_querybuf()
1254 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_qbuf() local
1256 if (ctx->state == MFCINST_ERROR) { in vidioc_qbuf()
1261 if (ctx->state == MFCINST_FINISHING) { in vidioc_qbuf()
1265 return vb2_qbuf(&ctx->vq_src, buf); in vidioc_qbuf()
1267 return vb2_qbuf(&ctx->vq_dst, buf); in vidioc_qbuf()
1278 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_dqbuf() local
1281 if (ctx->state == MFCINST_ERROR) { in vidioc_dqbuf()
1286 ret = vb2_dqbuf(&ctx->vq_src, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1288 ret = vb2_dqbuf(&ctx->vq_dst, buf, file->f_flags & O_NONBLOCK); in vidioc_dqbuf()
1289 if (ret == 0 && ctx->state == MFCINST_FINISHED in vidioc_dqbuf()
1290 && list_empty(&ctx->vq_dst.done_list)) in vidioc_dqbuf()
1291 v4l2_event_queue_fh(&ctx->fh, &ev); in vidioc_dqbuf()
1303 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_expbuf() local
1306 return vb2_expbuf(&ctx->vq_src, eb); in vidioc_expbuf()
1308 return vb2_expbuf(&ctx->vq_dst, eb); in vidioc_expbuf()
1316 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_streamon() local
1319 return vb2_streamon(&ctx->vq_src, type); in vidioc_streamon()
1321 return vb2_streamon(&ctx->vq_dst, type); in vidioc_streamon()
1329 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_streamoff() local
1332 return vb2_streamoff(&ctx->vq_src, type); in vidioc_streamoff()
1334 return vb2_streamoff(&ctx->vq_dst, type); in vidioc_streamoff()
1399 struct s5p_mfc_ctx *ctx = ctrl_to_ctx(ctrl); in s5p_mfc_enc_s_ctrl() local
1400 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_enc_s_ctrl()
1401 struct s5p_mfc_enc_params *p = &ctx->enc_params; in s5p_mfc_enc_s_ctrl()
1438 ctx->force_frame_type = ctrl->val; in s5p_mfc_enc_s_ctrl()
1654 struct s5p_mfc_ctx *ctx = ctrl_to_ctx(ctrl); in s5p_mfc_enc_g_v_ctrl() local
1655 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_enc_g_v_ctrl()
1659 if (ctx->state >= MFCINST_HEAD_PARSED && in s5p_mfc_enc_g_v_ctrl()
1660 ctx->state < MFCINST_ABORT) { in s5p_mfc_enc_g_v_ctrl()
1661 ctrl->val = ctx->pb_count; in s5p_mfc_enc_g_v_ctrl()
1663 } else if (ctx->state != MFCINST_INIT) { in s5p_mfc_enc_g_v_ctrl()
1668 s5p_mfc_wait_for_done_ctx(ctx, in s5p_mfc_enc_g_v_ctrl()
1670 if (ctx->state >= MFCINST_HEAD_PARSED && in s5p_mfc_enc_g_v_ctrl()
1671 ctx->state < MFCINST_ABORT) { in s5p_mfc_enc_g_v_ctrl()
1672 ctrl->val = ctx->pb_count; in s5p_mfc_enc_g_v_ctrl()
1690 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_s_parm() local
1693 ctx->enc_params.rc_framerate_num = in vidioc_s_parm()
1695 ctx->enc_params.rc_framerate_denom = in vidioc_s_parm()
1707 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_g_parm() local
1711 ctx->enc_params.rc_framerate_num; in vidioc_g_parm()
1713 ctx->enc_params.rc_framerate_denom; in vidioc_g_parm()
1724 struct s5p_mfc_ctx *ctx = fh_to_ctx(priv); in vidioc_encoder_cmd() local
1725 struct s5p_mfc_dev *dev = ctx->dev; in vidioc_encoder_cmd()
1734 if (!ctx->vq_src.streaming) in vidioc_encoder_cmd()
1738 if (list_empty(&ctx->src_queue)) { in vidioc_encoder_cmd()
1740 ctx->state = MFCINST_FINISHING; in vidioc_encoder_cmd()
1741 if (s5p_mfc_ctx_ready(ctx)) in vidioc_encoder_cmd()
1742 set_work_bit_irqsave(ctx); in vidioc_encoder_cmd()
1747 buf = list_entry(ctx->src_queue.prev, in vidioc_encoder_cmd()
1750 ctx->state = MFCINST_FINISHING; in vidioc_encoder_cmd()
1825 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_queue_setup() local
1826 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_queue_setup()
1829 if (ctx->state != MFCINST_GOT_INST) { in s5p_mfc_queue_setup()
1830 mfc_err("invalid state: %d\n", ctx->state); in s5p_mfc_queue_setup()
1834 if (ctx->dst_fmt) in s5p_mfc_queue_setup()
1835 *plane_count = ctx->dst_fmt->num_planes; in s5p_mfc_queue_setup()
1842 psize[0] = ctx->enc_dst_buf_size; in s5p_mfc_queue_setup()
1843 allocators[0] = ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX]; in s5p_mfc_queue_setup()
1845 if (ctx->src_fmt) in s5p_mfc_queue_setup()
1846 *plane_count = ctx->src_fmt->num_planes; in s5p_mfc_queue_setup()
1855 psize[0] = ctx->luma_size; in s5p_mfc_queue_setup()
1856 psize[1] = ctx->chroma_size; in s5p_mfc_queue_setup()
1860 ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX]; in s5p_mfc_queue_setup()
1862 ctx->dev->alloc_ctx[MFC_BANK1_ALLOC_CTX]; in s5p_mfc_queue_setup()
1865 ctx->dev->alloc_ctx[MFC_BANK2_ALLOC_CTX]; in s5p_mfc_queue_setup()
1867 ctx->dev->alloc_ctx[MFC_BANK2_ALLOC_CTX]; in s5p_mfc_queue_setup()
1880 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_buf_init() local
1885 ret = check_vb_with_fmt(ctx->dst_fmt, vb); in s5p_mfc_buf_init()
1889 ctx->dst_bufs[i].b = vbuf; in s5p_mfc_buf_init()
1890 ctx->dst_bufs[i].cookie.stream = in s5p_mfc_buf_init()
1892 ctx->dst_bufs_cnt++; in s5p_mfc_buf_init()
1894 ret = check_vb_with_fmt(ctx->src_fmt, vb); in s5p_mfc_buf_init()
1898 ctx->src_bufs[i].b = vbuf; in s5p_mfc_buf_init()
1899 ctx->src_bufs[i].cookie.raw.luma = in s5p_mfc_buf_init()
1901 ctx->src_bufs[i].cookie.raw.chroma = in s5p_mfc_buf_init()
1903 ctx->src_bufs_cnt++; in s5p_mfc_buf_init()
1914 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_buf_prepare() local
1918 ret = check_vb_with_fmt(ctx->dst_fmt, vb); in s5p_mfc_buf_prepare()
1922 vb2_plane_size(vb, 0), ctx->enc_dst_buf_size); in s5p_mfc_buf_prepare()
1923 if (vb2_plane_size(vb, 0) < ctx->enc_dst_buf_size) { in s5p_mfc_buf_prepare()
1928 ret = check_vb_with_fmt(ctx->src_fmt, vb); in s5p_mfc_buf_prepare()
1932 vb2_plane_size(vb, 0), ctx->luma_size); in s5p_mfc_buf_prepare()
1934 vb2_plane_size(vb, 1), ctx->chroma_size); in s5p_mfc_buf_prepare()
1935 if (vb2_plane_size(vb, 0) < ctx->luma_size || in s5p_mfc_buf_prepare()
1936 vb2_plane_size(vb, 1) < ctx->chroma_size) { in s5p_mfc_buf_prepare()
1949 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); in s5p_mfc_start_streaming() local
1950 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_start_streaming()
1955 if ((ctx->state == MFCINST_GOT_INST) && in s5p_mfc_start_streaming()
1956 (dev->curr_ctx == ctx->num) && dev->hw_lock) { in s5p_mfc_start_streaming()
1957 s5p_mfc_wait_for_done_ctx(ctx, in s5p_mfc_start_streaming()
1962 if (ctx->src_bufs_cnt < ctx->pb_count) { in s5p_mfc_start_streaming()
1964 ctx->pb_count); in s5p_mfc_start_streaming()
1970 if (s5p_mfc_ctx_ready(ctx)) in s5p_mfc_start_streaming()
1971 set_work_bit_irqsave(ctx); in s5p_mfc_start_streaming()
1980 struct s5p_mfc_ctx *ctx = fh_to_ctx(q->drv_priv); in s5p_mfc_stop_streaming() local
1981 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_stop_streaming()
1983 if ((ctx->state == MFCINST_FINISHING || in s5p_mfc_stop_streaming()
1984 ctx->state == MFCINST_RUNNING) && in s5p_mfc_stop_streaming()
1985 dev->curr_ctx == ctx->num && dev->hw_lock) { in s5p_mfc_stop_streaming()
1986 ctx->state = MFCINST_ABORT; in s5p_mfc_stop_streaming()
1987 s5p_mfc_wait_for_done_ctx(ctx, S5P_MFC_R2H_CMD_FRAME_DONE_RET, in s5p_mfc_stop_streaming()
1990 ctx->state = MFCINST_FINISHED; in s5p_mfc_stop_streaming()
1994 &ctx->dst_queue, &ctx->vq_dst); in s5p_mfc_stop_streaming()
1995 INIT_LIST_HEAD(&ctx->dst_queue); in s5p_mfc_stop_streaming()
1996 ctx->dst_queue_cnt = 0; in s5p_mfc_stop_streaming()
1999 cleanup_ref_queue(ctx); in s5p_mfc_stop_streaming()
2000 s5p_mfc_hw_call_void(dev->mfc_ops, cleanup_queue, &ctx->src_queue, in s5p_mfc_stop_streaming()
2001 &ctx->vq_src); in s5p_mfc_stop_streaming()
2002 INIT_LIST_HEAD(&ctx->src_queue); in s5p_mfc_stop_streaming()
2003 ctx->src_queue_cnt = 0; in s5p_mfc_stop_streaming()
2011 struct s5p_mfc_ctx *ctx = fh_to_ctx(vq->drv_priv); in s5p_mfc_buf_queue() local
2012 struct s5p_mfc_dev *dev = ctx->dev; in s5p_mfc_buf_queue()
2016 if (ctx->state == MFCINST_ERROR) { in s5p_mfc_buf_queue()
2018 cleanup_ref_queue(ctx); in s5p_mfc_buf_queue()
2022 mfc_buf = &ctx->dst_bufs[vb->index]; in s5p_mfc_buf_queue()
2026 list_add_tail(&mfc_buf->list, &ctx->dst_queue); in s5p_mfc_buf_queue()
2027 ctx->dst_queue_cnt++; in s5p_mfc_buf_queue()
2030 mfc_buf = &ctx->src_bufs[vb->index]; in s5p_mfc_buf_queue()
2033 list_add_tail(&mfc_buf->list, &ctx->src_queue); in s5p_mfc_buf_queue()
2034 ctx->src_queue_cnt++; in s5p_mfc_buf_queue()
2039 if (s5p_mfc_ctx_ready(ctx)) in s5p_mfc_buf_queue()
2040 set_work_bit_irqsave(ctx); in s5p_mfc_buf_queue()
2073 int s5p_mfc_enc_ctrls_setup(struct s5p_mfc_ctx *ctx) in s5p_mfc_enc_ctrls_setup() argument
2078 v4l2_ctrl_handler_init(&ctx->ctrl_handler, NUM_CTRLS); in s5p_mfc_enc_ctrls_setup()
2079 if (ctx->ctrl_handler.error) { in s5p_mfc_enc_ctrls_setup()
2081 return ctx->ctrl_handler.error; in s5p_mfc_enc_ctrls_setup()
2103 ctx->ctrls[i] = v4l2_ctrl_new_custom(&ctx->ctrl_handler, in s5p_mfc_enc_ctrls_setup()
2109 ctx->ctrls[i] = v4l2_ctrl_new_std_menu( in s5p_mfc_enc_ctrls_setup()
2110 &ctx->ctrl_handler, in s5p_mfc_enc_ctrls_setup()
2115 ctx->ctrls[i] = v4l2_ctrl_new_std( in s5p_mfc_enc_ctrls_setup()
2116 &ctx->ctrl_handler, in s5p_mfc_enc_ctrls_setup()
2123 if (ctx->ctrl_handler.error) { in s5p_mfc_enc_ctrls_setup()
2125 return ctx->ctrl_handler.error; in s5p_mfc_enc_ctrls_setup()
2127 if (controls[i].is_volatile && ctx->ctrls[i]) in s5p_mfc_enc_ctrls_setup()
2128 ctx->ctrls[i]->flags |= V4L2_CTRL_FLAG_VOLATILE; in s5p_mfc_enc_ctrls_setup()
2130 v4l2_ctrl_handler_setup(&ctx->ctrl_handler); in s5p_mfc_enc_ctrls_setup()
2134 void s5p_mfc_enc_ctrls_delete(struct s5p_mfc_ctx *ctx) in s5p_mfc_enc_ctrls_delete() argument
2138 v4l2_ctrl_handler_free(&ctx->ctrl_handler); in s5p_mfc_enc_ctrls_delete()
2140 ctx->ctrls[i] = NULL; in s5p_mfc_enc_ctrls_delete()
2143 void s5p_mfc_enc_init(struct s5p_mfc_ctx *ctx) in s5p_mfc_enc_init() argument
2147 ctx->src_fmt = find_format(&f, MFC_FMT_RAW); in s5p_mfc_enc_init()
2149 ctx->dst_fmt = find_format(&f, MFC_FMT_ENC); in s5p_mfc_enc_init()