linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ivan Bornyakov <brnkv.i1@gmail.com>
To: Nas Chung <nas.chung@chipsnmedia.com>,
	Jackson Lee <jackson.lee@chipsnmedia.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: Ivan Bornyakov <brnkv.i1@gmail.com>,
	Philipp Zabel <p.zabel@pengutronix.de>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Conor Dooley <conor+dt@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	devicetree@vger.kernel.org
Subject: [PATCH 1/6] media: chips-media: wave5: support decoding higher bit-depth profiles
Date: Mon, 18 Mar 2024 17:42:16 +0300	[thread overview]
Message-ID: <20240318144225.30835-2-brnkv.i1@gmail.com> (raw)
In-Reply-To: <20240318144225.30835-1-brnkv.i1@gmail.com>

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@gmail.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;
-			}
-		}
 	}
 
 	return ret;
-- 
2.44.0


  reply	other threads:[~2024-03-18 14:43 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 14:42 [PATCH 0/6] Wave515 decoder IP support Ivan Bornyakov
2024-03-18 14:42 ` Ivan Bornyakov [this message]
2024-03-19 10:09   ` [PATCH 1/6] media: chips-media: wave5: support decoding higher bit-depth profiles Nas Chung
2024-03-18 14:42 ` [PATCH 2/6] media: chips-media: wave5: support reset lines Ivan Bornyakov
2024-03-18 14:50   ` Philipp Zabel
2024-03-18 14:42 ` [PATCH 3/6] dt-bindings: media: cnm,wave521c: drop resets restriction Ivan Bornyakov
2024-03-18 15:41   ` Krzysztof Kozlowski
2024-03-20 15:08   ` Rob Herring
2024-03-18 14:42 ` [PATCH 4/6] media: chips-media: wave5: separate irq setup routine Ivan Bornyakov
2024-03-18 14:42 ` [PATCH 5/6] media: chips-media: wave5: refine SRAM usage Ivan Bornyakov
2024-03-19 10:56   ` Nas Chung
2024-03-19 11:24     ` Ivan Bornyakov
2024-03-19 21:01       ` Brandon Brnich
2024-03-21  9:29         ` Nas Chung
2024-03-21 10:52           ` Ivan Bornyakov
2024-03-21 11:03             ` Ivan Bornyakov
2024-03-21 16:14             ` Brandon Brnich
2024-03-21 16:41               ` Ivan Bornyakov
2024-03-21 17:09                 ` Brandon Brnich
2024-03-18 14:42 ` [PATCH 6/6] media: chips-media: wave5: support Wave515 decoder Ivan Bornyakov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240318144225.30835-2-brnkv.i1@gmail.com \
    --to=brnkv.i1@gmail.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jackson.lee@chipsnmedia.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=nas.chung@chipsnmedia.com \
    --cc=p.zabel@pengutronix.de \
    --cc=robh@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).