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 DCBD73D75A1 for ; Tue, 7 Jul 2026 22:29:23 +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=1783463365; cv=none; b=X5jDRI+ERfeaqnZECHLA8bwduhOuvrN8tADxb65lQ5eVrXpBZ1rb7Evz4x8bnoXLfua36SaKI2XlWGyi79ys88nJrESmgh9AQkODNqZ3PwP0MOHcuKUKtR9TKgR0KmsjJc5DIKl8fTMyrSm+oBuJsurgOhzTlJA7poq1hyx8jlY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783463365; c=relaxed/simple; bh=acnsSKVi2aqjcn7maAiEpfFJlJtCDzjZpY88Lh3Q2Mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=difu0ADjmg0Cwngq6vz++i2uQswPm/TpTX0kK/uWmTxu9AuBQg6nmpFjGU7YyfamJbMsyTeQCRb7TyJaPmd+tg4ppU38h2mAU5aNxG6TyrYeEWKY3DM6TK09YOZfkOxGs2tN7TQ/+aS+K8ICxQv8DJDyZvjGrFBob2Jw9xg6CiI= 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=S0ZxeO5E; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=f+xXrhda; 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="S0ZxeO5E"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="f+xXrhda" Received: from pps.filterd (m0279871.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 667J5YxG504911 for ; Tue, 7 Jul 2026 22:29:23 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= ahPRS5ACQmds6jy0ulyWNZqZH4qS5C1qdXBV3RFWmSE=; b=S0ZxeO5ESh+IYmYd ebndsYR4vFL7FSGBqOy18kymau0Q5/8KBEdhJyzfBGGwNaDUQZyupxkdPIi6O3lD 7f1R5JroS/SBbGJTb0OuZ+xEj3CuCqeR7j1oYq8OJz4v+8atkQiUFkRYhStB5oYq v2P5DfG6mJGOsVIIXUB7UnRRRqT04opB3/uGCbmSkyspETPQdD4WUMeoC5ZoKzar lEV/Rq3DBvUiHNzGNumfyATcSjdb9PkEYZixcqToEqe4ioMFKKB7QKEaEly0uRsA qvy3eTQsAqUxUVQKXGHr0YJ8MniTyzh5XBBKPWHEAS+EtV6rW7UAWh1nQhKKTAmj i0AJdg== Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f8vdjc0ra-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 07 Jul 2026 22:29:22 +0000 (GMT) Received: by mail-ua1-f71.google.com with SMTP id a1e0cc1a2514c-9692df7e2feso35138241.0 for ; Tue, 07 Jul 2026 15:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783463362; x=1784068162; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=ahPRS5ACQmds6jy0ulyWNZqZH4qS5C1qdXBV3RFWmSE=; b=f+xXrhdaScY5nQOZG3wWV1J7rkyO4sFgAffKgNHPQuLM8nv6YGf9zEUXX8W9n/CBE1 4hdn14eeMNYVNrPsw/5aoiXxW0YR5ON639HXpyZgy5PcqD5eeH/GfR8mKoDvXXyuC4Ug xK7+5FMKdsH/B5ZNnNGH3ICjv/VldqhEQn8RoZq3KbBBJ2F1edopnlS+/Z/VGejKfBqQ 2e9F60R2tJKfSQAPSjMK2BwP5LeOhgWiiSkRhZNMMsoUQEW7MWw0NhStNkDGemcWA9pX Q0bq0S/akAKKvJuTlA66cqGBH0Mfe94596biaOB9b513yXMG5LwCvXaLrx5A3zueBSV7 q85Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783463362; x=1784068162; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ahPRS5ACQmds6jy0ulyWNZqZH4qS5C1qdXBV3RFWmSE=; b=n4wmMnI0AqJ7p7TsFWbrUr0x5+azWfOQUtKv/P2GACSfaP7WFi+J3z1SzDvR3pwZ74 NoiLrVEMLwEK0Yo5HFESmTD9Y+ZPWBtCRVwC2vN256W4lLZaTi0zyl9WV6ItH9xsQjjQ Cf4j201cDU5L8BVN8fn7WpqNywjTKQn7deVRijazWQE9bqOihmqLZBM5qJJP7OWGSmdF zMbu03x7p2h7dyGnwfQQbrMQ9KEVzRDjQxZ1pHENeX+X42L9m/dEwsGxET29yVPiDt1T VhjkJ1PYTHLtrvX7K1iyHt4TGJNxZGVjTxRziFGo3rAlTVJBwPkb5ldNOlM7T15P4aR7 YmeQ== X-Forwarded-Encrypted: i=1; AHgh+RpE/wfy83NtLuG3p0FSSyylBZR1IZWac1KHhHFbs5gSoIjpWOXVjaeGMJrSLaLhSw8v9rOLDWZ3MbCq@vger.kernel.org X-Gm-Message-State: AOJu0Yx0LMdILX0m8V2hBHV0ZRVusYsn103wMttWOyYepsAm6L0Ouo6D 0jOpikMtFd+vJsLvxSCg3QWowCIuFdibr+Hg3UUz82sFEGbskLLzJWqMWZRDA2xNiV8Cht9Q89j n63Cb5QJQ29JdhPnKWma/BGPdg9SavCdV8sHVMurJ+5DbrOAFC9eKBC5IBG4nDGU2 X-Gm-Gg: AfdE7cnFPFzSUBIGUS21JoUKEaXtO2iYAe00BhplgeY9g5sbGoC8FWuf/cP3x77F/Q6 +E26mbdXnu6kDHQIDJ1xD3HX8ToKCw+Yw8kr3dP9ksIZzNTomzLfKRj9Gd3IlXw9aJsQaUPW6cS RkqQkN3ItgwY8jpEFfmge7wls/WA80A/ULbR8olK6b3fy/g2E0nacDfAP9CH5R3DqfPKwR3Nbec 6nCkqJGBGCuornBOOOlrrPKUefOzHgFljsjIUkk5A0u9kimEBoD1QL2sTVR7tGLb4H3N9u0Yeun q5w0lg6A5JxtkqXwsgkcn4z5tPTbqiALuZ6SvhSap1GsShX1crvJig1bTAWlDcuIPMYy0uOvZAS GN04O66tXGq3jZmosrv2saGwGwrb4cWC6voYPgiyudEwrtkEIGYMXunZDjRWBsc2D/LDdINiGOk DykFt75d+KgTHf+iVY1/3mzM4k X-Received: by 2002:a05:6102:3589:b0:729:65e:f08c with SMTP id ada2fe7eead31-744b76d9601mr3858988137.0.1783463362265; Tue, 07 Jul 2026 15:29:22 -0700 (PDT) X-Received: by 2002:a05:6102:3589:b0:729:65e:f08c with SMTP id ada2fe7eead31-744b76d9601mr3858974137.0.1783463361755; Tue, 07 Jul 2026 15:29:21 -0700 (PDT) Received: from umbar.lan (2001-14ba-a073-af00-264b-feff-fe8b-be8a.rev.dnainternet.fi. [2001:14ba:a073:af00:264b:feff:fe8b:be8a]) by smtp.gmail.com with ESMTPSA id 38308e7fff4ca-39c7312bc25sm1897231fa.40.2026.07.07.15.29.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Jul 2026 15:29:19 -0700 (PDT) From: Dmitry Baryshkov Date: Wed, 08 Jul 2026 01:28:47 +0300 Subject: [PATCH v6 04/18] media: iris: Filter UBWC raw formats based on hardware capabilities Precedence: bulk X-Mailing-List: devicetree@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20260708-iris-ar50lt-v6-4-374f0a46c23b@oss.qualcomm.com> References: <20260708-iris-ar50lt-v6-0-374f0a46c23b@oss.qualcomm.com> In-Reply-To: <20260708-iris-ar50lt-v6-0-374f0a46c23b@oss.qualcomm.com> To: Vikash Garodia , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Bjorn Andersson , Konrad Dybcio , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Vishnu Reddy Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, Dikshita Agarwal X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=5132; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=QN/GQkI9t2+DaweZ0uUnFoB7t+XgnQ7MgtUodJ5uTko=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBqTX2ojKjhpc7Mn1RilS1YROvN5jKC9Y8cKqhhe bG8arYYw/GJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCak19qAAKCRCLPIo+Aiko 1V9rB/9STSCSCBKkSxslInLYoZung0yonFVg0rRRkhMjx9IPwkLFhHb7GrMX/sAZVxqZwiI4qYL U2mlYlvanIa5KbUOmciHNBEuJl0Vd+E8iCX/wZLmc7IZtA1cU57q8NSg6Dcx6klOWN/gHjflMDB woNntrfOQPiHE9Wh4kfIwXDj4fVxjyyXOQU1ZvFlJb7PAOA+aW5qgK/4oBxXxc7m9jn/a3YTD6j SQ1qh649oUyk7juoJ4CIQlwVcnw06fURP0tzbEIoWaHsvnJPxF5Qkx6Zv/9c0X8lv0Hs4E/K6Aj mLLQftbP64B3yxlryWXmhY8pzenTJ6R/LjbGPkVhDF4r4Foj X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=R7cz39RX c=1 sm=1 tr=0 ts=6a4d7dc2 cx=c_pps a=KB4UBwrhAZV1kjiGHFQexw==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=3WHJM1ZQz_JShphwDgj5:22 a=EUspDBNiAAAA:8 a=gsa84qigJ8via7s57H0A:9 a=QEXdDO2ut3YA:10 a=o1xkdb1NAhiiM49bd1HK:22 X-Proofpoint-GUID: k_dYzM13JJWttFWI9-ZE9glZP9U6LsZs X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA3MDIyMSBTYWx0ZWRfXyMV5emsZZoxN HD0N000aSPsAgWdqtoApZp4orMgVArIrKImXh/F17pOStvuwb73/a4U7YBtsVXrl6wGtQDlw07r 21e46fa6EiHX35+iXQrW3/szKL85/zs7gwJ8aRyLwsht6zxgk71/2Lsr/PQ+op3wh97bwHUm1Cn uGikW/ITbVKi/KFKswcFYno7S0v9nqJClnnIOyygJiN0tcZ0mZtr4zycvRp2sHSwoqpTfh5dZaK ytNs/nYCmnx/P+Z2Xad/8yLXYNNLjYz/WqKH/TWhzIL6GQdKaFy+5PnPWEJcfAxuvbsOIolaYYR Ru08kZecH9zKjhcheBmmFmArsQVlc4fYkLY7pUwsUXpVutnp/G/diUQ8T3kIuiecjWOa2RND0Hd f3ZBjLzP+UyPakQJO6zj+QdIG+Mfc0aOofDlcREsFErYLXpmpBtqY9IInkpDsM3TejBW+M42NBq rXvzRd1EwZfq8zZiaZw== X-Proofpoint-ORIG-GUID: k_dYzM13JJWttFWI9-ZE9glZP9U6LsZs X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA3MDIyMSBTYWx0ZWRfXy3eZzUouN6x7 +BI6raZ0LqqYlhr9dnxKcwizgPs8387ZmeZT1uJYZ4vjTTgy4yxdcLHDzy70jtQmiYnS+AV+BWI 7g53rA32Ctq2k74ESLPrQ7eMpU0O/j4= X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.134,FMLib:17.12.100.49 definitions=2026-07-07_05,2026-07-06_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 lowpriorityscore=0 impostorscore=0 clxscore=1015 malwarescore=0 bulkscore=0 spamscore=0 priorityscore=1501 phishscore=0 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607070221 From: Dikshita Agarwal The raw formats supported by Iris were previously advertised unconditionally, assuming UBWC support on all platforms. However, some platforms do not support UBWC which results in incorrect format capability exposure. Use the UBWC configuration provided by the platform to dynamically filter raw formats at runtime. If UBWC is not supported, UBWC-based formats are omitted from the advertised capability list, while linear formats remain available. Signed-off-by: Dikshita Agarwal Signed-off-by: Dmitry Baryshkov --- drivers/media/platform/qcom/iris/iris_vdec.c | 26 ++++++++++++++++++++++---- drivers/media/platform/qcom/iris/iris_venc.c | 25 +++++++++++++++++++++---- 2 files changed, 43 insertions(+), 8 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/platform/qcom/iris/iris_vdec.c index 4c8bc7aac135..9fee5f28097d 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -3,6 +3,7 @@ * Copyright (c) 2022-2024 Qualcomm Innovation Center, Inc. All rights reserved. */ +#include #include #include @@ -69,8 +70,14 @@ static const u32 iris_vdec_formats_cap[] = { V4L2_PIX_FMT_QC10C, }; +static const u32 iris_vdec_formats_noubwc_cap[] = { + V4L2_PIX_FMT_NV12, + V4L2_PIX_FMT_P010, +}; + static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type) { + const struct qcom_ubwc_cfg_data *ubwc = inst->core->ubwc_cfg; unsigned int size, i; const u32 *fmt; @@ -80,8 +87,13 @@ static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type) size = inst->core->iris_platform_data->inst_iris_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: - fmt = iris_vdec_formats_cap; - size = ARRAY_SIZE(iris_vdec_formats_cap); + if (ubwc->ubwc_enc_version) { + fmt = iris_vdec_formats_cap; + size = ARRAY_SIZE(iris_vdec_formats_cap); + } else { + fmt = iris_vdec_formats_noubwc_cap; + size = ARRAY_SIZE(iris_vdec_formats_noubwc_cap); + } break; default: return false; @@ -110,6 +122,7 @@ static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type) static u32 find_format_by_index(struct iris_inst *inst, u32 index, u32 type) { + const struct qcom_ubwc_cfg_data *ubwc = inst->core->ubwc_cfg; unsigned int size; const u32 *fmt; @@ -119,8 +132,13 @@ static u32 find_format_by_index(struct iris_inst *inst, u32 index, u32 type) size = inst->core->iris_platform_data->inst_iris_fmts_size; break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: - fmt = iris_vdec_formats_cap; - size = ARRAY_SIZE(iris_vdec_formats_cap); + if (ubwc->ubwc_enc_version) { + fmt = iris_vdec_formats_cap; + size = ARRAY_SIZE(iris_vdec_formats_cap); + } else { + fmt = iris_vdec_formats_noubwc_cap; + size = ARRAY_SIZE(iris_vdec_formats_noubwc_cap); + } break; default: return 0; diff --git a/drivers/media/platform/qcom/iris/iris_venc.c b/drivers/media/platform/qcom/iris/iris_venc.c index 16c52ad07e2c..2f2c56bf9122 100644 --- a/drivers/media/platform/qcom/iris/iris_venc.c +++ b/drivers/media/platform/qcom/iris/iris_venc.c @@ -3,6 +3,7 @@ * Copyright (c) 2022-2025 Qualcomm Innovation Center, Inc. All rights reserved. */ +#include #include #include @@ -89,15 +90,25 @@ static const u32 iris_venc_formats_out[] = { V4L2_PIX_FMT_QC08C, }; +static const u32 iris_venc_formats_noubwc_out[] = { + V4L2_PIX_FMT_NV12, +}; + static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type) { + const struct qcom_ubwc_cfg_data *ubwc = inst->core->ubwc_cfg; unsigned int size, i; const u32 *fmt; switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt = iris_venc_formats_out; - size = ARRAY_SIZE(iris_venc_formats_out); + if (ubwc->ubwc_enc_version) { + fmt = iris_venc_formats_out; + size = ARRAY_SIZE(iris_venc_formats_out); + } else { + fmt = iris_venc_formats_noubwc_out; + size = ARRAY_SIZE(iris_venc_formats_noubwc_out); + } break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: fmt = iris_venc_formats_cap; @@ -117,13 +128,19 @@ static bool check_format(struct iris_inst *inst, u32 pixfmt, u32 type) static u32 find_format_by_index(struct iris_inst *inst, u32 index, u32 type) { + const struct qcom_ubwc_cfg_data *ubwc = inst->core->ubwc_cfg; unsigned int size; const u32 *fmt; switch (type) { case V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE: - fmt = iris_venc_formats_out; - size = ARRAY_SIZE(iris_venc_formats_out); + if (ubwc->ubwc_enc_version) { + fmt = iris_venc_formats_out; + size = ARRAY_SIZE(iris_venc_formats_out); + } else { + fmt = iris_venc_formats_noubwc_out; + size = ARRAY_SIZE(iris_venc_formats_noubwc_out); + } break; case V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE: fmt = iris_venc_formats_cap; -- 2.47.3