public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Neil Armstrong <neil.armstrong@linaro.org>
To: Dikshita Agarwal <dikshita.agarwal@oss.qualcomm.com>,
	Vikash Garodia <vikash.garodia@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 RFC 2/7] media: qcom: iris: gen2: add support for 10bit decoding
Date: Tue, 21 Apr 2026 09:42:08 +0200	[thread overview]
Message-ID: <23d27bbc-3491-4baf-bf05-be5ef4619aa7@linaro.org> (raw)
In-Reply-To: <f336e049-eb6c-5784-b831-fffcc162ffe0@oss.qualcomm.com>

On 4/21/26 07:24, Dikshita Agarwal wrote:
> 
> 
> On 4/17/2026 1:33 PM, Neil Armstrong wrote:
>> On 4/17/26 09:22, Dikshita Agarwal wrote:
>>>
>>>
>>> On 4/8/2026 10:13 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     | 71
>>>> +++++++++++++++++++++-
>>>>    .../platform/qcom/iris/iris_hfi_gen2_defines.h     |  1 +
>>>>    drivers/media/platform/qcom/iris/iris_utils.c      |  4 +-
>>>>    3 files changed, 72 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..8e547e390fa3 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;
>>>> +        };
>>>>        } 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,57 @@ 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];
>>>> +
>>>> +    pixelformat = inst->fmt_dst->fmt.pix_mp.pixelformat;
>>>> +    width = inst->fmt_dst->fmt.pix_mp.width;
>>>> +    height = inst->fmt_dst->fmt.pix_mp.height;
>>>
>>> This HFI is only applicable to AV1, you might see some corruption due to
>>> this. Please check.
>>
>> This is what I saw looking at donwstream, but I had not implemented this
>> initially
>> but I got some corruption with some different width/height, which was
>> solved adding
>> this command.
> 
> Even with your implementation, this API would only ever be triggered for
> QC08C and QC10C formats, which I don’t believe are currently being tested
> with your series. Since HFI defines this as AV1D‑specific, invoking it for
> other codecs is unlikely to help and would be incorrect.
> 
> Pls re-check.

I actually did test QC08C and QC10C with dma-buf drm import, and it works fine
with this API.

Neil

> 
> Thanks,
> Dikshita
>> I guess this in-firmware calculations are not exactly the same the DRM
>> driver expects.
>>
>> Honestly I think it's preferable to sync the stride/scanlines calculations
>> between the
>> driver and the firmware.
>> For example I used the same "ALIGN(width, 192)" for the v2 iris patchset
>> which was wrong
>> because ALIGN only works on Power Of Two number but it still worked because
>> this HFI
>> HFI_PROP_UBWC_STRIDE_SCANLINE command was called with the wrong aligned width.
>>
>> Neil
>>
>>>
>>> Thanks,
>>> Dikshita
>>


  reply	other threads:[~2026-04-21  7:42 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-08 16:43 [PATCH RFC 0/7] media: qcom: iris: add support for decoding 10bit formats Neil Armstrong
2026-04-08 16:43 ` [PATCH RFC 1/7] media: qcom: iris: add QC10C & P010 buffer size calculations Neil Armstrong
2026-04-08 23:59   ` Dmitry Baryshkov
2026-04-09  7:25     ` Neil Armstrong
2026-04-11 16:13       ` Dmitry Baryshkov
2026-04-17  6:47   ` Dikshita Agarwal
2026-04-17  8:03     ` Neil Armstrong
2026-04-08 16:43 ` [PATCH RFC 2/7] media: qcom: iris: gen2: add support for 10bit decoding Neil Armstrong
2026-04-17  7:22   ` Dikshita Agarwal
2026-04-17  8:03     ` Neil Armstrong
2026-04-21  5:24       ` Dikshita Agarwal
2026-04-21  7:42         ` Neil Armstrong [this message]
2026-04-08 16:43 ` [PATCH RFC 3/7] media: qcom: iris: add helpers for 8bit and 10bit formats Neil Armstrong
2026-04-17  7:23   ` Dikshita Agarwal
2026-04-17  8:03     ` Neil Armstrong
2026-04-08 16:43 ` [PATCH RFC 4/7] media: qcom: iris: vdec: update size and stride calculations for " Neil Armstrong
2026-04-10 10:10   ` Vishnu Reddy
2026-04-10 11:59     ` Neil Armstrong
2026-04-10 12:57       ` Vishnu Reddy
2026-04-10 13:47         ` Neil Armstrong
2026-04-14 23:39       ` Nicolas Dufresne
2026-04-08 16:43 ` [PATCH RFC 5/7] media: qcom: iris: vdec: forbid g_fmt while waiting for first source change Neil Armstrong
2026-04-08 16:43 ` [PATCH RFC 6/7] media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats Neil Armstrong
2026-04-15  6:39   ` Vishnu Reddy
2026-04-15  7:35     ` Neil Armstrong
2026-04-08 16:44 ` [PATCH RFC 7/7] media: qcom: iris: vdec: allow decoding into 10bit format Neil Armstrong
2026-04-09  0:02 ` [PATCH RFC 0/7] media: qcom: iris: add support for decoding 10bit formats Dmitry Baryshkov
2026-04-09  1:04   ` Nicolas Dufresne
2026-04-09  1:40     ` Dmitry Baryshkov
2026-04-09  7:43       ` Neil Armstrong
2026-04-09  7:36     ` Neil Armstrong
2026-04-09 13:19       ` Nicolas Dufresne
2026-04-10 12:00         ` Neil Armstrong
2026-04-10 16:25           ` Neil Armstrong
2026-04-11 17:10             ` Dmitry Baryshkov
2026-04-14 15:35             ` 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=23d27bbc-3491-4baf-bf05-be5ef4619aa7@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