Skip to content
Snippets Groups Projects
Commit 3d892656 authored by Nicolas Dufresne's avatar Nicolas Dufresne
Browse files

media: wave5: Cleanly fail on 10 bit bitstreams

Whenever the parser report a 10bit file, fails the start_streaming function so
that the application can cleanly fail this type of stream. 10bit is not
supported by the wave5 driver and the TI J721S2 board.
parent 2d9953f5
No related branches found
No related tags found
No related merge requests found
...@@ -1258,8 +1258,6 @@ static void wave5_vpu_dec_buf_queue_dst(struct vb2_buffer *vb) ...@@ -1258,8 +1258,6 @@ static void wave5_vpu_dec_buf_queue_dst(struct vb2_buffer *vb)
{ {
struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb); struct vb2_v4l2_buffer *vbuf = to_vb2_v4l2_buffer(vb);
struct vpu_instance *inst = vb2_get_drv_priv(vb->vb2_queue); struct vpu_instance *inst = vb2_get_drv_priv(vb->vb2_queue);
struct vpu_dst_buffer *vpu_buf = wave5_to_vpu_dst_buf(vbuf);
int ret = 0;
vbuf->sequence = inst->queued_dst_buf_num++; vbuf->sequence = inst->queued_dst_buf_num++;
...@@ -1325,6 +1323,7 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count ...@@ -1325,6 +1323,7 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count
{ {
struct vpu_instance *inst = vb2_get_drv_priv(q); struct vpu_instance *inst = vb2_get_drv_priv(q);
struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx; struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx;
struct vb2_v4l2_buffer *buf;
int ret = 0; int ret = 0;
dev_dbg(inst->dev->dev, "%s: type: %u\n", __func__, q->type); dev_dbg(inst->dev->dev, "%s: type: %u\n", __func__, q->type);
...@@ -1363,15 +1362,31 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count ...@@ -1363,15 +1362,31 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count
if (inst->thumbnail_mode) if (inst->thumbnail_mode)
wave5_vpu_dec_give_command(inst, ENABLE_DEC_THUMBNAIL_MODE, NULL); wave5_vpu_dec_give_command(inst, ENABLE_DEC_THUMBNAIL_MODE, NULL);
} else if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE && } else if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
inst->state == VPU_INST_STATE_STOP) { struct dec_initial_info *initial_info =
&inst->codec_info->dec_info.initial_info;
if (inst->state == VPU_INST_STATE_STOP)
ret = restore_state(inst); ret = restore_state(inst);
if (inst->state == VPU_INST_STATE_INIT_SEQ) {
if (initial_info->luma_bitdepth != 8) {
dev_info(inst->dev->dev, "%s: no support for %d bit depth",
__func__, initial_info->luma_bitdepth);
goto cleanup_dst_buffers;
}
}
} }
return ret; return ret;
free_bitstream_vbuf: free_bitstream_vbuf:
wave5_vdi_free_dma_memory(inst->dev, &inst->bitstream_vbuf); wave5_vdi_free_dma_memory(inst->dev, &inst->bitstream_vbuf);
return ret; cleanup_src_buffers:
while ((buf = v4l2_m2m_dst_buf_remove(m2m_ctx)))
v4l2_m2m_buf_done(buf, VB2_BUF_STATE_QUEUED);
return -EINVAL;
} }
static int streamoff_output(struct vb2_queue *q) static int streamoff_output(struct vb2_queue *q)
...@@ -1573,9 +1588,6 @@ static int initialize_sequence(struct vpu_instance *inst) ...@@ -1573,9 +1588,6 @@ static int initialize_sequence(struct vpu_instance *inst)
} else { } else {
u32 old_conf_win_width, old_conf_win_height; u32 old_conf_win_width, old_conf_win_height;
if (initial_info.luma_bitdepth != 8)
return -1;
dev_dbg(inst->dev->dev, "%s: rd_ptr %llu", __func__, initial_info.rd_ptr); dev_dbg(inst->dev->dev, "%s: rd_ptr %llu", __func__, initial_info.rd_ptr);
dev_dbg(inst->dev->dev, "%s: width: %u height: %u profile: %u | minbuffer: %u\n", dev_dbg(inst->dev->dev, "%s: width: %u height: %u profile: %u | minbuffer: %u\n",
...@@ -1607,10 +1619,6 @@ static int initialize_sequence(struct vpu_instance *inst) ...@@ -1607,10 +1619,6 @@ static int initialize_sequence(struct vpu_instance *inst)
inst->require_sequence_change = true; inst->require_sequence_change = true;
} }
/* TODO check if the bitdepth has changed, when 10 bit support
* is implemented
*/
handle_dynamic_resolution_change(inst); handle_dynamic_resolution_change(inst);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment