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 987B0326938 for ; Thu, 9 Jul 2026 13:42:12 +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=1783604534; cv=none; b=VchLDjR68uQdH8RpMykzI9CRfb1h17meY3VXJwdYKMIMBMZMlZAzMzMd1JGNaCqXDyHAne5VtiuDBRQnWahD4q4aNBlFugIdB+t8R1g2geN3I+7xvPhZf43Y1pUivq8QwYnS6d7VexA03BHnjdFiv9XNvvqmqkOaCMhveoe5iis= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783604534; c=relaxed/simple; bh=acnsSKVi2aqjcn7maAiEpfFJlJtCDzjZpY88Lh3Q2Mc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gkLepiN09MvDvCWA09VhDng3D417ERuNV8WvAeNlw1MC6zNzmYG6y1/iFl+u1XqGtwcObPaCb+qCGJm4z4TBXcuaO1DmjL2WFRmddo+dlrTBgsLQNia35gUWZzP604YDTL9cmYL1vIxzkFi68LY6N/AJruFen/WVpeAXPdElVcU= 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=cO6M203q; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=I7gHr+Yg; 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="cO6M203q"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="I7gHr+Yg" Received: from pps.filterd (m0279869.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 669BNUFJ1672682 for ; Thu, 9 Jul 2026 13:42:11 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=cO6M203qZaAkVx0t tRs11xo5OK1AxwHsjmLF6x7TNpQVlT3Y4b0oxz/KaVblLZX3TceNR3kAALjiaChz D6qJwINTGHUPXx1lzAuy9zU2w0KzyBwywVk5VcEqq6+O+kNb67ykEtmB4KO6KP9N mRkriKwl3Tibkua/oyxg1d9ra50K2UR6ILGRql7WhuXBEmoae+UAIUHZ9VL8GESt veYIe/+nDw073zMRlTEzH8Pg6qa7HNICbUqtJhVILb+1eOTp30FCC9U0tjSmgiTa D1DdemG0HaHGYC7vSc6Lkp9+KIV92yLMqU9KtyoIktfjAieDI/9cEGYP/c6qWZI7 g5PwtA== Received: from mail-vs1-f70.google.com (mail-vs1-f70.google.com [209.85.217.70]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f9sqschmj-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 13:42:11 +0000 (GMT) Received: by mail-vs1-f70.google.com with SMTP id ada2fe7eead31-738d9935e23so366909137.2 for ; Thu, 09 Jul 2026 06:42:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783604531; x=1784209331; 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=I7gHr+YgI9D1RqgVocx7YE1qvkQMpkJhPGlMAK/eTaQq1KiaUIAuwzz/m1OcGpVvP2 NriJiLc4chgGlxkuTbVsTIto4YhfMCy6UkQFipmlpQRQ7egy9ZkD6iF/cD2Vt2xak3q2 9AjARH0F9vQDAXjSS30H3mXwchozgZaNKVKkUYeq6a6SN4yFxe+Ne9ALvC9vT7fs6TY6 iLfCRS9LCr4LcXw3dUVP3RQ4EWjlD+BrHFTz/DiBMZkMT7LIM4uN3PM0I3jw9UXyLKza s/4xFhQPyBYBLCsc33yCXIT3uXOn/lKjGUegJ2a3Lbv3JBs/QRiLguCUuIywb43pGa+p tJDQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783604531; x=1784209331; 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=Hipu0OOBaphMoSnq4e3rLhD8rTSe8xqzR6SyIcEQCjlIdMS+U++llhTll/OzBqbcQC GizNfZSaUudx08UmaHPCl6khrJAVyyzajlLzl/yJxXBta0zq4/ZHiKkTQ5UXx8hi9qFF uuJqSVXzH/Vmtmwzl2hDtSeJmjAsEyiwj/wYQ7xJ2htp/YxciZLKq6dF5Jge5pY9YOHZ F+1BgaWZV9lkXH2SuS67tz8Nj94GKozha+tKDyh+eVWVVsUFpzHZgrzTskh0d5Two1Rn WpqshyMhRkz0aWRcY1NEg2VtxNOy8ia9KYjQw3oBHYzXgmQ66sHTcaIcuKhXwCWMqkYl bKJQ== X-Forwarded-Encrypted: i=1; AHgh+Rqv2UV9c/ZAzVJvL7qi2De0WefXyiTV08aX6hljqnuMy+5McoT3DNOFlHXk+83QcumoJsbAie5PBPxbfBE=@vger.kernel.org X-Gm-Message-State: AOJu0YxSd7IwsYk6/zY7Xk0AiF7evxFuDv0pfSGJAs0I4c9KafW2BVQO 5mv6D9wyMzz/vehcVjiIxm9B9UL5qJ5r+0itvZF7HaPjwt0s2qJffdTWRRn75eWLRiP6xM9S3bO nNd7A/Aj+uMhujMF6Orp4aA1eOtBv9cL/4+TBjy+XFrtNb5oBoOEYvIP6XqFLZ9NPPew= X-Gm-Gg: AfdE7cmLWCMrbwU+ecAiRrFRezwjTSgphuS0cClRhRHh/SFJUu57c5l90R1nKOquI5E D4/KZ+Q83+VA1upuB/44yF14TQ0Jb2f9zfw54lcc4KilwmFXPx7zbUQzxM20Byj3+xVDq7aDLD4 uslLO/Qs0tCzbAZiyM5cd1H/muCc8bSCbbbwcrtCHOESRcHuAJRienFljio2Re6I8H1Wt3nV8Ql 8xo/irj2vNUoSd7xizO1gt6kuNSLEHcyhV163F2Tvp7YD5ne7DT7Nz6kJogFgck13ULbteeOqKa ujf8i8DNpxSQZmYFAeJjUjVYCOSKrT8u8qYKQ7BlcmlonHWmxZLKpGl8nxR5ucxjMsljcF3H1Go 5aB7RkT7QhWH+Cd67Gy7ytbW5QxACLSog5MzZW7dixZntSq/r2laPgHxxZQrEtuZb45aI07U6vR S8XzGRnD4LNKuW6RZYjpxFcPK8 X-Received: by 2002:a05:6102:688b:b0:739:18ea:565f with SMTP id ada2fe7eead31-744e0310bcbmr3879456137.21.1783604529707; Thu, 09 Jul 2026 06:42:09 -0700 (PDT) X-Received: by 2002:a05:6102:688b:b0:739:18ea:565f with SMTP id ada2fe7eead31-744e0310bcbmr3879411137.21.1783604528742; Thu, 09 Jul 2026 06:42:08 -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-39c849186e1sm3345151fa.9.2026.07.09.06.42.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 06:42:07 -0700 (PDT) From: Dmitry Baryshkov Date: Thu, 09 Jul 2026 16:41:55 +0300 Subject: [PATCH v7 04/18] media: iris: Filter UBWC raw formats based on hardware capabilities Precedence: bulk X-Mailing-List: linux-kernel@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: <20260709-iris-ar50lt-v7-4-76af9dd4d1f6@oss.qualcomm.com> References: <20260709-iris-ar50lt-v7-0-76af9dd4d1f6@oss.qualcomm.com> In-Reply-To: <20260709-iris-ar50lt-v7-0-76af9dd4d1f6@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/pANAwAKAYs8ij4CKSjVAcsmYgBqT6UkHPvbbqFQnR8/r4wF4+bOR69aivY98++Bc bTKVYb3bDuJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCak+lJAAKCRCLPIo+Aiko 1QatCACGpcvMXpTn4K8hntSyBuA+tEaQRVaL1pf6Tpr22MZzSC8ZqQ3iXq3EjJzSNwmE23G0WtC QVgQlx+gucW7w3OJ1vhTGXziJPHRonHR1zvbiPa9iMYN7n4wJKYDt9fHy4Z6OrTSE2hN+FHuyBP bLKl8Gs6cM4cEgpCGa7uoOeaMprJVCG22Kg07lE2NQuwUQR5v1fYPAtM2Et1KxFgPTcCvuobjIe K1UTNHZGTiTWphZ4cX5LlDNXwtApniu10ExsVKYHiVHPAiHDAtUO0/JNVhACo622J0l9WxDDLi/ rv8bNGVWZYmcWtX2X4JRzNbHsZUPnPSrv7Dx+md3YO0nvu/x X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDEzNCBTYWx0ZWRfXyKCIYfrsLKgq UW/OxNltHp/WZsdeaIQBWzxCD8g+YfPl2cWnk6AdTLaMhlz2QVEldulFPkTsrMQoQmkNG4NPisM pR6jqnRt8PECgfN4rndY6mAy9suRxmQ= X-Proofpoint-GUID: EkPnse7eWFrTyMk45Lcy913WCCRxbhOW X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDEzNCBTYWx0ZWRfXwUvQjJmM0NSP XYBFN7dIu+QlwxG3k6BhF531MrD3WKjkP005pobI0T7h+wok2DVHoX2ojMGtNW+fo/7VAfEu3VH 4v/4gOzC8wR38E0L6n+B3rTWhB1mshPErnKSjltXQQAvXcf9/kW/1cACSup1AvMOtlaiStFqNYH Qf1l/fhoxdOOzIyH0vwC4x6XmEeJRoX13YQilE6MmLd/oyJs51wgrvM65tIAhv+o+hzxglcbY4Y d4a1AoYA0nvcIgeGQbPnMqJesId6JHg3SPalMF/yPaNRHK1NhgBOYWYPXhzkHX2EgawBM39tsE0 rZ5lkIgKoxdwqFHcjmDv8+ZDPgB8qKQ2g0OTD4PyDrbAh2PYilb/WfIYq8athtIRTvQlAB/sLU+ MqIWRLWHiPDT+Ar3BUO8pKi+7upZVvTVwCDskTB5ChCPzXiTamML+dvy8x6C6MeZbRM8WXEjoKp m+Oq9cxaVCgM7ibfOWQ== X-Authority-Analysis: v=2.4 cv=Sv2gLvO0 c=1 sm=1 tr=0 ts=6a4fa533 cx=c_pps a=N1BjEkVkxJi3uNfLdpvX3g==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=gsa84qigJ8via7s57H0A:9 a=QEXdDO2ut3YA:10 a=crWF4MFLhNY0qMRaF8an:22 X-Proofpoint-ORIG-GUID: EkPnse7eWFrTyMk45Lcy913WCCRxbhOW 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-09_02,2026-07-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 adultscore=0 priorityscore=1501 suspectscore=0 malwarescore=0 impostorscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 phishscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090134 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