[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<SL2P216MB1246E9790DF5FE273D555768FB2C2@SL2P216MB1246.KORP216.PROD.OUTLOOK.COM>
Date: Tue, 19 Mar 2024 10:09:32 +0000
From: Nas Chung <nas.chung@...psnmedia.com>
To: Ivan Bornyakov <brnkv.i1@...il.com>
CC: Philipp Zabel <p.zabel@...gutronix.de>, Rob Herring <robh@...nel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>, Conor Dooley
<conor+dt@...nel.org>, "linux-media@...r.kernel.org"
<linux-media@...r.kernel.org>, "linux-kernel@...r.kernel.org"
<linux-kernel@...r.kernel.org>, "devicetree@...r.kernel.org"
<devicetree@...r.kernel.org>, jackson.lee <jackson.lee@...psnmedia.com>,
Mauro Carvalho Chehab <mchehab@...nel.org>
Subject: RE: [PATCH 1/6] media: chips-media: wave5: support decoding higher
bit-depth profiles
Hi, Ivan.
>-----Original Message-----
>From: Ivan Bornyakov <brnkv.i1@...il.com>
>Sent: Monday, March 18, 2024 11:42 PM
>To: Nas Chung <nas.chung@...psnmedia.com>; jackson.lee
><jackson.lee@...psnmedia.com>; Mauro Carvalho Chehab <mchehab@...nel.org>
>Cc: Ivan Bornyakov <brnkv.i1@...il.com>; Philipp Zabel
><p.zabel@...gutronix.de>; Rob Herring <robh@...nel.org>; Krzysztof
>Kozlowski <krzysztof.kozlowski+dt@...aro.org>; Conor Dooley
><conor+dt@...nel.org>; linux-media@...r.kernel.org; linux-
>kernel@...r.kernel.org; devicetree@...r.kernel.org
>Subject: [PATCH 1/6] media: chips-media: wave5: support decoding higher
>bit-depth profiles
>
>Add support for decoding higher than 8 bit-depth profiles by scaling FBC
>buffer stride and size by the factor of (bitdepth / 8).
>
>Signed-off-by: Ivan Bornyakov <brnkv.i1@...il.com>
>---
> .../platform/chips-media/wave5/wave5-vpu-dec.c | 15 ++-------------
> 1 file changed, 2 insertions(+), 13 deletions(-)
>
>diff --git a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
>b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
>index ef227af72348..aa0401f35d32 100644
>--- a/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
>+++ b/drivers/media/platform/chips-media/wave5/wave5-vpu-dec.c
>@@ -1055,6 +1055,7 @@ static int wave5_prepare_fb(struct vpu_instance
>*inst)
> int ret, i;
> struct v4l2_m2m_buffer *buf, *n;
> struct v4l2_m2m_ctx *m2m_ctx = inst->v4l2_fh.m2m_ctx;
>+ u32 bitdepth = inst->codec_info-
>>dec_info.initial_info.luma_bitdepth;
>
> linear_num = v4l2_m2m_num_dst_bufs_ready(m2m_ctx);
> non_linear_num = inst->fbc_buf_count;
>@@ -1063,7 +1064,7 @@ static int wave5_prepare_fb(struct vpu_instance
>*inst)
> struct frame_buffer *frame = &inst->frame_buf[i];
> struct vpu_buf *vframe = &inst->frame_vbuf[i];
>
>- fb_stride = inst->dst_fmt.width;
>+ fb_stride = ALIGN(inst->dst_fmt.width * bitdepth / 8, 32);
> fb_height = ALIGN(inst->dst_fmt.height, 32);
> luma_size = fb_stride * fb_height;
>
>@@ -1408,22 +1409,10 @@ 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) {
>- 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;
>- }
>- }
> }
>
TI wave521C version cannot support 10bit decoding.
So, We need above error checking codes.
How about adding support_10bit flag in wave5_match_data like below ?
static const struct wave5_match_data ti_wave521c_data = {
.support_10bit = false;
};
> return ret;
>--
>2.44.0
Powered by blists - more mailing lists