mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Vikash Garodia <vikash.garodia@oss.qualcomm.com>,
	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 3/6] media: qcom: iris: gen2: add support for 10bit decoding
Date: Thu, 21 May 2026 14:57:58 +0200	[thread overview]
Message-ID: <d69f2c50-732f-41cc-86fe-9eabae7b6d71@linaro.org> (raw)
In-Reply-To: <c770444d-be66-47e3-83bc-be477d4e07cd@oss.qualcomm.com>

On 5/21/26 11:44, Vikash Garodia wrote:
> 
> On 5/18/2026 1:02 PM, Neil Armstrong wrote:
>> On 5/13/26 20:50, Vikash Garodia wrote:
>>>
>>> On 5/11/2026 2:50 PM, Neil Armstrong wrote:
>>>> Add the necessary plumbing into the HFi Gen2 to signal the decoder
>>>> the right 10bit pixel format and stride when in compressed mode.
>>>>
>>>> Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
>>>> ---
>>>>   .../platform/qcom/iris/iris_hfi_gen2_command.c     | 75 +++++++++++ ++++++++++-
>>>>   .../platform/qcom/iris/iris_hfi_gen2_defines.h     |  1 +
>>>>   drivers/media/platform/qcom/iris/iris_utils.c      |  4 +-
>>>>   3 files changed, 76 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>>>> index 30bfd90d423b..89de8c366836 100644
>>>> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>>>> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_command.c
>>>> @@ -481,8 +481,20 @@ static int iris_hfi_gen2_set_colorformat(struct iris_inst *inst, u32 plane)
>>>>       if (inst->domain == DECODER) {
>>>>           pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat;
>>>> -        hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
>>>> -            HFI_COLOR_FMT_NV12 : HFI_COLOR_FMT_NV12_UBWC;
>>>> +        switch (pixelformat) {
>>>> +        case V4L2_PIX_FMT_NV12:
>>>> +            hfi_colorformat = HFI_COLOR_FMT_NV12;
>>>> +            break;
>>>> +        case V4L2_PIX_FMT_QC08C:
>>>> +            hfi_colorformat = HFI_COLOR_FMT_NV12_UBWC;
>>>> +            break;
>>>> +        case V4L2_PIX_FMT_P010:
>>>> +            hfi_colorformat = HFI_COLOR_FMT_P010;
>>>> +            break;
>>>> +        case V4L2_PIX_FMT_QC10C:
>>>> +            hfi_colorformat = HFI_COLOR_FMT_TP10_UBWC;
>>>> +            break;
>>>> +        };
>>>
>>> semicolon ?
>>
>> Ack
>>
>>>
>>>>       } else {
>>>>           pixelformat = inst->fmt_src->fmt.pix_mp.pixelformat;
>>>>           hfi_colorformat = pixelformat == V4L2_PIX_FMT_NV12 ?
>>>> @@ -517,7 +529,8 @@ static int iris_hfi_gen2_set_linear_stride_scanline(struct iris_inst *inst, u32
>>>>       stride_uv = stride_y;
>>>>       scanline_uv = scanline_y / 2;
>>>> -    if (pixelformat != V4L2_PIX_FMT_NV12)
>>>> +    if (pixelformat != V4L2_PIX_FMT_NV12 &&
>>>> +        pixelformat != V4L2_PIX_FMT_P010)
>>>>           return 0;
>>>>       payload[0] = stride_y << 16 | scanline_y;
>>>> @@ -532,6 +545,61 @@ static int iris_hfi_gen2_set_linear_stride_scanline(struct iris_inst *inst, u32
>>>>                             sizeof(u64));
>>>>   }
>>>> +static int iris_hfi_gen2_set_ubwc_stride_scanline(struct iris_inst *inst, u32 plane)
>>>> +{
>>>> +    u32 meta_stride_y, meta_scanline_y, meta_stride_uv, meta_scanline_uv;
>>>> +    u32 stride_y, scanline_y, stride_uv, scanline_uv;
>>>> +    u32 port = iris_hfi_gen2_get_port(inst, plane);
>>>> +    u32 pixelformat, width, height;
>>>> +    u32 payload[4];
>>>> +
>>>> +    if (inst->domain != DECODER ||
>>>> +        inst->fmt_src->fmt.pix_mp.pixelformat != V4L2_PIX_FMT_AV1)
>>>
>>> whats the restriction with AV1 here ?
>>
>> This restriction is used in downstream driver and Dikshita reported we shouldn't
>> call HFI_PROP_UBWC_STRIDE_SCANLINE except for AV1.
>>
>> Could you please check if it's necessary ?
>>
> I discussed this with firmware folks. As per them, this interface is effective for AV1, and for others, it might lead to higher size due to host demanded alignment.
> 
> As per firmware team,
> "While the documentation states it is applicable "for AV1 ONLY", sending it for HEVC, VP9, or H.264 will physically work—forcing the UBWC output buffers into the Host's fixed stride layout. However, because older codecs handle resolution changes natively by triggering a standard Port Settings Change (PSC) to reallocate buffers, using this property for them is largely unnecessary and will persist statically, potentially leading to wasted memory due to over-allocated padding"

Thanks a lot for asking, I will leave it as is for now until we have a stride issue we can enable it for other codecs.

Neil

> 
> Regards,
> Vikash


  reply	other threads:[~2026-05-21 12:58 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 10bit formats 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 [this message]
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
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=d69f2c50-732f-41cc-86fe-9eabae7b6d71@linaro.org \
    --to=neil.armstrong@linaro.org \
    --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=vikash.garodia@oss.qualcomm.com \
    /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®