diff options
Diffstat (limited to 'drivers/media/platform/s5p-mfc/s5p_mfc.c')
| -rw-r--r-- | drivers/media/platform/s5p-mfc/s5p_mfc.c | 21 | 
1 files changed, 12 insertions, 9 deletions
diff --git a/drivers/media/platform/s5p-mfc/s5p_mfc.c b/drivers/media/platform/s5p-mfc/s5p_mfc.c index e84703c314c..01f9ae0dadb 100644 --- a/drivers/media/platform/s5p-mfc/s5p_mfc.c +++ b/drivers/media/platform/s5p-mfc/s5p_mfc.c @@ -243,12 +243,10 @@ static void s5p_mfc_handle_frame_copy_time(struct s5p_mfc_ctx *ctx)  	src_buf = list_entry(ctx->src_queue.next, struct s5p_mfc_buf, list);  	list_for_each_entry(dst_buf, &ctx->dst_queue, list) {  		if (vb2_dma_contig_plane_dma_addr(dst_buf->b, 0) == dec_y_addr) { -			memcpy(&dst_buf->b->v4l2_buf.timecode, -				&src_buf->b->v4l2_buf.timecode, -				sizeof(struct v4l2_timecode)); -			memcpy(&dst_buf->b->v4l2_buf.timestamp, -				&src_buf->b->v4l2_buf.timestamp, -				sizeof(struct timeval)); +			dst_buf->b->v4l2_buf.timecode = +						src_buf->b->v4l2_buf.timecode; +			dst_buf->b->v4l2_buf.timestamp = +						src_buf->b->v4l2_buf.timestamp;  			switch (frame_type) {  			case S5P_FIMV_DECODE_FRAME_I_FRAME:  				dst_buf->b->v4l2_buf.flags |= @@ -276,7 +274,7 @@ static void s5p_mfc_handle_frame_new(struct s5p_mfc_ctx *ctx, unsigned int err)  	unsigned int frame_type;  	dspl_y_addr = s5p_mfc_hw_call(dev->mfc_ops, get_dspl_y_adr, dev); -	frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_dec_frame_type, dev); +	frame_type = s5p_mfc_hw_call(dev->mfc_ops, get_disp_frame_type, ctx);  	/* If frame is same as previous then skip and do not dequeue */  	if (frame_type == S5P_FIMV_DECODE_FRAME_SKIPPED) { @@ -386,6 +384,8 @@ static void s5p_mfc_handle_frame(struct s5p_mfc_ctx *ctx,  		} else {  			mfc_debug(2, "MFC needs next buffer\n");  			ctx->consumed_stream = 0; +			if (src_buf->flags & MFC_BUF_FLAG_EOS) +				ctx->state = MFCINST_FINISHING;  			list_del(&src_buf->list);  			ctx->src_queue_cnt--;  			if (s5p_mfc_hw_call(dev->mfc_ops, err_dec, err) > 0) @@ -804,6 +804,7 @@ static int s5p_mfc_open(struct file *file)  		goto err_queue_init;  	}  	q->mem_ops = (struct vb2_mem_ops *)&vb2_dma_contig_memops; +	q->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY;  	ret = vb2_queue_init(q);  	if (ret) {  		mfc_err("Failed to initialize videobuf2 queue(capture)\n"); @@ -825,6 +826,7 @@ static int s5p_mfc_open(struct file *file)  		goto err_queue_init;  	}  	q->mem_ops = (struct vb2_mem_ops *)&vb2_dma_contig_memops; +	q->timestamp_type = V4L2_BUF_FLAG_TIMESTAMP_COPY;  	ret = vb2_queue_init(q);  	if (ret) {  		mfc_err("Failed to initialize videobuf2 queue(output)\n"); @@ -1016,7 +1018,7 @@ static void *mfc_get_drv_data(struct platform_device *pdev);  static int s5p_mfc_alloc_memdevs(struct s5p_mfc_dev *dev)  { -	unsigned int mem_info[2]; +	unsigned int mem_info[2] = { };  	dev->mem_dev_l = devm_kzalloc(&dev->plat_dev->dev,  			sizeof(struct device), GFP_KERNEL); @@ -1106,7 +1108,8 @@ static int s5p_mfc_probe(struct platform_device *pdev)  	}  	if (pdev->dev.of_node) { -		if (s5p_mfc_alloc_memdevs(dev) < 0) +		ret = s5p_mfc_alloc_memdevs(dev); +		if (ret < 0)  			goto err_res;  	} else {  		dev->mem_dev_l = device_find_child(&dev->plat_dev->dev,  |