From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D997A395AE6 for ; Thu, 21 May 2026 07:27:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779348430; cv=none; b=t+/ItJvq2vYKrzl10r4trGFWJLa2TU2E5JzKbo0LTdJXYSxqXB5IqAEzo/TjdUcKhQ7yHSB7sxbW3M+wfSSblYx/Tj6SWvYwXzjllHpfzU49jmLRHBbznHwVe6F3pahcph6lJqRgYfjLTfmYTaNsBYJxWrqQlH6pu8pZDKbwwK4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779348430; c=relaxed/simple; bh=b+dsCjQobQVJSHwz4J0dobN/Ng1Ay6rcNNRtQ8SNH7E=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=attZRQArwbQnmolOd46MuiO3PzZ0hTeLzuVYwzIIZizxWTO2jUmhMBHiaG6uIjDuPuyxpApOBDFzYz4nABUr9vh8uiGj5IEqJbOWfK1qAhgFwZWNHN1oCl3khdkxHeu7QElMyCjpBLtFdFTm7AtTMQsCGljGwsTXWoeC9dLfx+4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=O7lHyhut; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O7lHyhut" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-44ce78ab5feso4858838f8f.0 for ; Thu, 21 May 2026 00:27:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779348427; x=1779953227; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:from:to:cc:subject:date:message-id :reply-to; bh=MXHtGnnOcV5ddtG6N7wO967d73FTdnEIMjnmhjZWCNc=; b=O7lHyhutR1gGgHCFCKLwqVWqdRwcQW8xUEJ2S+pv0lGIIwqEigo+FNvSp/BrVuKlOH pBDyngY1l1aAj9cl/F74vtt8lhT7jIA9JZQo38pztxwsPIZvWHSbrMNGrj2uvkx0AHsB Lru9KDGLuDWZ2iP6cXgC/GvoXLdzV+vsjDKxtdCqNC2J7gXpAYPcQK+S86xpuEtawBl7 dbt/zIRH1qyADGDZG/pvaRldTKZMqz59nCbnEHJ9vx4XSOYagm2fKVs4E/ySGAlcbuBe pCxi5wrsGCW8nyjhu/Jyo1EH5ItPbVX5wQOk409JFt/I59BhVzqG8R6mULo+MY7lafxj rr0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779348427; x=1779953227; h=content-transfer-encoding:in-reply-to:organization:autocrypt :content-language:references:cc:to:subject:reply-to:from:user-agent :mime-version:date:message-id:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MXHtGnnOcV5ddtG6N7wO967d73FTdnEIMjnmhjZWCNc=; b=iFdG3FcYvTus2JvqFgMw5C/Ifmxcc8VJ3e+INJ9KPzY+RIfFnXHdiO5+kvvLCMUpa/ mHsPkEnGiDZvq5REwJJyhBUdZxZLmMzYOJWHY58L2HR4roiyTRRwATCam4RsQNEZ8nxu AqI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655f8f.16.1779348427186; Thu, 21 May 2026 00:27:07 -0700 (PDT) Received: from ?IPV6:2a01:e0a:106d:1080:e038:7e8a:7467:8c6c? ([2a01:e0a:106d:1080:e038:7e8a:7467:8c6c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45eaa9366besm670994f8f.31.2026.05.21.00.27.06 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 21 May 2026 00:27:06 -0700 (PDT) Message-ID: <89a81b27-b217-4c74-96c0-c6f813a0768f@linaro.org> Date: Thu, 21 May 2026 09:27:06 +0200 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: Neil Armstrong Reply-To: Neil Armstrong Subject: Re: [PATCH v3 6/6] media: qcom: iris: vdec: allow GEN2 decoding into 10bit format To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org References: <20260511-topic-sm8x50-iris-10bit-decoding-v3-0-7fc049b93042@linaro.org> <20260511-topic-sm8x50-iris-10bit-decoding-v3-6-7fc049b93042@linaro.org> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2k+KQ7q+aXavU5W+yLNn7QtXUB530Zlk/d2ETgzQ5FLYYnUDAaRl+8JUTjc0CNOTpCeik 80TZcE6f8M76Xa6yU8VcNko94Ck7iB4vj70q76P/J7kt98hklr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B0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 5/20/26 17:55, Vikash Garodia wrote: > > On 5/18/2026 1:09 PM, Neil Armstrong wrote: >> On 5/13/26 21:39, Vikash Garodia wrote: >>> >>> On 5/11/2026 2:50 PM, Neil Armstrong wrote: >>>> Add the necessary bits into the gen2 platforms tables and handlers >>>> to allow decoding streams into 10bit pixel formats. >>>> >>>> Signed-off-by: Neil Armstrong >>>> --- >>>>   .../media/platform/qcom/iris/iris_hfi_gen2_response.c    | 16 +++++ ++++++++++- >>>>   drivers/media/platform/qcom/iris/iris_instance.h         |  2 ++ >>>>   drivers/media/platform/qcom/iris/iris_platform_gen2.c    |  8 +++++--- >>>>   drivers/media/platform/qcom/iris/iris_vdec.c             |  8 ++++++++ >>>>   4 files changed, 30 insertions(+), 4 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 0541e02d7507..b6d815c01f1d 100644 >>>> --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c >>>> +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c >>>> @@ -542,6 +542,15 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst) >>>>       pixmp_ip->width = width; >>>>       pixmp_ip->height = height; >>>> +    if (subsc_params.bit_depth == BIT_DEPTH_8 && >>>> +        pixmp_op->pixelformat != V4L2_PIX_FMT_NV12 && >>>> +        pixmp_op->pixelformat != V4L2_PIX_FMT_QC08C) >>>> +        pixmp_op->pixelformat = V4L2_PIX_FMT_NV12; >>>> +    else if (subsc_params.bit_depth == BIT_DEPTH_10 && >>>> +         pixmp_op->pixelformat != V4L2_PIX_FMT_P010 && >>>> +         pixmp_op->pixelformat != V4L2_PIX_FMT_QC10C) >>>> +        pixmp_op->pixelformat = V4L2_PIX_FMT_P010; >>>> + >>>>       switch (pixmp_op->pixelformat) { >>>>       case V4L2_PIX_FMT_P010: >>>>           pixmp_op->width = ALIGN(width, 128); >>>> @@ -625,7 +634,12 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst) >>>>       inst->fw_caps[POC].value = subsc_params.pic_order_cnt; >>>>       inst->fw_caps[TIER].value = subsc_params.tier; >>>> -    if (subsc_params.bit_depth != BIT_DEPTH_8 || >>>> +    if (subsc_params.bit_depth == BIT_DEPTH_8) >>>> +        inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_8; >>>> +    else >>>> +        inst->fw_caps[BIT_DEPTH].value = BIT_DEPTH_10; >>>> + >>>> +    if ((subsc_params.bit_depth != BIT_DEPTH_8 && subsc_params.bit_depth != BIT_DEPTH_10) || >>>>           !(subsc_params.coded_frames & HFI_BITMASK_FRAME_MBS_ONLY_FLAG)) { >>>>           dev_err(core->dev, "unsupported content, bit depth: %x, pic_struct = %x\n", >>>>               subsc_params.bit_depth, subsc_params.coded_frames); >>>> diff --git a/drivers/media/platform/qcom/iris/iris_instance.h b/ drivers/media/platform/qcom/iris/iris_instance.h >>>> index 16965150f427..16424d1e94a6 100644 >>>> --- a/drivers/media/platform/qcom/iris/iris_instance.h >>>> +++ b/drivers/media/platform/qcom/iris/iris_instance.h >>>> @@ -25,6 +25,8 @@ enum iris_fmt_type_out { >>>>   enum iris_fmt_type_cap { >>>>       IRIS_FMT_NV12, >>>>       IRIS_FMT_QC08C, >>>> +    IRIS_FMT_TP10, >>>> +    IRIS_FMT_QC10C, >>>>   }; >>>>   struct iris_fmt { >>>> diff --git a/drivers/media/platform/qcom/iris/iris_platform_gen2.c b/ drivers/media/platform/qcom/iris/iris_platform_gen2.c >>>> index 5da90d47f9c6..ceed4b5d96ca 100644 >>>> --- a/drivers/media/platform/qcom/iris/iris_platform_gen2.c >>>> +++ b/drivers/media/platform/qcom/iris/iris_platform_gen2.c >>>> @@ -56,9 +56,10 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = { >>>>       { >>>>           .cap_id = PROFILE_HEVC, >>>>           .min = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, >>>> -        .max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE, >>>> +        .max = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10, >>> >>> what about gen1 platforms ? >> >> With this patchset gen platforms will reject 10bit since all the >> plumbing in the HFI response handling is missing. >> >> Once the Gen1 HFI gets the bit_depth and calculates the buffer sizes, it >> should work. But looking at Venus, the 10bit buffer calculation seems much >> more complex in Gen1. > > Is it more than accommodating higher buffer size by adding 25% extra for higher bits for decode scenario ? No idea, I haven't looked closely how to implement 10bit on gen1, I just checked if this patchset wouldn't cause any regressions. It may show P010 and QC10C in enum_fmt, but the PROFILE_HEVC and would not expose MAIN10 on gen1. > >> >>> >>>>           .step_or_mask = BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN) | >>>> -                BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE), >>>> +                BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_STILL_PICTURE) | >>>> +                BIT(V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN_10), >>>>           .value = V4L2_MPEG_VIDEO_HEVC_PROFILE_MAIN, >>>>           .hfi_id = HFI_PROP_PROFILE, >>>>           .flags = CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, >>>> @@ -287,7 +288,7 @@ static const struct platform_inst_fw_cap inst_fw_cap_sm8550_dec[] = { >>>>       { >>>>           .cap_id = BIT_DEPTH, >>>>           .min = BIT_DEPTH_8, >>>> -        .max = BIT_DEPTH_8, >>>> +        .max = BIT_DEPTH_10, >>>>           .step_or_mask = 1, >>>>           .value = BIT_DEPTH_8, >>>>           .hfi_id = HFI_PROP_LUMA_CHROMA_BIT_DEPTH, >>>> @@ -866,6 +867,7 @@ static const u32 sm8550_vdec_output_config_params[] = { >>>>       HFI_PROP_OPB_ENABLE, >>>>       HFI_PROP_COLOR_FORMAT, >>>>       HFI_PROP_LINEAR_STRIDE_SCANLINE, >>>> +    HFI_PROP_UBWC_STRIDE_SCANLINE, >>>>   }; >>>>   static const u32 sm8550_venc_output_config_params[] = { >>>> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/ media/platform/qcom/iris/iris_vdec.c >>>> index f4d9951ed04c..65cf509e4aef 100644 >>>> --- a/drivers/media/platform/qcom/iris/iris_vdec.c >>>> +++ b/drivers/media/platform/qcom/iris/iris_vdec.c >>>> @@ -70,6 +70,14 @@ static const struct iris_fmt iris_vdec_formats_cap[] = { >>>>           .pixfmt = V4L2_PIX_FMT_QC08C, >>>>           .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, >>>>       }, >>>> +    [IRIS_FMT_TP10] = { >>>> +        .pixfmt = V4L2_PIX_FMT_P010, >>>> +        .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, >>>> +    }, >>>> +    [IRIS_FMT_QC10C] = { >>>> +        .pixfmt = V4L2_PIX_FMT_QC10C, >>>> +        .type = V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE, >>>> +    }, >>>>   }; >>>>   static const struct iris_fmt * >>>> >>> >>> Regards, >>> Vikash >>> >> >