From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.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 B35842FE056 for ; Wed, 20 May 2026 15:47:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.180.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779292051; cv=none; b=AMHt+PfQW/7bP2K+OK+zqToL2J20fr/WWj3BH/wgLo6I+vIIGpWrtMTv5YQ/wkj+k1OTCzCiQLNgNiokROacoujBXWpw5dd9j5mb/KR2FaZr3NxjHLUyOfJ5FuoVtXRSdSxKnK5iws+IWhF2wKdqVTjI7JLg4LPBodHsZ4Tw2sU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779292051; c=relaxed/simple; bh=aX52iJOLM0ejEpu/B/nOamp3CugUdDMYBvNffSuH+JA=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S3XCU94DlgO36a/KmDTMhiEnnKpqdenXQkRUY2w6iMjsK6NckEQW2vMJsEjVRL5KFQFwAbfggOhphXWlNsj3NrfgasjTtIW2uAE67NJmL3LQIAwizt34I+HDGw/03INH+wWUo0nzxLGd9yo4xrV0luh5Y+R7t2DCVdH8KuTPhyc= 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=P6Qru0Bt; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=GvngbMGl; arc=none smtp.client-ip=205.220.180.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="P6Qru0Bt"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="GvngbMGl" Received: from pps.filterd (m0279868.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 64K9lgjB267045 for ; Wed, 20 May 2026 15:47:28 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= tFF7ygQCGQvN0fdjM33Djm66AQcJsUF1kfXIpetuWWM=; b=P6Qru0BtqC+Nh+3F Hw443YZZVaUgkg+zOUugfpFrrORwHBzJqBJhKP8HmkXbo+xHwI5RFYm+EuyDryKE beHDnI80JMhMexsvKRbPPWR8cn2hXexgbDAV2BhCOn+jBrqEuLMdjkDBygaIzcQC PYKSzX4q9CLzQc2mxKj2QAcDbjVvZvsa8j7YqkwN0VLemKx1QRCPyxj8JMGkiNFa V4Phyc6xDXosTZuquN22Pi+iVpyqdjVb4WZTwujhpMtPdkNXc5qFG0jolDU7yAGc iz32GxJyZwWxPSxxlj+ramHX6GK2ZhQdRlcaLaVjWAp9NPapywc2Z0d7BCc1xemf wfeqpw== Received: from mail-pf1-f197.google.com (mail-pf1-f197.google.com [209.85.210.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4e9amxsbvt-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 20 May 2026 15:47:28 +0000 (GMT) Received: by mail-pf1-f197.google.com with SMTP id d2e1a72fcca58-8353fbc7ad5so2592902b3a.3 for ; Wed, 20 May 2026 08:47:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1779292047; x=1779896847; 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=tFF7ygQCGQvN0fdjM33Djm66AQcJsUF1kfXIpetuWWM=; b=GvngbMGlsSM9wEIBSoMhGAWfr94mQY+yx0H6D3yGkBBp50jKKOnsMgzp1tAQiHAWin r4eg5g+3bnWJGgCFaltYR7XbqZMPsAE3cdLG0awSrPn4vi9LgFDQuQ7pQYW3pt4HSFuI vSJvSIDj2ptQY6bFwUp52AkRS2GJgd5ws1YBwA2SlCDdh5laez8Viaw1+d4sNQ+1bI8B VdykOF3tkpBfmPzEp/tYAYSWy2Tm7rmvOYfFne+WD1yNrMER1ZWKovqUxfQVS1s8XFA4 BA8Gj/zFCyg2q+0pEcvEWJQxW09iPvdqJlcV7M+fvta1IC1lU7jWtDd9GdlrY9qpmKkb opZQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779292047; x=1779896847; 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=tFF7ygQCGQvN0fdjM33Djm66AQcJsUF1kfXIpetuWWM=; b=q47ubz/2puhb3EEHtcvDwf4Chabw/FR/iIzhdV283zyKOdCZ3LBWNnzmdBFTCYs3/7 9Jpiosdu2+K4ttLwlwK7GFLSSuIt3/wzmIvmqR5mh8V0JMlcOnYpbAXXVxYu8fYBiGSU 1Z4c2IwJK9/jYJy7m62cnKAzJ7mlT1KBSit7HMe5gjM/NBwPYEt15QDIwrO3n68c+7Pq feLsnodeIO+otwBdt9gauXvMlzsQaot3DqhpNhGbrcr8FuQJKLCXAlQqwghTG4MnkRxU tb/xsshEAwAgdk5qtryPm5hHxX9x1pu1rfKa/JYo66LDKx1a0qVWuUbYXiJbncY5Ooa1 iqZg== X-Forwarded-Encrypted: i=1; AFNElJ+/LPYjze7LrZ5hoaz/2ZqJjtMrH+lY27siLxG0EU79csUwgfj28aFvKzQHCZYkhAoGzT/igk9C03gTUZE=@vger.kernel.org X-Gm-Message-State: AOJu0Yx4d+ZWeB3/klW9CYQ7ddh9N+S427KC/fgvt4KWtx2ULHS0mjzH /GS5hTRgNCBK6D+9aD5A5jvhEVvVB8oiffkjUBr9+1u+xic3o8onAT4h9dFfrbw5h4n6NyYUT+d uwl+wUv5c7GkuaiFArXeRd28H1Xh5xnJG0+OeVucJacs8VPZkaLd1AxAZqXr1wi1R9Bk= X-Gm-Gg: Acq92OGUmmwIkxuHPro/iJHtmcuKj9dP+SvZumDvfYUQLnjBATGqQdAB6MMWfEJF8gu fl4CvKIzTRskmcLa//9fsVDCA+ZGDTKxQVv/aoiNIcIJitsiImSdfQnONvrf928ZAFEBjsBzwuT Rx6GA3N9QyJI+8rVy5VmP6Hsth5/vyvmuHRhBPs68qFNtgXcT765VgW3XivKyFDnKxD/lG8pbgk fY0gyDv+zwRzWJqkhAUnLSzMa4rIcMSCXSn4Vb6XxFwYjxXG1N5i2JuqKLSyBX2d+ESDawfU3aB 0BQa7g/CAPQHuHpBZKmuY+zd0a+g+cIRQtNImkvb9Q2I4U5KW9z2lt1LbYN8IACnPOogZZBBWKo qs/TDrPfb8LixGLV3uNyOpK2+1eXpyqVTUeaHxfXpCtzJzSB51ivmeqE= X-Received: by 2002:a05:6a00:4403:b0:834:e882:3280 with SMTP id d2e1a72fcca58-83f33cef68amr23860627b3a.31.1779292047402; Wed, 20 May 2026 08:47:27 -0700 (PDT) X-Received: by 2002:a05:6a00:4403:b0:834:e882:3280 with SMTP id d2e1a72fcca58-83f33cef68amr23860591b3a.31.1779292046897; Wed, 20 May 2026 08:47:26 -0700 (PDT) Received: from [10.204.101.125] ([202.46.23.25]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8413ac7b2b2sm2366282b3a.14.2026.05.20.08.47.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2026 08:47:26 -0700 (PDT) Message-ID: <209f8a94-957f-4362-9e17-40e74eed4d7c@oss.qualcomm.com> Date: Wed, 20 May 2026 21:17:21 +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> <8f708b87-92d3-47ed-8cda-1f34b512816c@oss.qualcomm.com> <0534f746-c776-4688-94d3-85a7d7f2d25e@linaro.org> Content-Language: en-US From: Vikash Garodia In-Reply-To: <0534f746-c776-4688-94d3-85a7d7f2d25e@linaro.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Proofpoint-GUID: k0R84BA1PMWSFx-w1xgpCKRmNVaux_6Z X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNTIwMDE1MyBTYWx0ZWRfX2xbBiilYDpLS FJG+x/fsm/UkEXI9Tf9TEsWCMGgBdOcCKWLW+NzSnZjRM+f1H1z/A61i1np9ARXWicCgj9Cl6Kt UBs5s33LiJoNQorPx4EVutxXb6/5rG2fuh/DCjGxL+MBxqKo6EgBrS4f9mZY37X3Wn+FMqPe9Ew LcuHIR7bNu0JVouN6N5ZbSXYDAx8jeCyNTmmI9Z0yXtBXCU5xnG3VDkjbGn7/0Oq/dtYHYpaDua hWHD8Zk0PiUjLrGjxeSriBjH+4sk+L8tLmhTLbm+x9aDKJ9ygmiylmxy8nbzAfFoyagdDi9jQaB W8i/53qbO5QcY4Vl1jQcljfrbBI59v96voGDiFXzAvNQERM3CdzLsC5FI9N1yWKy/zeDO0eVHNd 1kapWxA56Hw67s0nAqDcqG1ECmuadmmswgOplhpMVgPHkEQfvsQR5+qweBkbKkuxwenZ3HOJt9a JKaYJAiqIj8jQX7MCzw== X-Authority-Analysis: v=2.4 cv=TO11jVla c=1 sm=1 tr=0 ts=6a0dd790 cx=c_pps a=rEQLjTOiSrHUhVqRoksmgQ==:117 a=ZePRamnt/+rB5gQjfz0u9A==:17 a=IkcTkHD0fZMA:10 a=NGcC8JguVDcA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=KKAkSRfTAAAA:8 a=Bh_PGqYUQJUX1eTUZJIA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=2VI0MkxyNR6bbpdq8BZq:22 a=cvBusfyB2V15izCimMoJ:22 X-Proofpoint-ORIG-GUID: k0R84BA1PMWSFx-w1xgpCKRmNVaux_6Z 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 priorityscore=1501 malwarescore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 suspectscore=0 spamscore=0 adultscore=0 phishscore=0 bulkscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2605130000 definitions=main-2605200153 On 5/20/2026 9:09 PM, Neil Armstrong wrote: > On 5/20/26 17:30, Vikash Garodia wrote: >> >> 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) ? > > No, it's early src/sink negociation capabilities with the special DRM > DMABUF format to handle the QC10c, way before playback starts and starts > the v4l2 dance. > How will it know its Q10c, even before the playback starts ? >> >>> >>> 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. > > Hmm, so my change is correct ? Yes, to me. > >> >> +ing Nico and Hans incase they would like to comment on this. >> >>> >>>> >>>>> + >>>>>       return &fmt[i]; >>>>>   } >>>>> >>>> >>>> Regards, >>>> Vikash >>>> >>> >> >