From mboxrd@z Thu Jan 1 00:00:00 1970 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 76C4636606E for ; Thu, 9 Jul 2026 13:42: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=1783604556; cv=none; b=qDoIWt0M38m3PQw+s6hntM2msoBPbc8+cuH5q6GcvxodtH7kqpbXC0WHKh5LKyZYHBHHTfeamIZmxSGnovfNevhHYpPIRbv40N/k3Fm5tHioTulFONZ+UUjrOmYn4JjRJSFXRLMs1wmszy+JnDWWWL4yXsvy7m+EuNRrZLzGljI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783604556; c=relaxed/simple; bh=+nqEnMHoWBEk7ejdZyFoXPRJzFNrqozZDfHTEPC98/Y=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=QEJqJ2C5a7CuvOSZiQ7xpYb70Mz/cY/7B6w7lRaE6HHgwB6nXGlFTfzEMfunsg5cRVKNEJnbNeN0GEDojkunPK7lgzMn8/Z1lpAjGlg9dd5qQMjCqSggGLKo56yWzPj1ekwQ7pPlYIWKFshEnYbMsQDuksqZ2JF1mgKJt9cZIwI= 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=otmnpyCY; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=AmgC83Yb; 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="otmnpyCY"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="AmgC83Yb" 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 669BNIBh1525642 for ; Thu, 9 Jul 2026 13:42:33 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= n8atcCdTovpN5KZraYH+DhxjcFfh8z0wA+cOFj5dSVw=; b=otmnpyCYOfBJKbl0 z7n2usOVEwLwZ6958xMWU5D1jMAfSRPny4abQvHPvee5P3lmbI9zw1y5P67YBF+R UjxB/PdhZSrgfmDFSofTxEohiWZ44aUaJfsAuX3Y4k/HvMd9KROf+/xl7hLJWm7y wKshkTGKubl4K0xR2ZdIsjU8x01tCGB2YntI9ozyXoIGW5dZhm1dsOZ1VZqScXCz OCSpBpzLkCICA4AHicVgk5iH3E9lc9eSCCbOaICWy9MRa7nHOWGnoPHPiWMkJyv5 LfAckI09cRUEP8nKL7teczcDtOtkMC8YuqaARQJMMZNgkr2hMBRAWDslkzQxEdcF m2/Ncw== Received: from mail-ua1-f72.google.com (mail-ua1-f72.google.com [209.85.222.72]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f9v4u458s-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Thu, 09 Jul 2026 13:42:33 +0000 (GMT) Received: by mail-ua1-f72.google.com with SMTP id a1e0cc1a2514c-9693cc255cfso1773753241.3 for ; Thu, 09 Jul 2026 06:42:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1783604552; x=1784209352; 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=n8atcCdTovpN5KZraYH+DhxjcFfh8z0wA+cOFj5dSVw=; b=AmgC83YbzdHRz1TQCfTG2V03MFDzXFsXA6YYZN5P0YujpwOaUjHvo8Cj5BHC6LH+Oe Gp5LYvIUX4XH4CyDAWBxkWTqLF155vX+SA8D8NNix6hXoNPuC5SefLDv6sOTjq7JvsqZ 9g1PG96bx0Rw64WtXv0gtGGIFYeXaG0/Vl81eo4J4EZVBVeKKFvb0PsjHStuNTUGyajh OIHCLknDTX90TtyQL4rSjEMFPoJm8uOcpeJLdVbJ+6i9sufzZgFZ/GIQ9i3TwVgD0P+R FZ7GMbzVb1v+sAHFCcVGYViqvVy2e6x3Cf31hkjxRcp9Ml+/7jYACCasj9eqz0Ez21i2 SxVA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783604552; x=1784209352; 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=n8atcCdTovpN5KZraYH+DhxjcFfh8z0wA+cOFj5dSVw=; b=Ircs840cYW7GmfSluzQXS352o+FxD+sBBLPJY8/SbABuofBjeP9dKxbh3ekBuC0bGy fwwADWTefZ7Mwac3YWc0syiKk+g9B+QBeM50TR2egu/kZdMHFjj70Ndh0+MAPsVEbXwn XadqarFCsCQ68oBrL3Z1PI4XBDxYs4ScUnyM1PJnr/kVvRdQcStb765rAdDXTEuMxM6I wzejkTcwLubIbDmn1UZKlyLH86PgrjUtZxCa9ismuoj1LuyaZSMYvoknetvWG69vAcDZ cDBhjMPA4efvNidLPzVxR8oYY4sib1llpXDlwS8UE3y0/Xjil13Z52qbz47x1V/YMHHO iGaA== X-Forwarded-Encrypted: i=1; AHgh+RoQkPhBBU/ohcH+eizl8Ho3bPjKEQNJ56i77wXDHFNOSNeKpwdbMiTKFcAbpcLcBb6t+qMd28QwvwPm@vger.kernel.org X-Gm-Message-State: AOJu0YzzHVGPok/T1DgiQYyYLA/3CJDIvX8PX3T7kTk6Ie9hCHjdqlFx obkXc3VdAWXHoPsNXUALnteWDH/WAhAH/11aejiZWFDD4POuO9RrFcunARQtShxQEc34kOyPuhc U7nsThh1FqT+J24zotks2m2IJATkun3lX6GQzWe7RgN1Xw9Vh12rwh+L/QzRwwUrP X-Gm-Gg: AfdE7clTT2QUMRQKbcRozKC/5XP0RRKC3pHIYJuP1vXbLYO+JExqR8tbj5EpfUxfFY4 O/Zy9KaCunF1zsuw7pXQN8WrqzxiMYicGYgdKosOr8Qf8KNik2kk4JNe2KI6ZvvSq1rQaDACSmV 4CJHLyuYOyLnZ3plvBQJ26uupaqnlwHmqoVjY1RlOvp+Z74jV3RhX4AI3HtSmVDToPtFhBBj9uK UhE99qZzN1Ij5omZKi/cfZxqtwQ5zrzrpUotu5VH/70idNRzXW0GLFQ8q+FPPublpQMKKxCA7JF b5/DpgBh9ncna/xVCJwl39t2XtyXViq1CduBNM4RWocQJo+B/u5MEc+en+RlXnzOmYbtgz0Mqij hF7oBZV5JeaN/TDPeHbMyG1DNpeiIqAYscF22pD0tl/O+N3YdHpGOhdCpQ5tclrjPfXsZ4xAq7m 9gWRCukN+b2oR12WF96QQXm5o/ X-Received: by 2002:a05:6102:534f:b0:6ef:db57:d472 with SMTP id ada2fe7eead31-744dfff50e4mr4386729137.27.1783604552512; Thu, 09 Jul 2026 06:42:32 -0700 (PDT) X-Received: by 2002:a05:6102:534f:b0:6ef:db57:d472 with SMTP id ada2fe7eead31-744dfff50e4mr4386707137.27.1783604552100; Thu, 09 Jul 2026 06:42:32 -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.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 Jul 2026 06:42:30 -0700 (PDT) From: Dmitry Baryshkov Date: Thu, 09 Jul 2026 16:42:04 +0300 Subject: [PATCH v7 13/18] media: iris: update buffer requirements based on received info 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: <20260709-iris-ar50lt-v7-13-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=3581; i=dmitry.baryshkov@oss.qualcomm.com; h=from:subject:message-id; bh=+nqEnMHoWBEk7ejdZyFoXPRJzFNrqozZDfHTEPC98/Y=; b=owEBbQGS/pANAwAKAYs8ij4CKSjVAcsmYgBqT6Ul42N8FvrM17uOk+9VPC4UpAAhYdz9Ooezo 0jOUO4z7wyJATMEAAEKAB0WIQRMcISVXLJjVvC4lX+LPIo+Aiko1QUCak+lJQAKCRCLPIo+Aiko 1dQOB/9zGjTXk2clJR8LiscFgcpZtP+4allG1X5iZDXKrvnjA92BGXdorLL/aFTQQAiNYl5DdPE scTBDB6czY2l/iJZolV5m8+sooVomFMyNqCEI1yKHHKdO6tU4Y9TG/vKJLNIgbKf8KZGWu69LBP 2iHBaDE4h3B85AtsahADQQIyeti9Ggvdo66vtBQViKgVj2oz6kBXDxHLQmGRim504meMkBkbAbI jgvoj8Ei5N0+pVRg/emfNLhzO3byaaqltq6pyGkYUiGtY546qZvyOAdd5z2QLL11yTMRBgYGLOf K7XiKusMDx7dD5Xtc9mxNb/7+I7jL8ef2MCZ/HeVCOkz2GNo X-Developer-Key: i=dmitry.baryshkov@oss.qualcomm.com; a=openpgp; fpr=8F88381DD5C873E4AE487DA5199BF1243632046A X-Proofpoint-Spam-Info: AW1haW4tMjYwNzA5MDEzNCBTYWx0ZWRfX3iSIGAM30c3a z0Qu64x79uVeOecCIL37/ULAGoCFqRm32mhBMUWI2GxzxaL0ps40quyUOlgb0AL/x0SN3R4wPEn /U47NFCiHboIDGaLNeNa46Hse5XErHU= X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNzA5MDEzNCBTYWx0ZWRfX1mJlCtbhQLJ4 Ojz8XoaF7R/Y1Qt0+FJqCZUnW/M+UuSO7kF5Z/bWBPXDq99iUyXZIKd4iWjKKqqjjhyhyRWS8M9 ue6d9oylsbiG2pdh0A1gKf3WfjDl/HGAtGEg8E2HqTQqNP04ufozuMaOzbR6QzPOOB/dOVab+RK UmL0x8BdgL7desJghJZPQ8fkrvPudqt+HJgibl3yFjHi0FbkMB0wrYReIHZJDQEwtHVP6PLYvNS 1gRSAXpVskwMcJYczA17ZRqKnbmMs3A4Uia//ye3M1hUZM6kdushXZBnA9u6q7xZXpvc5LRjbv0 5Xkrl0au5i+StYnuhV0JcU2xBilM5IIVN7A0zO9WQ0N1Z/lrG4lh1vVyfWcSWdEpMwbGZxnzzK9 oYc0o7RBzOnr4mR8I31PAjtX3hckzOfpSWwJynbM3WCEctzOfvSUccqVhGhRqIZMmfg0TilPESc 0FLv4jwNHzEqI/UKosQ== X-Proofpoint-GUID: tlHkbSsM9kU9SMjj3BJhXlnFvKFCD0Al X-Proofpoint-ORIG-GUID: tlHkbSsM9kU9SMjj3BJhXlnFvKFCD0Al X-Authority-Analysis: v=2.4 cv=QoVuG1yd c=1 sm=1 tr=0 ts=6a4fa549 cx=c_pps a=ULNsgckmlI/WJG3HAyAuOQ==:117 a=xqWC_Br6kY4A:10 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=_TRJU0tGboi39qq34nEA:9 a=QEXdDO2ut3YA:10 a=1WsBpfsz9X-RYQiigVTh: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_02,2026-07-09_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 adultscore=0 suspectscore=0 lowpriorityscore=0 clxscore=1015 bulkscore=0 phishscore=0 malwarescore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2607090134 Upon receiving data for HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS the driver should update buffer sizes and counts from the received data. Implement corresponding functionality updating buffers data. This will be used for upcoming support of AR50Lt platforms with Gen1 firmware. Reviewed-by: Vikash Garodia Signed-off-by: Dmitry Baryshkov --- .../platform/qcom/iris/iris_hfi_gen1_response.c | 76 +++++++++++++++++++++- 1 file changed, 75 insertions(+), 1 deletion(-) 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 23fc7194b1e3..7ad6f0bb4677 100644 --- a/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c +++ b/drivers/media/platform/qcom/iris/iris_hfi_gen1_response.c @@ -533,6 +533,80 @@ static void iris_hfi_gen1_session_ftb_done(struct iris_inst *inst, void *packet) dev_err(core->dev, "error in ftb done\n"); } +static enum iris_buffer_type iris_hfi_gen1_buf_type(struct iris_inst *inst, u32 type) +{ + switch (type) { + case HFI_BUFFER_INPUT: + return BUF_INPUT; + case HFI_BUFFER_OUTPUT: + if (iris_split_mode_enabled(inst)) + return BUF_DPB; + return BUF_OUTPUT; + case HFI_BUFFER_OUTPUT2: + if (iris_split_mode_enabled(inst)) + return BUF_OUTPUT; + return BUF_DPB; + case HFI_BUFFER_INTERNAL_PERSIST_1: + return BUF_PERSIST; + case HFI_BUFFER_INTERNAL_SCRATCH: + return BUF_BIN; + case HFI_BUFFER_INTERNAL_SCRATCH_1: + return BUF_SCRATCH_1; + case HFI_BUFFER_INTERNAL_SCRATCH_2: + return BUF_SCRATCH_2; + case HFI_BUFFER_INTERNAL_PERSIST: + return BUF_ARP; + default: + return BUF_TYPE_MAX; + } +} + +static void iris_hfi_gen1_session_buffer_requirements(struct iris_inst *inst, + void *data, size_t size) +{ + struct hfi_buffer_requirements *req; + + if (!size || size % sizeof(*req)) + return; + + for (req = data; size; size -= sizeof(*req), req++) { + enum iris_buffer_type type = iris_hfi_gen1_buf_type(inst, req->type); + + if (type == BUF_TYPE_MAX) + continue; + + /* on relevant platforms hold_count and min_count are swapped */ + inst->buffers[type].min_count = req->hold_count; + inst->buffers[type].size = req->size; + + if (type == BUF_OUTPUT) + inst->fw_min_count = req->count_actual; + } +} + +static void iris_hfi_gen1_session_property_info(struct iris_inst *inst, void *packet) +{ + struct hfi_msg_session_property_info_pkt *pkt = packet; + + if (pkt->num_properties != 1) { + dev_warn_ratelimited(inst->core->dev, "%s: expected 1 property, got %u\n", + __func__, pkt->num_properties); + goto out; + } + + switch (pkt->property) { + case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: + iris_hfi_gen1_session_buffer_requirements(inst, pkt->data, + pkt->shdr.hdr.size - sizeof(*pkt)); + break; + default: + dev_warn(inst->core->dev, "unknown property id: %x\n", pkt->property); + } + +out: + complete(&inst->completion); +} + struct iris_hfi_gen1_response_pkt_info { u32 pkt; u32 pkt_sz; @@ -657,7 +731,7 @@ static void iris_hfi_gen1_handle_response(struct iris_core *core, void *response } else if (hdr->pkt_type == HFI_MSG_SESSION_FILL_BUFFER) { iris_hfi_gen1_session_ftb_done(inst, hdr); } else if (hdr->pkt_type == HFI_MSG_SESSION_PROPERTY_INFO) { - complete(&inst->completion); + iris_hfi_gen1_session_property_info(inst, hdr); } else { struct hfi_msg_session_hdr_pkt *shdr; -- 2.47.3