From nobody Sun Jul 26 01:51:19 2026 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 4C4C235F16C for ; Fri, 10 Jul 2026 02:54: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=1783652070; cv=none; b=JYLx2ek3qceJJDG4hCHcR09ictk5aKQETUyC/kKHEPa23iaw22yU3E59fUaI2vNs8gTj1VDW/sI7reXdZlraRPI/42XNlAAkHJ3j3C/qaMVctr5sN+GPcpeRZJEmspKlthAnGec9IwfdSTCGgxNmXyQoWHRxbJ0X3zIapGpPato= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783652070; c=relaxed/simple; bh=ZRQ0rtnnQB0Oq2dtTeQphk53sePamjzWEWuDue98Mlk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=PRS2+e9kMq7JpZk3eXVhhqof6PxQFXgASyGVd5BogRV+AbF58ux9Ch++pVkoJwRj+mh6z95w+h9TZSY/OZaZnsYXuj+iWeExvgdHQrM1Afuwlu3+Z/eD1bWqukhtCjh0fQa2OkI4a5e4N1FsCrEEB7SR1gQoXdAbZ5Vnahkgb6k= 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=GnWYbhuX; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=Hdp22n5G; 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="GnWYbhuX"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="Hdp22n5G" Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66A2cJfT2473916 for ; Fri, 10 Jul 2026 02:54: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= 8srnsUWvtGuuuukabgqd6mjKla54hcWqMvwIgpbUTnI=; b=GnWYbhuXMgrgxBbG kJ2uEbofdKwgT0U/ixGKBhVZX5C3pyvYLtXuty7G2FQiL0VW5eet3RWp1rHzWUtg RC7Q2ON3TLDE2wExRm0s9EVQD39ksPMEq6eGSwc1eRrvM5oRaL+i6EzAXpig5KsH VxZ04CzldOOQgMGWC6BbH4pPxz9RhEG3rt1fx6QIqpzNSl4+LHniwzGqxC9/7bGe jpzNsoN27XhsxawFTyfJY4v8x92iyMOFHQUk12vs0j7JI9DPFsn2XPQ0Ytxhmfc5 nwPFH1+3LqWRHw5d8OPSQLQnYFhy2fJkR2wemy/+q99+LSXerKl78orL4gICnUdB YDvN/w== Received: from mail-pg1-f197.google.com (mail-pg1-f197.google.com [209.85.215.197]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4facqpjxyq-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 10 Jul 2026 02:54:28 +0000 (GMT) Received: by mail-pg1-f197.google.com with SMTP id 41be03b00d2f7-ca7c1e22995so838874a12.3 for ; Thu, 09 Jul 2026 19:54:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783652067; x=1784256867; 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=8srnsUWvtGuuuukabgqd6mjKla54hcWqMvwIgpbUTnI=; b=Hdp22n5GJdkupe1PjFq5Jl4/I9pfktiAZPLH9CvPKNwzYj2CecJ6Zc5DOXrfWVbDcM qOJvV/d2u4BJQ2W6x4wNAz5pfQqh+0dW/5LQLe2zalkfbrZpWVaEHWV5fT4YYMSfN029 wva72pyl+6WAYU7/Y+pCdDTJGOqBxcnYFbUcOLW/Rp10p5YGFzhfUnhz1o5XRUPypZpN 9AWjXFR+J7VkvR+W89Z74ozpXFbM/gdxDJA+4wQfithQTnMKCUONYPWUCbXNrRAkbwzN +aa7leuMMmpCEUQ0ZcyNHIUm0E0uVdW5q4Nw+INFoiEGNGvnT5R+kjrDo0paKqHGSVUR lV0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783652067; x=1784256867; 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=8srnsUWvtGuuuukabgqd6mjKla54hcWqMvwIgpbUTnI=; b=dBmhDN9smYqnlwC+UT1gXoXSE3646lcz6Zy6ZHk/DizzEk6HKhvcrGIFUE4PnknVOU TBaAQmrjSnot6UC9htFA4YIWq6459bsr2vz6BmBd3WBKO/nxSAY7HyUK+n6BjKvBivq+ Kp+VyxTpPF5AzdIfYdM2uIgQIP9c+Zx1jGbjX6GiD9uvx87zRuzlTLMGQEKODcqW28r3 QWWVSGNRf9T1dSU8+MVFBfRieU7RtxoK4ikJ32CV7mPhuM53sSMZ2GAzOgWbd0KO1Z/t YmD3srlmidYQ2UjIXqUi6w3KhG7PT6QZRJdVsx505ELw7BoOgZAYd5Wjpc9kybhp9Jr7 RQrQ== X-Forwarded-Encrypted: i=1; AHgh+RrtzfZBdwE1AKZ4Ha7kIU2tXIiFF+bBUnjc+6n6rnvCMlLiyB5f0dZhgoTDWAOTln2Jz2NRh2aQcKIOMSc=@vger.kernel.org X-Gm-Message-State: AOJu0YwLdYbyStE4QbDMDi6fGDHuoATppZ1LmJxdKLQk7xGl6UuYnS42 3be13X5s/K8IdyCfMQ5kBPuxp49VlHhHk3rZq4OaUYG3lsSmavuY+9kw0SU5ZzZqi/byiK89G4O xvzs1rSGsQJPCwNybnU2+LMXYXHxbzAXgYNPa0fgmj/XNyaKKPWyU83IoDkqS4XkAIscjKZ+D7F k= X-Gm-Gg: AfdE7ckc9fTdvfO5QJHWoi2R2VnMDU23kIpAwepOcVDa+HKkM3Lbka3+xjSzI9ZpqZU 5sydw1hxhdNxct9kAKYhs5wE5Yd7qYQjHsyhrscDZjiAQOLRzwXmGzGUsGLaq6hQ7DBzFenrAYb hqBz2VO0F55RK5kYMzuIKnceCaCxdDmTW+uID/jW1BhwkxGQ0KFB/JK/vsx65zATdLLvzpU5zre 77MwrRbrNgPHx+XyLjBSHQl/hiLEtx9Qw62fti2XS/KW5zXCfyogQde+RlsMEcd+KFMf4+d8ePm 5uFHqZADWtUZHxiAIemP1/oZBi+5QVVMjyQHpkbwq0rjwMiGpI7RjbRUYNivqG9yOL/MfD/QgVj sao6vR03ZOMunWguPHsfUZ6Rb5o2OG3cCKqkAJR5CMG6W X-Received: by 2002:a05:6a21:10e:b0:3c0:9c19:65b1 with SMTP id adf61e73a8af0-3c0bd3acfb6mr11104569637.73.1783652067239; Thu, 09 Jul 2026 19:54:27 -0700 (PDT) X-Received: by 2002:a05:6a21:10e:b0:3c0:9c19:65b1 with SMTP id adf61e73a8af0-3c0bd3acfb6mr11104540637.73.1783652066768; Thu, 09 Jul 2026 19:54:26 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b6596681fsm41843220c88.8.2026.07.09.19.54.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 19:54:26 -0700 (PDT) From: Vishnu Reddy Date: Fri, 10 Jul 2026 08:24:03 +0530 Subject: [PATCH v2 1/2] media: iris: avoid bit depth validation for capture formats 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: quoted-printable Message-Id: <20260710-qc10c_fix_and_disable_time_delta_based_rc-v2-1-701d6dfd1ac1@oss.qualcomm.com> References: <20260710-qc10c_fix_and_disable_time_delta_based_rc-v2-0-701d6dfd1ac1@oss.qualcomm.com> In-Reply-To: <20260710-qc10c_fix_and_disable_time_delta_based_rc-v2-0-701d6dfd1ac1@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Dmitry Baryshkov , Neil Armstrong Cc: Bryan O'Donoghue , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy , stable@vger.kernel.org X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1783652057; l=2168; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=ZRQ0rtnnQB0Oq2dtTeQphk53sePamjzWEWuDue98Mlk=; b=15LLH6rKDf939RdkOMJKOw8UWOxgXGNM5upSQQzewjZB15bas81M3g0OgGdZLgTWxxN2+9OVm I+MoJDYRt3wDX0yx5mt73PstfhI/x/CW/Vv366LqmKLKIuKH20eFs0+ X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEwMDAyNCBTYWx0ZWRfX3ucV8iTSNTqh 0FknB+jNLU/YXSANo6yy3ZV0ljVExN2mN2yqNb6CUrwNi1pj/aZk1191rg7hJknVMniBinJnkXY dxZ+4PG0dL6/pU+flWpxZgRst+ysW0hiC0eOwVGver2zH7temsGAeicEXGquvoU8zfjY8RCCW56 pHMmzE7P2If1q9jfLIG4NpSqAgZgLcjyGb5gU2ScseklU7pr/XKKyOtlaPc3Nat0Tfm3Pka4sW0 W0q0vJIz7EveWz9+JdAJeJZ/qnH63gFyatHGgIE92GdZkTmJgKnH8u332A2tjCIPeOuWHyy92Bv /luNtjVobvOG/OzEgHPPXeg/fmZd3Fwl07R4+pxbkgoZod1nsLfJRcszh2+j821w73TARIYGLJi 9lnVFp2zbJIeeVd16Zf9v+LKCCs0lDnX5f4RIJnwuWnASVN4xx8Us08vx/AE1B1lygnnCgFZo4i bU7OcLio31Gh7f7qCEQ== X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEwMDAyNCBTYWx0ZWRfX/rSVAqH2Nsxe D8fwKyCmbeQvMGWm3Iof52MRfITu3rSde+hNFovevFVmQtplgwWu/5MN9fNq+yBrxnyth5YoaZp XYF7bAxrbPBnbPUJcY4dRldDY6/vqsk= X-Proofpoint-GUID: 8W_954WWdvPKRrqyCtE_ANB_zfGBoM__ X-Proofpoint-ORIG-GUID: 8W_954WWdvPKRrqyCtE_ANB_zfGBoM__ X-Authority-Analysis: v=2.4 cv=GJ441ONK c=1 sm=1 tr=0 ts=6a505ee4 cx=c_pps a=rz3CxIlbcmazkYymdCej/Q==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=gowsoOTTUOVcmtlkKump:22 a=VwQbUJbxAAAA:8 a=EUspDBNiAAAA:8 a=vL0Q6q4W2X9FnyRf_zQA:9 a=QEXdDO2ut3YA:10 a=bFCP_H2QrGi7Okbo017w:22 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_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 clxscore=1015 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607100024 When validating a capture format, check_format() compares the requested pixel format against inst->fw_caps[BIT_DEPTH]. However, the bit depth capability is not available at this stage and it contains the default value of BIT_DEPTH_8. The actual bit depth is updated later after the firmware reports stream capabilities through read_input_subcr_params(). Because of this, a valid client request of QC10C format request is rejected during the initial format negotiation. The driver then falls back to the default capture format (NV12) and stores it as capture format. Later, when the firmware reports that the stream is 10-bit, the driver sees NV12 as the selected capture format and switches to the default 10-bit format (P010). As a result, the original QC10C format requested by userspace is lost and QC10C decoding cannot work correctly. The bit depth information is not reliable during the initial format setup, so it should not be used to validate capture formats. Remove the bit-depth checks from check_format() and only verify that the requested pixel format is supported. This allows the format requested by userspace is handled correctly. Fixes: 20c3ef4c7cae ("media: qcom: iris: vdec: update find_format to handle= 8bit and 10bit formats") Cc: stable@vger.kernel.org Signed-off-by: Vishnu Reddy Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_vdec.c | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_vdec.c b/drivers/media/p= latform/qcom/iris/iris_vdec.c index 9e228b70420e..7f89e745a4b1 100644 --- a/drivers/media/platform/qcom/iris/iris_vdec.c +++ b/drivers/media/platform/qcom/iris/iris_vdec.c @@ -95,16 +95,6 @@ static bool check_format(struct iris_inst *inst, u32 pix= fmt, u32 type) if (i =3D=3D size) return false; =20 - if (type =3D=3D V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) { - if (iris_fmt_is_8bit(pixfmt) && - inst->fw_caps[BIT_DEPTH].value =3D=3D BIT_DEPTH_10) - return false; - - if (iris_fmt_is_10bit(pixfmt) && - inst->fw_caps[BIT_DEPTH].value !=3D BIT_DEPTH_10) - return false; - } - return true; } =20 --=20 2.34.1 From nobody Sun Jul 26 01:51:19 2026 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 BD8CA35CB7F for ; Fri, 10 Jul 2026 02:54:34 +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=1783652076; cv=none; b=CaMVV19gIfrhMafF8rGIwJpGYuom/GvFc3DcSVgY2J2wYVk2sVaWyVdnGu7seR8gBDVgI69J2lyXZILf241kGCHuTGZfU1IOpQDcYD9yTjxymUEG8xecjVr5q6YbySYCMeTNSUfEYCOMDhk4QI1hdtkUc4sJ/g/bUwMnmMsJGqw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783652076; c=relaxed/simple; bh=MEBwGHh5shfMGiySRPHB4uwOmtUdd9tYsv727UkgF/c=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gEiUSTDYwZKjo2R3+omq23KqC5NA3jbY/7o+QkpzJlTlVTLcIk7f81h+d0qhyvtIkb5DcQH9DhYRvD/P2rmGPtPI617OyxmdEe0fW5/MduXos7AauWk0U0EVpEqiyJzAv7T+64YLUZ/xuPlJ3H/43Z9lQeIbCIi0I6oUhF2wl50= 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=fZZvbias; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=QOIW6DBI; 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="fZZvbias"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="QOIW6DBI" Received: from pps.filterd (m0279866.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 66A2e9AM2374071 for ; Fri, 10 Jul 2026 02:54:34 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= tvU0gLu5NtfYawM0d1Vc1oj+pO8tTgyMhhGwGgUwk0s=; b=fZZvbiasVsHNNfHh 1f3RStuiqw2kkdQBMKq3KqjOKXqgpnm9btKLATJNo/3yHoy4E0uDRoOVKh5mfmJw 3n6NmWMLb6APIXHWYdwcrxmo9MCynQ84vXzDT9dlrsszfMeRo95KGGRH+tVZ94iR rH8VKwKwg96y4WuTxW1EjTuWj8ysU0yA+Z+BIgYx0tPdE+gkaKyEZRDVakNl3k7y B7WbGk0DHjNUVzWOeUI1pVQeRj08XZOX2ASEjcU3RXCKoYvjR2CT24LmSRGWGukH 4iJx6oQW7vdbtjvt6WJJNovn06HvmP/HEmPdAUHHNy3oY+F+2s8ooPThL6jQQUdN CGt1hA== Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4faeg5jden-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 10 Jul 2026 02:54:33 +0000 (GMT) Received: by mail-pl1-f199.google.com with SMTP id d9443c01a7336-2cc73f47bdcso7088365ad.3 for ; Thu, 09 Jul 2026 19:54:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783652073; x=1784256873; 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=tvU0gLu5NtfYawM0d1Vc1oj+pO8tTgyMhhGwGgUwk0s=; b=QOIW6DBI1v94fH/yt/Fnnzty+cxO8+fiu+dVMqoEQq4Zi5wNj0LLXLC3IAnCyoXJ9X B1wudNotXJBiAuDMVAjJ5uE9EyQ9D9ZUzOfWSmszbHeoDDR/Py/ve4G+Aej33GKE9ww1 YwsA7sn9WYxqAwxAANnMAh4My+ccfm+ImfbKtLtlxTMe01Y4IF0Op0z7RQnYB65yxk6v ROjGcwtfHc0D+AjF6XlIiFizcGj65/ndY6A5fxdZqyVpYREsw8ovXcYoTUN2D3RzbGdx LtLgcIlOEFVr0s9S4unl6Ifn9aReKdaUW4KHSQgsAY3PnpLVSAnDLsDScZmhgryB/l6p R5bQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783652073; x=1784256873; 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=tvU0gLu5NtfYawM0d1Vc1oj+pO8tTgyMhhGwGgUwk0s=; b=JVUQjPDUSJ1IVFr4I6ITyPnZcdO5FqxdI3pss1dURUJ+2Hk0ClQ+dtg5fxczIzkvNx 66j/Yut5fO6tkhpA9p9kekX7Zj7YOwVuRZh64y4izCH6ar3Fl5ovc3aQzgZ+Cvs09ceb 6zM2V/eDx1QyU6YjbsdoYzp9ADMMO2ffw43rdr0A4kbKABwGIa3P3Y4TGLGFxButqVoR 1sR5Bpu72fzclYlgUsrfbk3xE4FlQ9F9GSa3qb6jPq0dsiA6v9/+6Szf3ghVXH1Vyo3y tW27fYSSkE94fOASKnTsdXNEhwyLxkGVEGMElFHqmeIWRkTspkusb65miRKoJtKZr2B1 2uMA== X-Forwarded-Encrypted: i=1; AHgh+RpsmDI66aJ1/GX/8su3jvUcyZNffyCUZa7tcHcPqCHdr2jDP5lw4x8dHA5YL0zqYf8wZyocGbWCBgN+buw=@vger.kernel.org X-Gm-Message-State: AOJu0YwlOZ6pyVY3KT8bu6AT+siEq7WBZPZXNkmxrghxRaX4Ue4611Pf 6tTnZYSWzLhP0c8k1gfM/JXudQZ4TAjiQr3Mh7yimOLQl4Rcfak3WMu38qisVUD3UF1HT41U1lk hv7gYJZ1X+6my1n6bk24kNuBEEOCQn0TL/QEXf+w3BnVVSekjW31XrKKGFKqMJZtXc491MbxKEW g= X-Gm-Gg: AfdE7ckFcuQJUUKuGW5Mz1BM62fndI0k+mNcCcT8ni1evHSzj9cjNHXcsOsbIDRkVwr FARrXNtDR5CeTyol8XsA+pScNp7TAPw3dj2j1VggEqQbRKmCeSPUHA1Uh9sRulQlm/xgudO2GoS icxLnKV0fPpBPnUeBOCVhwO7AhGlbWsz+VY8Q8Obg9h4pLiLycCfiLpPCb34sR3N+MRZbLU+3wt kLMf89zl4bbyCJ5FKEmbEyckkcPl7Pww3uE4c9W2PqIQYDZJFHsoEIuSHRKzEr/HFdp30Q4lU3X lcjLW5NJjcwcUez+uJfSBC9H19dCLJ2ZOJRcLNr0BiJFyWmORtgVJGUhRYbQMnH8L/N0Q2Pi+6J DOzD6nZotJzv3OlJw7Vwt1vOBmr3EW4xHR2gEG2Lp5pox X-Received: by 2002:a05:6300:2213:b0:3bf:96c6:78c3 with SMTP id adf61e73a8af0-3c0bce12e48mr11372048637.8.1783652073284; Thu, 09 Jul 2026 19:54:33 -0700 (PDT) X-Received: by 2002:a05:6300:2213:b0:3bf:96c6:78c3 with SMTP id adf61e73a8af0-3c0bce12e48mr11372014637.8.1783652072839; Thu, 09 Jul 2026 19:54:32 -0700 (PDT) Received: from hu-bvisredd-hyd.qualcomm.com ([202.46.22.19]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-13b6596681fsm41843220c88.8.2026.07.09.19.54.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 19:54:32 -0700 (PDT) From: Vishnu Reddy Date: Fri, 10 Jul 2026 08:24:04 +0530 Subject: [PATCH v2 2/2] media: iris: disable time-delta-based rate control for VBR 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: quoted-printable Message-Id: <20260710-qc10c_fix_and_disable_time_delta_based_rc-v2-2-701d6dfd1ac1@oss.qualcomm.com> References: <20260710-qc10c_fix_and_disable_time_delta_based_rc-v2-0-701d6dfd1ac1@oss.qualcomm.com> In-Reply-To: <20260710-qc10c_fix_and_disable_time_delta_based_rc-v2-0-701d6dfd1ac1@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Dmitry Baryshkov , Neil Armstrong Cc: Bryan O'Donoghue , linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Vishnu Reddy , Gourav Kumar X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1783652057; l=5482; i=busanna.reddy@oss.qualcomm.com; s=20260216; h=from:subject:message-id; bh=BMyHsCiT9ByjdqGA2vs2QiGF98DTl5t2krsngpviyHc=; b=kNZ2IYBzxGQSVCu23sWRnw0pUBWD5MYkOCD0bW7qkT510lp3GLwtR7Lwdn1q4PfGYLDPsUK29 gQcWkLY154+D2+2KKkaGDDvrgYUVzlUZRPS9aMWkN7NP1ZlRJ+NsYvf X-Developer-Key: i=busanna.reddy@oss.qualcomm.com; a=ed25519; pk=9vmy9HahBKVAa+GBFj1yHVbz0ey/ucIs1hrlfx+qtok= X-Authority-Analysis: v=2.4 cv=FN8rAeos c=1 sm=1 tr=0 ts=6a505eea cx=c_pps a=JL+w9abYAAE89/QcEU+0QA==:117 a=fChuTYTh2wq5r3m49p7fHw==:17 a=IkcTkHD0fZMA:10 a=RAioF0-LDSMA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=YMgV9FUhrdKAYTUUvYB2:22 a=EUspDBNiAAAA:8 a=hCni5AK2fHxqBZM7pzMA:9 a=QEXdDO2ut3YA:10 a=324X-CrmTo6CU4MGRt3R:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNzEwMDAyNCBTYWx0ZWRfXyxs1RxiqgJvN K/gU2LDuOYJI7mxpseRXvCZlwmJqZVYZl0as74+iBULfOiLiKdPp5u7MhezaCNjST8D4gzYp3bK ARlK1vACxHaE6zGeNyzkOytd4dV5zd8= X-Proofpoint-ORIG-GUID: Yi6Kw-ISAOUwL161aZZZ2YuGQYov2uIN X-Proofpoint-GUID: Yi6Kw-ISAOUwL161aZZZ2YuGQYov2uIN X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzEwMDAyNCBTYWx0ZWRfX8iy0zhJ+D24S SWwTJw8SA4zQ4LkUoPtjjR1qojSMaSsdrkjdqlPg4T4oA43+fDvFqdK+row0wVlH2OQzH8W9GU+ SMGwn0NntLeIx+ez1IC/nP3qfYttQ9jVJ0I6LTkG3SclOtbK8HLJ8MKNp7DiDIL8FTtOWKJKOF0 BQfMa/+Z95FgkPq4YBQnTJzEZG+Rmw2MaX4lWrwwIz3ZxNgA2CRpAHDd+xw9XXcPbeeWeIhSY9U 778pIMZ6O6h9Kad/pdPMTPiZB3aI1NNBeCqiA+0eot+LYbVmUONn1AQk6GLlr6lhHvlGHqTQaDf fyNkQ2FAhs4S9JgsEgatO1/ffO+K+4F2YWCD18HOMnarg5gGDV0v5gCR5rEWmzLF640i6lg5iWW v1fojRjehngWGIDD9y732X9v8y1LWfCvAd28AdyrDpKSoKGpSf4JUhBcUZTMdiZRaR5FwjiBKwm JPMNK5LTi8VIzO+1Kvg== 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_04,2026-07-09_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 suspectscore=0 phishscore=0 clxscore=1015 impostorscore=0 spamscore=0 priorityscore=1501 lowpriorityscore=0 adultscore=0 malwarescore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607100024 From: Gourav Kumar The iris encoder driver was not sending HFI_PROP_TIME_DELTA_BASED_RATE_CONTROL to the firmware during encoder initialization. Without this property, the firmware defaults to time-delta-based rate control (enabled), which calculates the output bitrate from actual frame timing rather than following the configured bitrate target. This caused variable bitrate (VBR) encoding to produce ~5x configured bitrate. For example, with video_bitrate=3D896000 (896 Kbps), the output is ~4.4 Mbps instead of the expected ~896 Kbps. Time-delta-based rate control is designed for variable frame rate (VFR) scenarios where the encoder adapts to actual frame timing. However, when an application explicitly configures a bitrate target, the firmware must follow that target regardless of frame timing. Fix this by adding the TIME_DELTA_BASED_RC capability with a default value of 0 (disabled) and sending HFI_PROP_TIME_DELTA_BASED_RATE_CONTROL =3D 0 to the firmware during stream-on, allowing the firmware to use the configured bitrate as the target. Signed-off-by: Gourav Kumar Signed-off-by: Vishnu Reddy Reviewed-by: Vikash Garodia --- drivers/media/platform/qcom/iris/iris_ctrls.c | 19 +++++++++++++++= ++++ drivers/media/platform/qcom/iris/iris_ctrls.h | 1 + drivers/media/platform/qcom/iris/iris_hfi_gen2.c | 10 ++++++++++ .../media/platform/qcom/iris/iris_hfi_gen2_defines.h | 1 + .../media/platform/qcom/iris/iris_platform_common.h | 1 + 5 files changed, 32 insertions(+) diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.c b/drivers/media/= platform/qcom/iris/iris_ctrls.c index 10e33b8a73f6..f6136e655b98 100644 --- a/drivers/media/platform/qcom/iris/iris_ctrls.c +++ b/drivers/media/platform/qcom/iris/iris_ctrls.c @@ -1477,6 +1477,25 @@ int iris_set_layer_bitrate(struct iris_inst *inst, e= num platform_inst_fw_cap_typ &bitrate, sizeof(u32)); } =20 +int iris_set_time_delta_based_rc(struct iris_inst *inst, enum platform_ins= t_fw_cap_type cap_id) +{ + const struct iris_hfi_session_ops *hfi_ops =3D inst->hfi_session_ops; + u32 hfi_id =3D inst->fw_caps[cap_id].hfi_id; + u32 value =3D inst->fw_caps[cap_id].value; + + /* + * Disable time-delta-based rate control (value =3D 0). + * This overrides the firmware's default (enabled), ensuring the + * firmware uses the configured bitrate target rather than calculating + * bitrate from frame timing. + */ + return hfi_ops->session_set_property(inst, hfi_id, + HFI_HOST_FLAGS_NONE, + iris_get_port_info(inst, cap_id), + HFI_PAYLOAD_U32, + &value, sizeof(u32)); +} + int iris_set_properties(struct iris_inst *inst, u32 plane) { const struct iris_hfi_session_ops *hfi_ops =3D inst->hfi_session_ops; diff --git a/drivers/media/platform/qcom/iris/iris_ctrls.h b/drivers/media/= platform/qcom/iris/iris_ctrls.h index 3c462ec9190b..10e046722ad3 100644 --- a/drivers/media/platform/qcom/iris/iris_ctrls.h +++ b/drivers/media/platform/qcom/iris/iris_ctrls.h @@ -47,6 +47,7 @@ int iris_set_layer_type(struct iris_inst *inst, enum plat= form_inst_fw_cap_type c int iris_set_layer_count_gen1(struct iris_inst *inst, enum platform_inst_f= w_cap_type cap_id); int iris_set_layer_count_gen2(struct iris_inst *inst, enum platform_inst_f= w_cap_type cap_id); int iris_set_layer_bitrate(struct iris_inst *inst, enum platform_inst_fw_c= ap_type cap_id); +int iris_set_time_delta_based_rc(struct iris_inst *inst, enum platform_ins= t_fw_cap_type cap_id); int iris_set_properties(struct iris_inst *inst, u32 plane); =20 #endif diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c b/drivers/med= ia/platform/qcom/iris/iris_hfi_gen2.c index acc0ed8adda1..d119ad599c31 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2.c @@ -416,6 +416,16 @@ static const struct platform_inst_fw_cap inst_fw_cap_s= m8550_enc[] =3D { .flags =3D CAP_FLAG_OUTPUT_PORT | CAP_FLAG_MENU, .set =3D iris_set_bitrate_mode_gen2, }, + { + .cap_id =3D TIME_DELTA_BASED_RC, + .min =3D 0, + .max =3D 1, + .step_or_mask =3D 1, + .value =3D 0, + .hfi_id =3D HFI_PROP_TIME_DELTA_BASED_RATE_CONTROL, + .flags =3D CAP_FLAG_OUTPUT_PORT, + .set =3D iris_set_time_delta_based_rc, + }, { .cap_id =3D FRAME_SKIP_MODE, .min =3D V4L2_MPEG_VIDEO_FRAME_SKIP_MODE_DISABLED, diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h b/dri= vers/media/platform/qcom/iris/iris_hfi_gen2_defines.h index 776b21cd11b2..8766d9e49611 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_defines.h @@ -67,6 +67,7 @@ enum hfi_rate_control { }; =20 #define HFI_PROP_RATE_CONTROL 0x0300012a +#define HFI_PROP_TIME_DELTA_BASED_RATE_CONTROL 0x0300012b #define HFI_PROP_QP_PACKED 0x0300012e #define HFI_PROP_MIN_QP_PACKED 0x0300012f #define HFI_PROP_MAX_QP_PACKED 0x03000130 diff --git a/drivers/media/platform/qcom/iris/iris_platform_common.h b/driv= ers/media/platform/qcom/iris/iris_platform_common.h index c9256f2323dc..99dc6d5c72ba 100644 --- a/drivers/media/platform/qcom/iris/iris_platform_common.h +++ b/drivers/media/platform/qcom/iris/iris_platform_common.h @@ -183,6 +183,7 @@ enum platform_inst_fw_cap_type { LAYER3_BITRATE_HEVC, LAYER4_BITRATE_HEVC, LAYER5_BITRATE_HEVC, + TIME_DELTA_BASED_RC, INST_FW_CAP_MAX, }; =20 --=20 2.34.1