From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) (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 98EF73EFFC2 for ; Wed, 20 May 2026 15:39:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.52 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779291569; cv=none; b=VC2nIjbhow2r6+TlVVRNWrhUbpgr2qb+0Y3A2zuzwAtQV1IPRpEWWKQAoMHks9RfG6AjUn74bsA63hmc668n+6SIoIy5nMETgYrULj5xvDB6m+AmW1FY2ybX/0jTJut6bo+eJws0qBic5kHuO9VT2tsx7TaEWmfYpX0G9KZhnAA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779291569; c=relaxed/simple; bh=KbXaSdV7WxpOPqD2cxuhH9+1lycmCROIX0f80cfBOfc=; h=Message-ID:Date:MIME-Version:From:Subject:To:Cc:References: In-Reply-To:Content-Type; b=MDp6aYXMpDy5+e1SrNkqyzV3OS59jzuFNuvJtz+2c2/5S3H4ymMtu/I3A9x7OWVi1ZGq0NWDQMqqBfCj0R2ONRSA1D7/kAfylP6uIdv6Hn9WmBQ1MRyT4jF1bRLnDxyRO/hGQHnTVG27kVylMxWCVjsXOwryQ9bH8SWAlLynNew= 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=pafoac5n; arc=none smtp.client-ip=209.85.128.52 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="pafoac5n" Received: by mail-wm1-f52.google.com with SMTP id 5b1f17b1804b1-488a9033b2cso41464475e9.2 for ; Wed, 20 May 2026 08:39:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1779291565; x=1779896365; 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=B+eBwUWRmIi3nEQfvUo1Cl/89ojK6tjIV8v0d34bhFE=; b=pafoac5nrjb2oG1mJ441k97Hv6Rd6ohN0o6ndRK3SpokVOoNOid4zRv50s/fGh3CPA HEM5lXll9DL08G9qQjuENfVv+O+NfRUcW9BxMA/Khz2X32j7V0w2uxPOq2vBR/TPT94y HycRzAySKzDoxnu3qmFszWifJJJ28xtTavoeFYgiY6/zBsbVoEM8ylQB934ZBGkLx2mg +ec+GxyjdZ1tr4CW4wmwdBMbTCQ0BVSkcBquptbvcQOJOwdVCBwAYOc7ILIL8w9Nd/gl CcV/Mdoy91WR+pLW6dtzfNxt9Lf/Fdqx32+VWMjvFrHRGELJr1BlPeGTtj3QgM4h9D7d YjdA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779291565; x=1779896365; 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=B+eBwUWRmIi3nEQfvUo1Cl/89ojK6tjIV8v0d34bhFE=; b=TgF/K8H9ND0ttGC8EbxTVk475QoyFwi2YORUJJCcoNBYOt5rOUY6YCMXao1p3jrI9s GbTXHamlBx5R59Zdr7JPbEAetABAts8VULNt2kYVqsKZ3g3JcAtY0pk15Ngr30RZc+Na XtRtiXBauWq7epJ/qyXO1h1Ab0Ze+8942KV3T/TlPYHcVF/QE4NdBCKQHigg2MnWF/PE eUBcNHt7OxBn8k0lF9Kc8seQYxuqucS1EzRjKB0VQirNlpeWgj6s1YxZoYxgXMnEMlcu cDRrAn13VMADlCAC31dFp9mlWUe1z6O/+VBXpdl2pSeEiR8sUN3Utpb0engg8CaySVD/ 40sw== X-Forwarded-Encrypted: i=1; AFNElJ/ipAHQJFzBGD6QfBUP2XPO7XQz0059yoI2u8ZiY4gVNubdx+4Tt5BQ0hbHUsT+LH/776Cs9z+CQW4R5YU=@vger.kernel.org X-Gm-Message-State: AOJu0YxlySqWIBDwjCMux2nFC2shPMraXpX9sXZT4/7iyzQ8jbMOanaF cLsx8tUUTUKlfOVED9lXvuKZpllgDuhnhOjaqvYUgFxJSwzBZtubbITeBnuqGTPWTdQ= X-Gm-Gg: Acq92OGePfpIol6sWHybKJoH4dTMn/E+nGQyUmxeVuLfbHyqrJ+HpVreM+vPbuo6UR/ +s74L/8XB2JoxNoP685eK8GxVrka8D9MTeIx75mjZ++h2oFuVLmR3kzetOO4uB63wXjneB6LE7v 2kHPcRVbQOelGzMblPhCcfQ+A0I+OWr/qUkOSEmILZUOd4lsQuPxtZ73KZowvFonrot1355UPuC Q56APehdTRlXoZ1oKj/VhcPRulQbfZjKIHCsYaXKdYm3xDZw682EdEiMCl8Kmt86eNqZe9D4RUy sv17II2lIiSKSnu8tHq2ReahFcSmIiMhm9PD0CEj6hUj6yVk88UxQKS178BA/+LqP6k09imbnvo 8yjiSkc4ZosTyUJDm10eSr5qMaHwUa9H3TH3dDgzY0t8h9LW5YZzCzIbY/WtBAcOztOxAMIUlQg A4CDLi7HaloEuKkgivKBfJtTp6EbEQHIdyFcqTWPKiKDVae9YtKe0EZ9GUbzz+yCv/HEhUR9PSJ 2PtZlgmG/Pu X-Received: by 2002:a05:600c:a30a:b0:48a:568f:ae8a with SMTP id 5b1f17b1804b1-48fe5fda35fmr293645575e9.8.1779291564817; Wed, 20 May 2026 08:39:24 -0700 (PDT) Received: from ?IPV6:2a01:e0a:106d:1080:dec9:6d:b572:fe67? ([2a01:e0a:106d:1080:dec9:6d:b572:fe67]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-45da0a1a22csm54269593f8f.19.2026.05.20.08.39.24 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 20 May 2026 08:39:24 -0700 (PDT) Message-ID: <0534f746-c776-4688-94d3-85a7d7f2d25e@linaro.org> Date: Wed, 20 May 2026 17:39:23 +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 5/6] media: qcom: iris: vdec: update find_format to handle 8bit and 10bit formats To: Vikash Garodia , 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> Content-Language: en-US, fr Autocrypt: addr=neil.armstrong@linaro.org; keydata= xsBNBE1ZBs8BCAD78xVLsXPwV/2qQx2FaO/7mhWL0Qodw8UcQJnkrWmgTFRobtTWxuRx8WWP GTjuhvbleoQ5Cxjr+v+1ARGCH46MxFP5DwauzPekwJUD5QKZlaw/bURTLmS2id5wWi3lqVH4 BVF2WzvGyyeV1o4RTCYDnZ9VLLylJ9bneEaIs/7cjCEbipGGFlfIML3sfqnIvMAxIMZrvcl9 qPV2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bRuiSZS1unlySUVYu3SD6YBYnNi3G5EpbwfBNuT3H8//rVvtOFK4OD8cRYkxXRQmTvqa3 3eDIHu/zr1HMKErm+2SD6PO9umRef8V82o2oaCLvf4WeIssFjwB0b6a12opuRP7yo3E3gTCS KmbUuLv1CtxKQF+fUV1cVaTPMyT25Od+RC1K+iOR0F54oUJvJeq7fUzbn/KdlhA8XPGzwGRy 4zcsPWvwnXgfe5tk680fEKZVwOZKIEuJC3v+/yZpQzDvGYJvbyix0lHnrCzq43WefRHI5XTT QbM0WUIBIcGmq38+OgUsMYu4NzLu7uZFAcmp6h8g Organization: Linaro In-Reply-To: <8f708b87-92d3-47ed-8cda-1f34b512816c@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit 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. > >> >> 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 ? > > +ing Nico and Hans incase they would like to comment on this. > >> >>> >>>> + >>>>       return &fmt[i]; >>>>   } >>>> >>> >>> Regards, >>> Vikash >>> >> >