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 D5CF42EEE92 for ; Wed, 24 Jun 2026 08:07:25 +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=1782288447; cv=none; b=Paoo4B5A5iIAES+euBxVU5wGM9Ami+81Eh2F+x6+FeG5pohuxTaX8kziBwTNgrNqgiEjRpiurOuf4JmW8AWPqncXiltwYILMK/r2vCDCuoKSE0qcrqzdgC4BqJkdfcl37KRhWEnA1A6i83Mz9T0tfQdOU4P3l2JCnJ1HBg2auyw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782288447; c=relaxed/simple; bh=PnD90Rj22MBwRbRUAu3UlZZ9ydO1vRNXFYqA0O2T3kI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=aOpbBeWxR5NUe9QPZkdpAje7QPk8xe20FFwTUqb9MGx/RGea1OhqjN8Hm9iyr6lIA84Y1QAqWiZhWAECwBNIfix1AYNqDKUfJRgxZ0rnwyFU8TVrMj8oCyK8GBp0mX5kIZYfgh3ooacUH/rnS3oG3MYFwoNCIoAynbtFog7Zd4w= 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=Mzxr6tyI; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=hgKJZrCZ; 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="Mzxr6tyI"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="hgKJZrCZ" Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 65O5uOGF2439999 for ; Wed, 24 Jun 2026 08:07:24 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= 9FzVY8788rMGJlMr4B4yxqA305gNDuOqkYty6vubBhc=; b=Mzxr6tyI+nm9jMdS 3SlZD3nLXPb775ui0RTNe80TcJJdy+gu4KmQ2g6Sq4CECQa2awmDbBvZjyHynqNB qCZy2XGQ88MuLNadRo2vlMYyXcAJ1zd1B6aGBBH5+fGGxbDjxFbIO11hLgPcSAS3 AcS8J9Jo3wEGSTe9ONQJayFYMszbkt4vUBhLOBcN65xRQbHh9r8/JPI986L9p8cS 8na+MBC30ydvwIde1lmQ11x7zzQv6WPwtG7MF0O0otAmXcm7UnuNnOhjjS26P/Fw DEZd3qSlcDv125wqgA6kCZb24klq6dPWkjghV6EHEFQPOwofl3h6EdrD7XcMn9he gJa1LQ== Received: from mail-qk1-f198.google.com (mail-qk1-f198.google.com [209.85.222.198]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4f05ar17m1-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Wed, 24 Jun 2026 08:07:24 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-92229624a71so116967885a.3 for ; Wed, 24 Jun 2026 01:07:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1782288443; x=1782893243; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=9FzVY8788rMGJlMr4B4yxqA305gNDuOqkYty6vubBhc=; b=hgKJZrCZJm14TBMWFi2rXBMkzPUQJykNFfGDpeX/a92W4OzJEES8K8nhO9a+jPsVgt cRNvLeYIgS0ECFiu7AuR2rX5TH/6ti43630VczrQUdVvGuTcpdQcOjQ+AjWw4+XGfese c2dJ43FPO616fzTMqidDQnZBByE0604wFPkuRNmvEqDMJG7sAHQVW57i4Xxynp/M2GbV 158msOUjADjRKRiobRa+kaJ5R4sXsm5K71ncnO41qAU84WP9lKO64U+9QvnSI55h4I98 TBFtoT2DDq8NUnbsi28eZ0A+5mg3q92JLRa04m4a40+NSg38q1f27UWmbHtS5TPsV3lb dHgQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1782288443; x=1782893243; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=9FzVY8788rMGJlMr4B4yxqA305gNDuOqkYty6vubBhc=; b=UTfe337y25d+I5p9iEgdMGBMamq2vKMynBZwPsYeVHOFGrVlyCxgQReV7M9UIqcAWF 3pfAQM6dI9SGW5WdH8jxkQP+B4v3ErEly1dpC9LC+dqf+5g0EhkF1uG0K5USVd5w5eFt TAVyW5+Ydj42yxNSu9IQ3J3byIOUdJj3mW9sVx6YqccJuDUxIsab+A0dzeNalDsFUtDU KcCCeNx+Yfz3R7kZef3JHLOhsY088O2y5aK+qIeOzLKd02BkAa3gG0mWgslbOV0YdSvf k32TvzbTDdHxOmOdZkFVUCWWkEosdNBrlmtGfNsNYF4yeDgp4RkpWlun75eJmhzSqo/q hunQ== X-Forwarded-Encrypted: i=1; AFNElJ97xu2uUOS9++ID6miNp0vXrda6QbFQvKi2vSs2mp+iEc4E9OD2fZAVTTYWZ3qNJj5h+aVQmRu9AcYtk0Q=@vger.kernel.org X-Gm-Message-State: AOJu0Yzyc14u8BTBBRcgG/R0HLVj/99w/06vwVeGU8dkdSo5tB6PaUl0 O0K/kbYbHGiwBFGnLHMud2x/yrumcMauQE/ievNvhgYmKkXIyXa1//ESE0I5dIAGTM7OxkO2QJv DhzNEteO5qm9lrR0IdufOaC2KG/gLoiGr0LM06GYzTBj27s0Lu6/HHlXUPjP7CGHFO6g= X-Gm-Gg: AfdE7ckk0Uyx8MuJJ66zSmMf+0U3vDrEsr1G/BZHYoDRGtg8urm+BYasneVXkTeEhsz 1SUdbrkQuiGik2QL+/baKS38OdXI8CGsvVQhtZYy47jAYLIQqs3LfAXWEl/NEq5TaEip5RVMAKo pwP8yF3swTxSdXZTqFbwtat4W8ZdrNkw/7CFQ1UX/c+yyOMrvMy7N9zdy7vKxvotpOnHa4heMQI tDZcyA2fF+p456S5qvQF6fE6HZsgv43JAJnNVVJTxRSRtPP9i1q4qXpC3Z+mnH7MFhTP99inZie CLTdk+7MSztUeBM9/o/2XmRZH9ZwnxXo8GQgzu2cfd5W9IK+Z92qk7KBgxYN404h042gqlWVdzF P7FIEJ7oRii1igt/aHHQDgmuPu1Px917ezIPjds66gQryjQ== X-Received: by 2002:a05:620a:29d2:b0:915:c76f:26e0 with SMTP id af79cd13be357-9277e739cffmr388253685a.18.1782288443581; Wed, 24 Jun 2026 01:07:23 -0700 (PDT) X-Received: by 2002:a05:620a:29d2:b0:915:c76f:26e0 with SMTP id af79cd13be357-9277e739cffmr388248885a.18.1782288442983; Wed, 24 Jun 2026 01:07:22 -0700 (PDT) Received: from [192.168.0.172] ([49.205.250.204]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-c11f0ee8f68sm27650366b.56.2026.06.24.01.07.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 24 Jun 2026 01:07:21 -0700 (PDT) Message-ID: <6f7622c5-2bfe-49f1-ac05-81e33c8bd66a@oss.qualcomm.com> Date: Wed, 24 Jun 2026 13:37:12 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 11/16] media: iris: update buffer requirements based on received info To: Dmitry Baryshkov , 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 References: <20260616-iris-ar50lt-v5-0-583b42770b6a@oss.qualcomm.com> <20260616-iris-ar50lt-v5-11-583b42770b6a@oss.qualcomm.com> Content-Language: en-US From: Vikash Garodia In-Reply-To: <20260616-iris-ar50lt-v5-11-583b42770b6a@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: idxPmHqimY12WfcJB7DkTzUqGHlgFIZP X-Authority-Analysis: v=2.4 cv=EuLiaycA c=1 sm=1 tr=0 ts=6a3b903c cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=9U17wRWtyhLDe7ZN7ogbJw==:17 a=IkcTkHD0fZMA:10 a=FelO9ux0wxsA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=rJkE3RaqiGZ5pbrm-msn:22 a=EUspDBNiAAAA:8 a=QYZdmEBtecGxs_tjcH4A:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 X-Proofpoint-Spam-Info: AW1haW4tMjYwNjI0MDA2NiBTYWx0ZWRfX2f7ByXdbXll0 cXH8IqP+bYYM1s960voSP0dr7m2tjCEhXJjCUYnByNh4YZvrOOhOL/YM4WbYhiGBE0AVMs72sVo rXPa0bbB/Cio8cwg2ceJVD00d0EWNwk= X-Proofpoint-GUID: idxPmHqimY12WfcJB7DkTzUqGHlgFIZP X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwNjI0MDA2NiBTYWx0ZWRfX5tf6vLPV1qHO jKScsxqRC2rfwY0QCkI2hR5Y8xeqa+JCF1HOnfRuFJVqkMmVFRdTR41RYUJKIuZvAAlbNQpi995 jIsHf+JLydS8Mvg6fU/M79TMKBko0sCGib+Uic0erIIHhn896yYPnTUxQQpxsKaqSbjm7g1J/aZ WIgK7O2YtWfCCAq2DcQ0KJhuu8agdvnAk5moxVOTg51ndNeg2Y25gZarGuT0QVnBHzvMIzlyrJr SvnLhlYMAgKyys2GH9Csar7jzA5adwnQ85CJ7ow0sZquO7lUzm0I7FGubXm21ERu7qo6E4+kQx0 GA9aB87arB9Ztoj1Dd4wkvSsdeAeovueqYnj0wArFqd5i4+jLsoBktbWakPyAPeRYN1AOEE7wz8 TH1KjcbTo7DbAlJcResaGNUmz6dD2G5G/oG7I3FGyqajhqtCrLHHNA10nj5jmAns5u+lhd9eJsO flaUDK2ujm5BtemNKOg== X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1143,Hydra:6.1.125,FMLib:17.12.100.49 definitions=2026-06-24_02,2026-06-23_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 phishscore=0 clxscore=1015 priorityscore=1501 spamscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2606150000 definitions=main-2606240066 On 6/16/2026 5:34 AM, Dmitry Baryshkov wrote: > 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. > > Signed-off-by: Dmitry Baryshkov > --- > .../platform/qcom/iris/iris_hfi_gen1_response.c | 75 +++++++++++++++++++++- > 1 file changed, 74 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..896953ea62ea 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,79 @@ 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 -EINVAL; > + } > +} > + > +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 == -EINVAL) > + 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) { > + dev_err(inst->core->dev, "error, no properties\n"); > + goto out; > + } > + > + switch (pkt->property) { > + case HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS: If i check the venus message parsing logic, it loops through the packet till it hits the case. Here, we are assuming the first packet type, in the pkt to be the property "HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS". There can be multiple properties in the packet, and if "HFI_PROPERTY_CONFIG_BUFFER_REQUIREMENTS" is not the first one, the usecase would break with incorrect buffer sizes. > + 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 +730,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; > > Regards, Vikash