From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1E9742701C4 for ; Wed, 20 May 2026 15:30:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779291052; cv=none; b=qt6w+qNisWXP2D8j5M8asZzSesyLV4TmARwv37sW61gBDaZilom/hZepEUiOrYEgQ/Y52Kt2Mmt7BkDIjQY/avIsSf3a9Zr0ts6uhdAFDj7hYa5HgrMuPX8QSxYy4NzPe23CYWFsrfTUEMQczlTD3MDJh8VvPuU708VDfztgxl0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779291052; c=relaxed/simple; bh=4lArACJqYw7YV8IOeLvkC+XWDSoxl76OWhzWPcXN5N0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=T+HIdciPl21qK2ktWSIEhAbMXNyBpuSLE0P8Zisp/gnUU5rJLEts9YM7EcXDW6qkZl84ObshXX3eYBD0OrXo1dSDl/tZjxIhxQ+ullN1mYmSv3iQ+lWCvKvJeruBRMCC5Ci6D7UJf6JYgVmdZ4UBrtAMwjPbXoy16+DMyGor8ps= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=CaaeDiH+; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=DNiWxcWJ; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="CaaeDiH+"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="DNiWxcWJ" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64KDXvMn1798612 for ; Wed, 20 May 2026 15:30:50 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= kzInGs0wiHNTrVpeK113go4qVHPTqXkw2qXPs0Cr0Yk=; b=CaaeDiH+XjiPEwPj CXDAxMdHkeLI9sIFfmREQLTpROydEAtuqOt4i93PGG58XXl8sgTxF1wRRxnSCK6C IKrlmeKm2ZWcRDfbhAorJ6gR6xIxo6f87UUE5Rex3+tJXK6xdB+QoWhsEIkbMwwB fZZudEAaQ85JjXrlYGrLJKyZu7/o44abu7nE912qQmwnx+WlKkqhAHAPJzXaQeGI HyT3Z5wIFNWGaemw0ZjImI3hM2LJC7gx5gEzaHd5wzInLwO9/2RmnCc/qnRyddjT f9lI4qWPMw0WAB6pbHTVeclVneXQ0Z/wYGDgckyLWizFcKzJXZR1tpdWPk5cL0Uh 5kAvIA== Received: from mail-pf1-f199.google.com (mail-pf1-f199.google.com [209.85.210.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e9dxu0g1f-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 20 May 2026 15:30:50 +0000 (GMT) Received: by mail-pf1-f199.google.com with SMTP id d2e1a72fcca58-82fa860e71eso2633117b3a.0 for ; Wed, 20 May 2026 08:30:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779291049; x=1779895849; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=kzInGs0wiHNTrVpeK113go4qVHPTqXkw2qXPs0Cr0Yk=; b=DNiWxcWJMay9OUwJkGow7diH4StKe1HdwbhEtaQfw0Lc8Um0zsvlxwISk4vCNBbTE+ KB67d1aCAqVmcq83OA2xVeSd2iQosHh0ecjdFxazN/7MxKKnOE4QUcHWLx38A9HSDZIS Rx+SfcNCfYosS32g8I22I20itT7mKRNmlBzGfi4XH9oK7MeIc37DV7tcPwc2tSP8fn6B Z5KI7ZMjwfWZQKGsUGSL5AOEhFXaj9Y2kwXtD/gDyNjeYbKi5XmzfhpriebYaViRFyWk PGFHORl1mA7g8PMDFum1LPU7EH16SOpyYWa+MnQlDT4opQ7T2zcJiKh/WTeKYfFh78qN 4ZVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779291049; x=1779895849; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=kzInGs0wiHNTrVpeK113go4qVHPTqXkw2qXPs0Cr0Yk=; b=cHUr6xhczCvZcCY4gC/6W+wGDHN2QLhwNuLpy6FtQ7pVjLPaL8Tcay44nA1TJT/vfX 2Rq11yVogtu/RyBCxj2eEYabd2sNAwv+6ODpFe2FR4Ez1h+MIxPMVK8TX/ZLU/yRLnPh l6+mA6PIrZ4GCVS0nBKJ86qZAXh1I4IL2xY7491G6Ngx9CFbBEQX1MYLulR2lWPzdFto NXCSYG9MQyAk05QetWNmKEBbK0u0pFWdfYLau5ENRGTBUMY4/aDG1ljd8GlrepCdvq9o mjmDug1g5VSsmVa6i1ifDLwSRZnlCwnGG6/HA7i8YkNM9rO4NRNPcw9iCx5I0oYAOkcu kBXg== X-Forwarded-Encrypted: i=1; AFNElJ+Qv+qTYx51ghgOmiKGQrtYpbMAnIrdBVL8h4mkQMl2Ib6SXNZrlydmV3z+PbG9G6bAVebzjYmbNm5NHgk=@vger.kernel.org X-Gm-Message-State: AOJu0YwHhPIg9Ul2KELW0Ynyqj8Nz4EXBsPSxepeZnSWbjE13jaximry y9UChu1gUMxmFwP6+JYn0NQe6nIa7771v2cAzdH7YyTjvyj+09jHz02Dt+9BsM7fFXRSWu9xFp8 D76sKLslXquH3fvlqnTDPivr5rt0Ka54/8vZ/rHsjvtn1RON6vDsWpEqJe0f2lIBeM3k= X-Gm-Gg: Acq92OHQAL8jV5J3rw8irB9ECg3HiUB8hnI5grB36PguedjtScQqARfErMRF8whTLE2 NUBkiF8KTwsTNFFLtM5Xkho+xDdLDB1GNdIV0uY1QZZCDlnD4DB2WJPcioGmbttOMUSE1w9sOoX lZ8kPhNC3cwxmu50I4bNPgTkQ4sWLJiklvjfXMPAUulIsIRWIsvqdK1TXqVxSlPZrMFgQIFnnLU bYGYUqWywlPHK9MVCm7/ZpsuedGM5Tgr9sSbR2HpYaasUxoF9a0EAqXXAzCMDgXvq9r9N59Y9Q5 wLoLp3wUJz8LYL/bXXWx0CJNtaq+7kpxulKOdiIFHXWck0e0uI8D2dMONpno8D+WMuEGwZycwFm pausQuCT1xTg2vo07jaDAZcINI39MompKMEsbSkQtzrO+ag2wsUFBpQc= X-Received: by 2002:a05:6a00:1486:b0:838:3404:c2b0 with SMTP id d2e1a72fcca58-83f33b1d289mr23151506b3a.13.1779291049466; Wed, 20 May 2026 08:30:49 -0700 (PDT) X-Received: by 2002:a05:6a00:1486:b0:838:3404:c2b0 with SMTP id d2e1a72fcca58-83f33b1d289mr23151465b3a.13.1779291048931; Wed, 20 May 2026 08:30:48 -0700 (PDT) Received: from [10.204.101.125] ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-83f75c0d232sm10385394b3a.17.2026.05.20.08.30.45 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2026 08:30:48 -0700 (PDT) Message-ID: <8f708b87-92d3-47ed-8cda-1f34b512816c@oss.qualcomm.com> Date: Wed, 20 May 2026 21:00:43 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats To: Neil Armstrong , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , nicolas Dufresne , Hans Verkuil 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-5-7fc049b93042@linaro.org> <5fc62574-fae1-4bf0-b6b9-fb6fb33041f8@oss.qualcomm.com> <08eff436-4221-4bc2-9fac-2ac1b6a091ae@linaro.org> Content-Language: en-US From: Vikash Garodia In-Reply-To: <08eff436-4221-4bc2-9fac-2ac1b6a091ae@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDE0OSBTYWx0ZWRfX6ZXjnCfOnBVB nxtBfeS+p11GNeZP/aJRD7J+Iq+9hAmzgSp+JBniIa0nhvXNQaMnw4XAEW6noBNhzqt+Xf+/kKf 7RiV/fnpuHesRLi/aRGwXHO2Q/I65cTnCunVlAe+HASaQysesPh02UzotD1hQZWC+4lifgkDQpY 9jipM6JWmDWLDqS7I4Nwv/Y8+tfDUsdD6pc4bbADeKmWwB1MwgX0qc6qo3kVMJJeTLmm9zpyGFQ jbL9ZWjMTDgSCiMrW6vfNOz2PVv18JTUtPcPFq0kdtQahP/YyACnuNcB8EuEibjJOK1E205vrSi v6usFwFejzILqVR5Ua1TSiwlOJ5KnhvrXE3m6YYEjgLBVl+AiZk7lzNso+6oh+P6PYMoOOZ+zSW NvDepUUFWm7tKhJoOTOmSlPcp2aAAydWnUlc91WTzvDlf5gI4UEVrZ7qxBBaw5VfoRnB3g7vP9J uapq10WvzzmAmfN5Itw== X-Authority-Analysis: v=2.4 cv=Zckt8MVA c=1 sm=1 tr=0 ts=6a0dd3aa cx=c_pps a=WW5sKcV1LcKqjgzy2JUPuA==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=Um2Pa8k9VHT-vaBCBUpS:22 a=KKAkSRfTAAAA:8 a=B986JHd8bV2UN6gAnN4A:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=OpyuDcXvxspvyRM73sMx:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-GUID: JH4PBSVjrHF8RRM38xjObhDnLF6Tm_dC X-Proofpoint-ORIG-GUID: JH4PBSVjrHF8RRM38xjObhDnLF6Tm_dC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-05-20_03,2026-05-18_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 adultscore=0 priorityscore=1501 malwarescore=0 clxscore=1015 phishscore=0 bulkscore=0 lowpriorityscore=0 impostorscore=0 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605200149 On 5/18/2026 1:06 PM, Neil Armstrong wrote: > On 5/13/26 21:27, Vikash Garodia wrote: >> >> >> On 5/11/2026 2:50 PM, Neil Armstrong wrote: >>> The 10bit pixel format can be only used when the decoder identifies the >>> stream as decoding into 10bit pixel format buffers, so update the >>> find_format helper to filter the formats and only allow the proper >>> formats when setting or trying a capture format. >>> >>> Signed-off-by: Neil Armstrong >>> --- >>>   drivers/media/platform/qcom/iris/iris_platform_common.h |  1 + >>>   drivers/media/platform/qcom/iris/iris_vdec.c            | 10 ++++++ >>> ++++ >>>   2 files changed, 11 insertions(+) >>> >>> diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h >>> b/drivers/media/platform/qcom/iris/iris_platform_common.h >>> index 5a489917580e..cd3509da4b75 100644 >>> --- a/drivers/media/platform/qcom/iris/iris_platform_common.h >>> +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h >>> @@ -18,6 +18,7 @@ struct iris_inst; >>>   #define REGISTER_BIT_DEPTH(luma, chroma)    ((luma) << 16 | (chroma)) >>>   #define BIT_DEPTH_8                REGISTER_BIT_DEPTH(8, 8) >>> +#define BIT_DEPTH_10                REGISTER_BIT_DEPTH(10, 10) >>>   #define CODED_FRAMES_PROGRESSIVE        0x0 >>>   #define DEFAULT_MAX_HOST_BUF_COUNT        64 >>>   #define DEFAULT_MAX_HOST_BURST_BUF_COUNT    256 >>> diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/ >>> media/platform/qcom/iris/iris_vdec.c >>> index eea69f937147..f4d9951ed04c 100644 >>> --- a/drivers/media/platform/qcom/iris/iris_vdec.c >>> +++ b/drivers/media/platform/qcom/iris/iris_vdec.c >>> @@ -99,6 +99,16 @@ find_format(struct iris_inst *inst, u32 pixfmt, >>> u32 type) >>>       if (i == size || fmt[i].type != type) >>>           return NULL; >>> +    if (type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { >>> +        if (iris_fmt_is_8bit(fmt[i].pixfmt) && >>> +            inst->fw_caps[BIT_DEPTH].value == BIT_DEPTH_10) >>> +            return NULL; >>> + >>> +        if (iris_fmt_is_10bit(fmt[i].pixfmt) && >>> +            inst->fw_caps[BIT_DEPTH].value != BIT_DEPTH_10) >>> +            return NULL; >>> +    } >> >> similar logic would be now needed while enumerating fmt. >> >> VIDIOC_ENUM_FMT will now enumerate all capture formats (NV12, QC08C, >> QC10C..) regardless of the stream's bit depth, while VIDIOC_S_FMT will >> reject the wrong-depth formats. >> >> userspace will see formats via ENUM_FMT that it cannot successfully >> set with S_FMT. > > So initially I did that, but I reverted since it broke decoding with > gstreamer when trying > to use QC10C since it requires negociating the src/sink before sending > the fist buffer > and then get the source format change to switch to 10bit. Does that mean that src is still producing the data in Q10c, while sink is configured to NV12 (8bit) ? > > I checked and none of the other v4l2 drivers supporting 10bit does that, > so it seems right > to allow enumerating all possibly supported formats and only accept the > session supported > one with S_FMT. I was reading the documentation on this aspects, and it says to keep all the supported ones, instead of changing runtime and limit it to 10bit ones, in this case. +ing Nico and Hans incase they would like to comment on this. > >> >>> + >>>       return &fmt[i]; >>>   } >>> >> >> Regards, >> Vikash >> >