Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=205.220.180.131 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796408703; b=nDUPkTtpnIzqmYMWRSrTgccZ4BP4y1Pf+/JSM/gI826/Vy3WjukQceyoW+/8J0SqfArp D16zINf9zvZr6i/YgYqhj0hygw4f+RTAEj/zENnH0borcx/4MW2LPCOgkbhAAmnNNmS+a Y/1PYnJBKFcPrlFOEYSVaTAiPSkW3wZvZ9S5/m1NtpykxrKEQvthAvxglpqfk057MxAt3 YJrLCkt6hceXvx4UOlYd91spIdX3qKA1ViwFmuMihiuWk27TVVHKriCiEYZGPpZ8UaAyL 0LYG/O7OSg8fm0n+gKl+O7vrnSuU9OqI/f0VDxiWP8MTxpYBghcZQKdSySCV+aNAcQg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796408703; h=DMARC-Filter:Received:DKIM-Signature:Received:Received: DKIM-Signature:X-Google-DKIM-Signature:X-Forwarded-Encrypted: X-Gm-Message-State:X-Gm-Gg:X-Received:X-Received:Received:From:Date: Subject:MIME-Version:Content-Type:Content-Transfer-Encoding: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Authority-Analysis: X-Proofpoint-ORIG-GUID:X-Proofpoint-Spam-Details-Enc: X-Proofpoint-Spam-Info:X-Proofpoint-GUID:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=/cWw36Zb4j3v7i/pEgLov1tVZdQqFI+/wXoeRqDjfmM=; b=cvjKKvmQircTGfP58czD6XclyBqwQm6Olu2RqBuWemvbnIN0sSuAaPeMvcE+wddB3tRP 8JoOsgozdR+Jt6+aEYWt7zn7KTprMW6cESwRtKN34BvUqwt7jr3jZZl7f/Dh8rQOO7Fx1 Wgb2EeuyMMbFo2ZplMrZ24hX+OLrpS8w+yC6jefgtNgD0K82Bfn9X68yf4yJLKGUF2cNH tdwECHkl14dqH7MAm/HMjmpsHQ36YLmyB62r/o85yZTSUYtIjXdI+fqedNMu5ZqCPeeGo zZTtVPRRP2e9hT0EZyPkVn6+lDG+87sG0GcBM4ki4/MYz5Fp9labpO0Xt5gdwxvVDdg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass header.d=qualcomm.com header.i=@qualcomm.com header.a=rsa-sha256 header.s=qcppdkim1 header.b=UQhOehdu; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=eFi10XSm; arc=none smtp.remote-ip=205.220.180.131 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 26220606A33F for ; Fri, 4 Dec 2026 18:25:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 26220606A33F Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none 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.a=rsa-sha256 header.s=qcppdkim1 header.b=UQhOehdu; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=eFi10XSm 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 6B4I6bVm3346597 for ; Fri, 4 Dec 2026 18:25:02 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= /cWw36Zb4j3v7i/pEgLov1tVZdQqFI+/wXoeRqDjfmM=; b=UQhOehduXRcRfsR4 vapxYxamV2IAJnFM7aZgVBVg3gJrVhLFM1I2lkPuPTtOJp92JNfkpCOlQBpDgiG/ PwF9iHHtix70wELkQhvpAHdsnxaHe+dQMNZYMdS/zeWfXQdlR0egnDkzsGe061r/ zXYcN27wNJIG7CHgcC5fPFjlNK3AI3BXmnDFNe82jENeY3aAATTcYq155ygV/tO4 o+HnDgz4+opNBIrmoqvik6n0+JKPAQHayCMhffbbuooxY/2xpKVFack3BDzXgYYm x6D0MC+HPRQKWGXS/ZsxqcZAs8MU4tsQHV1tOpsC8/IQ3bu/JX6x7brpCjZdIljZ flDrZw== Received: from mail-qv1-f69.google.com (mail-qv1-f69.google.com [209.85.219.69]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4jbq7xtfvs-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 04 Dec 2026 18:25:01 +0000 (GMT) Received: by mail-qv1-f69.google.com with SMTP id 6a1803df08f44-921d9a3a6edso27414926d6.1 for ; Fri, 04 Dec 2026 10:25:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796408701; x=1797013501; 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=/cWw36Zb4j3v7i/pEgLov1tVZdQqFI+/wXoeRqDjfmM=; b=eFi10XSmzaRSWfxkjLRei8+I9yog3jijomvZGPnf5vqVA1Gxw8yVe1mGMNq1OuH/G/ oU4JWM9GfNCGtwqeMr167yXBQ4ZhsgUfhY+FTsatyyhwXE2nQcC0MkB1mXK02W20Vt0w JV+MFp0xTt3Z126YKYN/mIRXsK2H7asgq6oUID63aVBbfEWlWRz3BWJAKSjuzBNvRakL OTiaFC1PAqF8pXrbO0UCbgoq4xhwrvDrmUPLYkPaKOPKrX2r1+gVCOEFICOw4D7aWR3T bo+YlRf+uo3l4bvulclYHEkEIZWkSEoFprDTEmPBvIa30MgV9B5ioj6PBS15VCaHx8Ic InOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796408701; x=1797013501; 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=/cWw36Zb4j3v7i/pEgLov1tVZdQqFI+/wXoeRqDjfmM=; b=Y5qxuYrcrqqkFSRXJ9ArDM9Muyz/o5B7rj9yUWBrMsVghEujbCo5LW6KP3uEA7Yn+0 hMjcuDtOwv6Qbjf5hcDUtVkFsK1Dw2IQEzJr8YNf2QD24etBnT1OZFgOkuxi5TmOUX+K 2Z5ZqwK/r+fR9ohta8NyfsJq32VT976B7dz9Zinufrrch5h/wMb63fuc1GEv+1tM0XL3 XGw18Tk8s/h0UyX3/hiswxqsHkl1XaXFnJgHpaiVfeJBayl5R4MiYEqEy0DmuSVNqoeY 14UcIog7NNgVHRdokYisNZ/D+1wGdatqfXuC/thrAJpoIHsKln2qCavw+tsvs15xWHKP FYKA== X-Forwarded-Encrypted: i=1; AL+hErHgoEEVMMKkefVkYs3Ggov57neBk1DeAOgA7JS3uZ0eqrScZyDFiPmvLp4J6S+3qo1aYnxBxP2+LHJiwMf6@vger.kernel.org X-Gm-Message-State: APuU4Z/Lz2dh4cVk6op5+Ffm4SE1te/CR0iqx7TclHR8qwN98kYol+Mw n1WTC2vmoEy8q6sfPQXATXO4+r1qGkBm19Vts9rOYpmR+Ds08NPdgG2Z0n5G9Yba6KJijjma8+f BG85q6qXhtm7y+YFuR5teRpjA3QPnNIaKn6B+XHyNZwjAT33NY6o1d3wdfidNZ72UOWdEkv56Af fV X-Gm-Gg: AZFdTZc26eGjVR/jFdtQkKUq8IaW8+QCUSrdQcwuRdz98jBnmRUFnyY0BzhXBXqjC/0 GUjlTI8N7GV5BbkHq0Mx7Fj3qDmPz8m2/Id5PDo2Ezn73RT69KrYBWhE+bsTsfW2BnTtEx+EjE9 IxRBJt9DtxV4wpc8YcrqRIS3DHv4r/xXG9FNs3hKUkWtP3LxMPiHZns2JRUtSyolNIpBXKUUZIY xyCQjk1ncYr4W88JXl6O9qMza94viAdTEU5V3OIxmh2puU8RFmI57jrAXIgcPUiiiFs7Z52KQC9 ZpoqDXLQSyoM5HKzWbNpJv+u1sN3ChMv6HOyiGtK48Jz5YXIS9lIVyo6dfTFV/nIRV45v+mkzKv yGTSWfMcjSJ6w0loexYyvM3IUtkL66f0ptzPxcikS4FfiI/PZw/z2O0EaW+g5/BaHDkaIlD8Fq3 IcCh8eHrBNwHOrNOzY/Nv/aKSoWExD/OgS8GR+YZ06QciAnIcfCUPmL5BZFbHbiQ== X-Received: by 2002:a05:620a:6f06:b0:949:8bd3:544d with SMTP id af79cd13be357-94a82ddac9cmr400501085a.58.1796408700916; Fri, 04 Dec 2026 10:25:00 -0800 (PST) X-Received: by 2002:a05:620a:6f06:b0:949:8bd3:544d with SMTP id af79cd13be357-94a82ddac9cmr400495485a.58.1796408700337; Fri, 04 Dec 2026 10:25:00 -0800 (PST) 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-3b0037ac7fasm9647221fa.25.2026.12.04.10.24.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Dec 2026 10:24:59 -0800 (PST) From: Dmitry Baryshkov Date: Fri, 04 Dec 2026 20:24:42 +0200 Subject: [PATCH v2 01/13] media: iris: apply the capture buffer minimum in queue_setup X-Mailing-List: linux-arm-msm@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20261204-iris-vp8-v2-1-462f9b48d246@oss.qualcomm.com> References: <20261204-iris-vp8-v2-0-462f9b48d246@oss.qualcomm.com> In-Reply-To: <20261204-iris-vp8-v2-0-462f9b48d246@oss.qualcomm.com> To: Vikash Garodia , Dikshita Agarwal , Abhinav Kumar , Bryan O'Donoghue , Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=3717; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=9VrUCj5i2tt85d2DsR+SljZxlZX9pm5QqJ9s6rFNdeU=; b=owGbwMvMwMXYbdNlx6SpcZXxtFoSQ7Ywa1H6vIZzB46VCEqLdN/itzhWm9nl5LB+l7FTaUetE 9PbE8adjMYsDIxcDLJiiiw+BS1TYzYlh33YMbUeZhArE8gUBi5OAZiIXTf7/9TIuArHjeyhXelp dkmWhxnyH8Z4NPN67HUtf68bcFF82pfstl05krc7P5RKm3DxWolHiCQwivO82qPktXej00KJdpF DTqJuDz022r9st2n578Ro8S1UKOzXPGVpq2aJ20vV9OZUFx4M9dzD7cXzxeHYrV1MZq9DJb5+kN +WvvfDdD3OMA3J21/8L0+sUVx0KHrTgbKTOtMDQ7cftrL6q1zhdOOJrJxe9rfF1xUyGSOEMkROn w9rPOvTekRVsWCLCtd7npgJR/R+V75MWj01tGZNkv3bN+/2KTAl5nhVnLsn/zzuhNQyh931hxbl KzakL70RzHdtzruXl1bH/5ztdyXoe1mxW0leT+sDO1sA X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Authority-Analysis: v=2.4 cv=Jv1kP84C c=1 sm=1 tr=0 ts=6b13057d cx=c_pps a=wEM5vcRIz55oU/E2lInRtA==:117 a=xqWC_Br6kY4A:10 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=ZpdpYltYx_vBUK5n70dp:22 a=EUspDBNiAAAA:8 a=-9yjMmHvulDaJydWnA4A:9 a=QEXdDO2ut3YA:10 a=OIgjcC2v60KrkQgK7BGD:22 X-Proofpoint-ORIG-GUID: XzJIr6tTIPkzazmuV2K3rnedQCV7R9oI X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjA0MDA3MyBTYWx0ZWRfX8y/jhZOsynMf fSFvASdDkN45jF1mRAFEg/gZoA0XGQYRdodJMWpqjH1xOReTKpdFVjbqsnIzTHgdgNQ6TcrfrQD HBTyk/cnVP/F06thRY2kIWIJiZtyqU6181R4l1BpRp1rXJsIDJwH60XfKb4rUW9fk5elT7d25pm bDLIIC5zDAgRMwBoim7U5KyppNOG13KAKdhUutmSHOiqk2CTp9nPF4W9wBB3Kxd9AiLhs+qQh0o U0PfsGHCqrmhNNbbHYz5DIXTjS5KXqXoujl0A6+26DgwhmQmxoLv6YXadMcx3Eof9Tw+qju38Fi nCP4ErFu5ilVr7tbYJBV0FX2bEVogmPzQ5AQmvgKqw14fJZJs4yPWy6SImGgrM1ZmFtQwUGoCHB iTPIt5/btjlRzznIL/qE68hIvg7r3ZKk7EukZjw9iGNIfE96O6QJ4VsA8+plL4R9wg3VPNbRLNC Zw/BWmf5yO/099nKfCA== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjA0MDA3MyBTYWx0ZWRfXyk4tvybxIk7j RoW0SjVNWJ3C+biVIHJbQnIGRho39KeVtoAdrTSlAicAjMZVI7Cu+v+mY3zBAz5sUu6FBwPo59G Xbak4AtPQJigNZlObGZSENJlJofTQzY= X-Proofpoint-GUID: XzJIr6tTIPkzazmuV2K3rnedQCV7R9oI X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1176,Hydra:6.1.138,FMLib:17.12.100.49 definitions=2026-12-04_04,2026-12-03_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 phishscore=0 spamscore=0 impostorscore=0 adultscore=0 malwarescore=0 clxscore=1015 priorityscore=1501 bulkscore=0 lowpriorityscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612040073 Decoding a small VP8 stream with FFmpeg fails with -ENOMEM from the first VIDIOC_REQBUFS on the capture queue. The sequence change handler sets min_reqbufs_allocation on the capture queue from the firmware's buffer count, but it runs from the HFI response path without the queue lock. When the event arrives while REQBUFS is in progress, vb2 sizes the request with the old minimum and then checks the allocation against the new, larger one, and fails. Leave min_reqbufs_allocation alone and raise the requested count to the firmware minimum in queue_setup instead, which runs with the instance lock held, the same lock the sequence change handler holds while it updates that minimum. Fixes: 84e17adae3e3 ("media: iris: add support for dynamic resolution change") Signed-off-by: Dmitry Baryshkov --- drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c | 3 --- drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c | 3 --- drivers/media/platform/qcom/iris/iris_vb2.c | 4 ++++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c index ffa98139f0eb..a1167ce524ff 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c @@ -32,7 +32,6 @@ static void iris_hfi_gen1_read_changed_params(struct iris_inst *inst, struct hfi_bit_depth *pixel_depth; struct hfi_pic_struct *pic_struct; struct hfi_framesize *frame_sz; - struct vb2_queue *dst_q; struct v4l2_ctrl *ctrl; u32 full_range, ptype; @@ -162,8 +161,6 @@ static void iris_hfi_gen1_read_changed_params(struct iris_inst *inst, if (ctrl) v4l2_ctrl_s_ctrl(ctrl, inst->buffers[BUF_OUTPUT].min_count); - dst_q = v4l2_m2m_get_dst_vq(inst->m2m_ctx); - dst_q->min_reqbufs_allocation = inst->buffers[BUF_OUTPUT].min_count; if (event.bit_depth || !event.pic_struct) { dev_err(core->dev, "unsupported content, bit depth: %x, pic_struct = %x\n", diff --git a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c index f0782c4b1e6e..69d5f0639fae 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen2_response.c @@ -532,7 +532,6 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst) u32 video_signal_type_present_flag; struct iris_core *core = inst->core; u32 full_range, width, height; - struct vb2_queue *dst_q; struct v4l2_ctrl *ctrl; subsc_params = inst_hfi_gen2->src_subcr_params; @@ -660,8 +659,6 @@ static void iris_hfi_gen2_read_input_subcr_params(struct iris_inst *inst) if (ctrl) v4l2_ctrl_s_ctrl(ctrl, inst->buffers[BUF_OUTPUT].min_count); - dst_q = v4l2_m2m_get_dst_vq(inst->m2m_ctx); - dst_q->min_reqbufs_allocation = inst->buffers[BUF_OUTPUT].min_count; } static int iris_hfi_gen2_handle_src_change(struct iris_inst *inst, diff --git a/drivers/media/platform/qcom/iris/iris_vb2.c b/drivers/media/platform/qcom/iris/iris_vb2.c index 8faf709c26c1..2d5052782975 100644 --- a/drivers/media/platform/qcom/iris/iris_vb2.c +++ b/drivers/media/platform/qcom/iris/iris_vb2.c @@ -145,6 +145,10 @@ int iris_vb2_queue_setup(struct vb2_queue *q, goto unlock; } + if (inst->domain == DECODER && !V4L2_TYPE_IS_OUTPUT(q->type)) + *num_buffers = clamp(*num_buffers, inst->buffers[BUF_OUTPUT].min_count, + q->max_num_buffers); + *num_planes = 1; sizes[0] = f->fmt.pix_mp.plane_fmt[0].sizeimage; -- 2.47.3