From: Vikash Garodia <vikash.garodia@oss.qualcomm.com>
To: Neil Armstrong <neil.armstrong@linaro.org>,
Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
Abhinav Kumar <abhinav.kumar@linux.dev>,
Bryan O'Donoghue <bod@kernel.org>,
Mauro Carvalho Chehab <mchehab@kernel.org>
Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats
Date: Wed, 20 May 2026 21:25:54 +0530 [thread overview]
Message-ID: <ce10baa3-bd63-472d-b5c9-248bb1a01731@oss.qualcomm.com> (raw)
In-Reply-To: <fcf5054d-66da-4f9f-88f1-e49692557319@linaro.org>
On 5/18/2026 1:03 PM, Neil Armstrong wrote:
> On 5/13/26 21:05, Vikash Garodia wrote:
>>
>>
>> On 5/11/2026 2:50 PM, Neil Armstrong wrote:
>>> Update the gen2 response and vdec s_fmt code to take in account
>>> the P010 and QC010 when calculating the width, height and stride.
>>>
>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>> ---
>>> .../platform/qcom/iris/iris_hfi_gen2_response.c | 21 +++++++++++
>>> +++++---
>>> drivers/media/platform/qcom/iris/iris_vdec.c | 24 +++++++++++
>>> ++++++++---
>>> 2 files changed, 39 insertions(+), 6 deletions(-)
>>>
>>> diff --git a/drivers/media/platform/qcom/iris/
>>> iris_hfi_gen2_response.c b/drivers/media/platform/qcom/iris/
>>> iris_hfi_gen2_response.c
>>> index 8e19f61bbbf9..0541e02d7507 100644
>>> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
>>> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c
>>> @@ -542,9 +542,24 @@ static void
>>> iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst)
>>> pixmp_ip->width = width;
>>> pixmp_ip->height = height;
>>> - pixmp_op->width = ALIGN(width, 128);
>>> - pixmp_op->height = ALIGN(height, 32);
>>> - pixmp_op->plane_fmt[0].bytesperline = ALIGN(width, 128);
>>> + switch (pixmp_op->pixelformat) {
>>> + case V4L2_PIX_FMT_P010:
>>> + pixmp_op->width = ALIGN(width, 128);
>>> + pixmp_op->height = ALIGN(height, 32);
>>> + pixmp_op->plane_fmt[0].bytesperline = ALIGN(width * 2, 256);
>>> + break;
>>> + case V4L2_PIX_FMT_QC10C:
>>> + pixmp_op->width = roundup(width, 192);
>>> + pixmp_op->height = ALIGN(height, 16);
>>> + pixmp_op->plane_fmt[0].bytesperline = ALIGN(pixmp_op->width
>>> * 4 / 3, 256);
>>> + break;
>>> + case V4L2_PIX_FMT_NV12:
>>> + case V4L2_PIX_FMT_QC08C:
>>> + pixmp_op->width = ALIGN(width, 128);
>>> + pixmp_op->height = ALIGN(height, 32);
>>> + pixmp_op->plane_fmt[0].bytesperline = pixmp_op->width;
>>> + break;
>>
>> client facing api, good to have a default here
>>
>>> + }
>>> pixmp_op->plane_fmt[0].sizeimage = iris_get_buffer_size(inst,
>>> BUF_OUTPUT);
>>> matrix_coeff = subsc_params.color_info & 0xFF;
>>> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/
>>> media/platform/qcom/iris/iris_vdec.c
>>> index 99d544e2af4f..eea69f937147 100644
>>> --- a/drivers/media/platform/qcom/iris/iris_vdec.c
>>> +++ b/drivers/media/platform/qcom/iris/iris_vdec.c
>>> @@ -266,10 +266,28 @@ int iris_vdec_s_fmt(struct iris_inst *inst,
>>> struct v4l2_format *f)
>>> fmt = inst->fmt_dst;
>>> fmt->type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE;
>>> fmt->fmt.pix_mp.pixelformat = f->fmt.pix_mp.pixelformat;
>>> - fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
>>> - fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
>>> fmt->fmt.pix_mp.num_planes = 1;
>>> - fmt->fmt.pix_mp.plane_fmt[0].bytesperline = ALIGN(f-
>>> >fmt.pix_mp.width, 128);
>>> + switch (f->fmt.pix_mp.pixelformat) {
>>> + case V4L2_PIX_FMT_P010:
>>> + fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
>>> + fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
>>> + fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
>>> + ALIGN(f->fmt.pix_mp.width * 2, 256);
>>> + break;
>>> + case V4L2_PIX_FMT_QC10C:
>>> + fmt->fmt.pix_mp.width = roundup(f->fmt.pix_mp.width, 192);
>>
>> ALIGN ?
>
> ALIGN only works with Power-Of-Two numbers, so we can't use ALIGN here.
Ack
>
>>
>>> + fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 16);
>>> + fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
>>> + ALIGN(f->fmt.pix_mp.width * 4 / 3, 256);
>>> + break;
>>> + case V4L2_PIX_FMT_NV12:
>>> + case V4L2_PIX_FMT_QC08C:
>>> + fmt->fmt.pix_mp.width = ALIGN(f->fmt.pix_mp.width, 128);
>>> + fmt->fmt.pix_mp.height = ALIGN(f->fmt.pix_mp.height, 32);
>>> + fmt->fmt.pix_mp.plane_fmt[0].bytesperline =
>>> + ALIGN(f->fmt.pix_mp.width, 128);
>>> + break;
>>> + }
>>> fmt->fmt.pix_mp.plane_fmt[0].sizeimage =
>>> iris_get_buffer_size(inst, BUF_OUTPUT);
>>> inst->buffers[BUF_OUTPUT].min_count =
>>> iris_vpu_buf_count(inst, BUF_OUTPUT);
>>> inst->buffers[BUF_OUTPUT].size = fmt-
>>> >fmt.pix_mp.plane_fmt[0].sizeimage;
>>>
>>
>
next prev parent reply other threads:[~2026-05-20 15:56 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <5Yg7em0Xca9girDZT52cxZaTg93xJtZD7C2ExswhAkholGSsMsWXMWxtbtsWmkGeJWjp56SmJlLhj55vO4e0nw==@protonmail.internalid>
2026-05-11 9:20 ` [PATCH v3 0/6] media: qcom: iris: add support for decoding " Neil Armstrong
2026-05-11 9:20 ` [PATCH v3 1/6] media: qcom: iris: add helpers for 8bit and " Neil Armstrong
2026-05-13 10:25 ` Dmitry Baryshkov
2026-05-13 18:25 ` Vikash Garodia
2026-05-11 9:20 ` [PATCH v3 2/6] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
2026-05-13 18:43 ` Vikash Garodia
2026-05-21 8:50 ` Neil Armstrong
2026-05-11 9:20 ` [PATCH v3 3/6] media: qcom: iris: gen2: add support for 10bit decoding Neil Armstrong
2026-05-13 10:38 ` Dmitry Baryshkov
2026-05-13 18:50 ` Vikash Garodia
2026-05-18 7:32 ` Neil Armstrong
2026-05-21 9:44 ` Vikash Garodia
2026-05-21 12:57 ` Neil Armstrong
2026-05-11 9:20 ` [PATCH v3 4/6] media: qcom: iris: vdec: update size and stride calculations for 10bit formats Neil Armstrong
2026-05-13 10:39 ` Dmitry Baryshkov
2026-05-13 19:05 ` Vikash Garodia
2026-05-18 7:33 ` Neil Armstrong
2026-05-20 15:55 ` Vikash Garodia [this message]
2026-05-11 9:20 ` [PATCH v3 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and " Neil Armstrong
2026-05-13 10:47 ` Dmitry Baryshkov
2026-05-13 19:27 ` Vikash Garodia
2026-05-18 7:36 ` Neil Armstrong
2026-05-20 15:30 ` Vikash Garodia
2026-05-20 15:39 ` Neil Armstrong
2026-05-20 15:47 ` Vikash Garodia
2026-05-21 7:18 ` Neil Armstrong
2026-05-15 9:37 ` Bryan O'Donoghue
2026-05-15 9:42 ` Bryan O'Donoghue
2026-05-11 9:20 ` [PATCH v3 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format Neil Armstrong
2026-05-13 10:45 ` Dmitry Baryshkov
2026-05-13 11:59 ` Neil Armstrong
2026-05-13 12:04 ` Dmitry Baryshkov
2026-05-13 19:39 ` Vikash Garodia
2026-05-18 7:39 ` Neil Armstrong
2026-05-20 15:55 ` Vikash Garodia
2026-05-21 7:27 ` Neil Armstrong
2026-05-21 9:52 ` Vikash Garodia
2026-05-13 8:50 ` [PATCH v3 0/6] media: qcom: iris: add support for decoding 10bit formats Wangao Wang
2026-05-13 12:11 ` Neil Armstrong
2026-05-13 16:02 ` Neil Armstrong
2026-05-13 16:04 ` Dmitry Baryshkov
2026-05-13 17:33 ` Vikash Garodia
2026-05-18 7:42 ` Neil Armstrong
2026-05-20 15:44 ` Vikash Garodia
2026-05-21 7:24 ` Neil Armstrong
2026-05-21 9:33 ` Vikash Garodia
2026-05-15 9:35 ` Bryan O'Donoghue
2026-05-15 9:38 ` Vikash Garodia
2026-05-21 8:56 ` Neil Armstrong
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=ce10baa3-bd63-472d-b5c9-248bb1a01731@oss.qualcomm.com \
--to=vikash.garodia@oss.qualcomm.com \
--cc=abhinav.kumar@linux.dev \
--cc=bod@kernel.org \
--cc=dikshita.agarwal@oss.qualcomm.com \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-media@vger.kernel.org \
--cc=mchehab@kernel.org \
--cc=neil.armstrong@linaro.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
all inboxes | Powered by JetHome®