]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: chips-media: wave5: Fix timeout while testing 10bit hevc fluster
authorJackson.lee <jackson.lee@chipsnmedia.com>
Tue, 17 Dec 2024 04:51:25 +0000 (13:51 +0900)
committerHans Verkuil <hverkuil@xs4all.nl>
Sat, 15 Feb 2025 10:18:43 +0000 (11:18 +0100)
The Wave5 521C variant does not support 10 bit decoding. When 10 bit
decoding support was added for the 515 variant, a section of the code
was removed which returned an error. This removal causes a timeout for
the 521 variant, which was discovered during HEVC 10-bit decoding tests.

Fixes: 143e7ab4d9a0 ("media: chips-media: wave5: support decoding HEVC Main10 profile")
Cc: stable@vger.kernel.org
Signed-off-by: Jackson.lee <jackson.lee@chipsnmedia.com>
Signed-off-by: Nas Chung <nas.chung@chipsnmedia.com>
Reviewed-by: Nicolas Dufresne <nicolas.dufresne@collabora.com>
Signed-off-by: Sebastian Fricke <sebastian.fricke@collabora.com>
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c

index 882d5539630f70764c2853dfa338a7fa7a1e8dc3..fd71f0c43ac37a0bb56f669d4b89d6054cb181d5 100644 (file)
@@ -1345,10 +1345,24 @@ static int wave5_vpu_dec_start_streaming(struct vb2_queue *q, unsigned int count
                if (ret)
                        goto free_bitstream_vbuf;
        } else if (q->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
+               struct dec_initial_info *initial_info =
+                       &inst->codec_info->dec_info.initial_info;
+
                if (inst->state == VPU_INST_STATE_STOP)
                        ret = switch_state(inst, VPU_INST_STATE_INIT_SEQ);
                if (ret)
                        goto return_buffers;
+
+               if (inst->state == VPU_INST_STATE_INIT_SEQ &&
+                   inst->dev->product_code == WAVE521C_CODE) {
+                       if (initial_info->luma_bitdepth != 8) {
+                               dev_info(inst->dev->dev, "%s: no support for %d bit depth",
+                                        __func__, initial_info->luma_bitdepth);
+                               ret = -EINVAL;
+                               goto return_buffers;
+                       }
+               }
+
        }
        pm_runtime_mark_last_busy(inst->dev->dev);
        pm_runtime_put_autosuspend(inst->dev->dev);