Lines Matching refs:pctx
415 static int hva_h264_fill_slice_header(struct hva_ctx *pctx, in hva_h264_fill_slice_header() argument
429 struct device *dev = ctx_to_dev(pctx); in hva_h264_fill_slice_header()
484 pctx->name, __func__, frame_order, idr_pic_id, *header_size); in hva_h264_fill_slice_header()
488 static int hva_h264_fill_data_nal(struct hva_ctx *pctx, in hva_h264_fill_data_nal() argument
492 struct device *dev = ctx_to_dev(pctx); in hva_h264_fill_data_nal()
495 dev_dbg(dev, "%s %s stuffing bytes %d\n", pctx->name, __func__, in hva_h264_fill_data_nal()
500 pctx->name, __func__, stuffing_bytes); in hva_h264_fill_data_nal()
521 static int hva_h264_fill_sei_nal(struct hva_ctx *pctx, in hva_h264_fill_sei_nal() argument
525 struct device *dev = ctx_to_dev(pctx); in hva_h264_fill_sei_nal()
582 pctx->name, type); in hva_h264_fill_sei_nal()
587 static int hva_h264_prepare_task(struct hva_ctx *pctx, in hva_h264_prepare_task() argument
592 struct hva_dev *hva = ctx_to_hdev(pctx); in hva_h264_prepare_task()
593 struct device *dev = ctx_to_dev(pctx); in hva_h264_prepare_task()
594 struct hva_h264_ctx *ctx = (struct hva_h264_ctx *)pctx->priv; in hva_h264_prepare_task()
599 struct hva_controls *ctrls = &pctx->ctrls; in hva_h264_prepare_task()
600 struct v4l2_fract *time_per_frame = &pctx->ctrls.time_per_frame; in hva_h264_prepare_task()
602 u32 frame_num = pctx->stream_num; in hva_h264_prepare_task()
618 pctx->name, frame_width, frame_height, in hva_h264_prepare_task()
620 pctx->frame_errors++; in hva_h264_prepare_task()
688 pctx->name, td->bit_rate, max_bitrate); in hva_h264_prepare_task()
707 pctx->name, td->cpb_buffer_size, max_cpb_buffer_size); in hva_h264_prepare_task()
730 pctx->name); in hva_h264_prepare_task()
731 pctx->frame_errors++; in hva_h264_prepare_task()
755 dev_err(dev, "%s invalid framerate\n", pctx->name); in hva_h264_prepare_task()
756 pctx->frame_errors++; in hva_h264_prepare_task()
828 hva_h264_fill_slice_header(pctx, slice_header_vaddr, ctrls, frame_num, in hva_h264_prepare_task()
845 dev_err(dev, "%s invalid sps/pps size %d\n", pctx->name, in hva_h264_prepare_task()
847 pctx->frame_errors++; in hva_h264_prepare_task()
855 if (ctrls->sei_fp && hva_h264_fill_sei_nal(pctx, SEI_STEREO_VIDEO_INFO, in hva_h264_prepare_task()
858 dev_err(dev, "%s fail to get SEI nal\n", pctx->name); in hva_h264_prepare_task()
859 pctx->frame_errors++; in hva_h264_prepare_task()
889 static int hva_h264_open(struct hva_ctx *pctx) in hva_h264_open() argument
891 struct device *dev = ctx_to_dev(pctx); in hva_h264_open()
893 struct hva_dev *hva = ctx_to_hdev(pctx); in hva_h264_open()
894 u32 frame_width = pctx->frameinfo.aligned_width; in hva_h264_open()
895 u32 frame_height = pctx->frameinfo.aligned_height; in hva_h264_open()
907 pctx->name, hva->esram_size, size); in hva_h264_open()
920 ret = hva_mem_alloc(pctx, in hva_h264_open()
929 pctx->name); in hva_h264_open()
934 ret = hva_mem_alloc(pctx, in hva_h264_open()
940 pctx->name); in hva_h264_open()
945 ret = hva_mem_alloc(pctx, in hva_h264_open()
952 pctx->name); in hva_h264_open()
957 ret = hva_mem_alloc(pctx, in hva_h264_open()
964 pctx->name); in hva_h264_open()
968 pctx->priv = (void *)ctx; in hva_h264_open()
973 hva_mem_free(pctx, ctx->rec_frame); in hva_h264_open()
975 hva_mem_free(pctx, ctx->ref_frame); in hva_h264_open()
977 hva_mem_free(pctx, ctx->seq_info); in hva_h264_open()
981 pctx->sys_errors++; in hva_h264_open()
985 static int hva_h264_close(struct hva_ctx *pctx) in hva_h264_close() argument
987 struct hva_h264_ctx *ctx = (struct hva_h264_ctx *)pctx->priv; in hva_h264_close()
988 struct device *dev = ctx_to_dev(pctx); in hva_h264_close()
991 hva_mem_free(pctx, ctx->seq_info); in hva_h264_close()
994 hva_mem_free(pctx, ctx->ref_frame); in hva_h264_close()
997 hva_mem_free(pctx, ctx->rec_frame); in hva_h264_close()
1000 hva_mem_free(pctx, ctx->task); in hva_h264_close()
1007 static int hva_h264_encode(struct hva_ctx *pctx, struct hva_frame *frame, in hva_h264_encode() argument
1010 struct hva_h264_ctx *ctx = (struct hva_h264_ctx *)pctx->priv; in hva_h264_encode()
1015 ret = hva_h264_prepare_task(pctx, task, frame, stream); in hva_h264_encode()
1019 ret = hva_hw_execute_task(pctx, H264_ENC, ctx->task); in hva_h264_encode()
1023 pctx->stream_num++; in hva_h264_encode()
1029 hva_h264_fill_data_nal(pctx, stuffing_bytes, in hva_h264_encode()