From mboxrd@z Thu Jan 1 00:00:00 1970 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=1796126033; b=t8ox1/W1O7wUHsT1n1NOR3lXFVzb0IGe5ki1oTTdItIUpu3CfnnSxcOJ1h4dFGRR7khF l4fMJS+277imfmYWdw996k4c7bKLlg171fIB/AnvPSRuxvC1W98dftvIb7jmEEeBxV9UO lC0LAVS0u34p+UjN2Qp00bUjgo5/8I1WKJhoJUIJwTWBa9GUwW4QvmE3Y1BaRwy5yTNvl AlPYtIRcUBghiGCaxjUmhMumBj5JtupvsODtYNH3x/9/Xg4HUPMpIEXxJ/3A2RfLuPeHl QztFxolMSmDJQ6lTR4Ty4FD8VRobUdw+FivwOKOX+SVjlRJUkBxjhA/PLVcmS3iWxIw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796126033; 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:Message-ID: Date:MIME-Version:User-Agent:Subject:To:Cc:References: Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-Proofpoint-ORIG-GUID:X-Proofpoint-GUID: X-Proofpoint-Spam-Details-Enc:X-Proofpoint-Spam-Info: X-Authority-Analysis:X-Proofpoint-Virus-Version: X-Proofpoint-Spam-Details; bh=WAzz6a+ZGKg5nWopguyebIeZ2EFBCHjeSuS+X7cBFGg=; b=P6XAa8Irn7nM4bKmjUpaWsuSnM4fbQ+RvphzPxvVwHYU2njabbPEzBrH+JAGj2me+ZpP wuzYKxqqnLmZbaJPQ0WpkkfKP1nTHfMUQAVrLFyLxaAZdtalNJwA7h3WFDA7G+md8hD4/ ppnfeZDvqDhHuyH1DOdvelg8Y6bD8G2FHIhOuduE9D8Pa4XtG1j2NjBl4UvFjSf0tNNE3 z4F9pnaoJMMmhK+UCMHqmqg8s3LeRkhpV89jTBtAiMqcEVen+nVFV5ObPxr1P5XzIN9Am vI677A4w/BY6syX/CmiS6EZcgSym5zWekxkaGmCwujBx1FSQXrIPGdKDSQmA5TBi4hw== 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=TkbrpqQl; dkim=pass header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=EEes99OP; 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 C4DF2606A320 for ; Tue, 1 Dec 2026 11:53:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org C4DF2606A320 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=TkbrpqQl; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.a=rsa-sha256 header.s=google header.b=EEes99OP 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 6B1AQUZD2127904 for ; Tue, 1 Dec 2026 11:53:51 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= WAzz6a+ZGKg5nWopguyebIeZ2EFBCHjeSuS+X7cBFGg=; b=TkbrpqQlILR/F369 0J4STP82WxZfuIivBeKzIt6FdEv3as6bjumf2zUCDVO0m2XoXwIiZ1ca5azpVxgQ K7Xz3PUbCgh3fOTR7G89a3z/IHrUL7wHkdYf9nIRtWPJYV21GBTuQB9eV+M+eirL +QxV1E4AkWcGZZxGJ+5TZz+pw57/RsmbEFIML2oDHY0Ck4lNiP7pnhQ/hVPcUtz1 RrPa8LbO0XQlMnOcIH3FS3qarY0gLy9n52bA12R4C9cTop8AJhPCxpnyp3oK4MRe y+NR0aptUgJ1Syb2vL7/eFABaoRIhNqGDMbpq34id5CFlPVw4MlTOzqs3Wi8s2Bp jQqdNA== 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 4j9ke32jsa-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Tue, 01 Dec 2026 11:53:51 +0000 (GMT) Received: by mail-qk1-f198.google.com with SMTP id af79cd13be357-93f37c94ceeso1969455785a.1 for ; Tue, 01 Dec 2026 03:53:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1796126031; x=1796730831; darn=vger.kernel.org; h=content-transfer-encoding:content-type: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 :content-type; bh=WAzz6a+ZGKg5nWopguyebIeZ2EFBCHjeSuS+X7cBFGg=; b=EEes99OPUWrMaullIPkwPmGfb5QdPS9+iJ3k2G/QuoSEnPmy9KG3BNeG+QV6AcJxVB PD5c9zIex4OGU66G37D2eJZg0nGYIvOR9RIiUW9tTTyNWRAY0rysFtLXgVj0gSnBeXAS zsldPTIkI3Cv/08n1z9Xdrhq1wHxiT6pUztRwmHoMOzRSSSFPU4LupkZ1AW/rM7PU2WF wUrFrkV18BFR5BTaDRtB7bCUUkln5KLLZpKGLA1KkCqPrRjw0pp8qsIeJp/y99KaCQYf rkR51ysQ6kae19O70xFwDSGWG3Osn0Ah5kffN6g23QzCkb1NyRfHJEy7wvL35nRtuEr5 t2oQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796126031; x=1796730831; h=content-transfer-encoding:content-type: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:content-type; bh=WAzz6a+ZGKg5nWopguyebIeZ2EFBCHjeSuS+X7cBFGg=; b=ue5eYeIr/wQvlWBAvfQDYG7E4ikPQ2Qt+LrZjn+Eiy8MfCZiPS9ZzOhUpzODL9FBWJ XuB+3P3D/xvXwwQ+qE+0inxMlywimzekwLx2MzV3CFWQNmpCpJGE3Xfb79E5sPSKqpkQ j1rN/XeDykPy0fbZ/FIjEh7zK5tuq3+tFwvD3tZV+4wbgukN+5v7hEr4rS/oDYiUe6Mt fV0IQNFZlc39xqDv5guVRFQeFPJl8edkFsT2SdL6ynXFtnceqSCZkwkBCuauwKAo95VT 8qLye/X1tkgBCGnZU/zeAuRO2JDbPGuSbn/d1QcNnTEAZycmtPBthLhHeJ+ZkbPlQhkL GL/Q== X-Forwarded-Encrypted: i=1; AL+hErFCviAdv8kVV6wQtxb2Esy76HUSPkfbjcNIHTB1gjAJqAmPY0y4xWpVr/BJxjuDOfQHYDDuCObHc7cu6QI=@vger.kernel.org X-Gm-Message-State: APuU4Z8XZznoq/ZrsnWdSdo7ay2UR8DzHhpl7qfI8iQMe69hfVfJJhVy VlzWLtC4SqsjAsGdYBU6EnzcNAVwnOmEbPAF1B3d03fIfceOsjDpWO8XEVETayy8jhJkGzsi7h6 Y3PcW3vM/Fl7Ck+dPz3Xd9W2HOi+2FM+xhkFUuxooBA2N0+uAFunlQ8Z+hfhutOlvosVRal3Hyy 0= X-Gm-Gg: AZFdTZdakdhLK7MfQQVtQ3Fc/tSiOFPAS2uSrVwQa1CBsMSGf/UNPB+XAQ32p0H6RuX dR91DArfZIovf5ejU150+Nd874AoJLNMxsTUqI7/YqXZKOfXlvtwQ+LZz2zv0AYV4yrGG5tzBwT 2+2UrWxKFjY3FdE7/BC3NorRsNmsE6IWm2t8rCUHxn8a4IdCvpeMmWQd2R2+jdCAcoD5296BE5h J8c7wDtyfli6EJWpXHZTgoYFa4egu6rLmYEsHiCqt1fXFNlK7EN5g+hR8U5tp6O8ioMlr0MWQpa 2yZD+fLNMgivmVU4T3idYNM7j9f3dPVs802gwf0anzTr3QE30xZaQyNtVILvAz+GOkzTvjs/rvI QyR9PU3mJuhSHK3cn0qQbgI2BskWHaov5nPo3ElS1wTkDFFPYiR6/Mh/Nz3jnsjb9b8DXlF7G3J nRb4ZtGFJsSPXZ X-Received: by 2002:a05:620a:268d:b0:945:fd9c:b26f with SMTP id af79cd13be357-949b3403c63mr6227499985a.2.1796126030820; Tue, 01 Dec 2026 03:53:50 -0800 (PST) X-Received: by 2002:a05:620a:268d:b0:945:fd9c:b26f with SMTP id af79cd13be357-949b3403c63mr6227497485a.2.1796126030394; Tue, 01 Dec 2026 03:53:50 -0800 (PST) Received: from [192.168.25.64] ([94.155.124.210]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb90660cb4sm1002390085e9.2.2026.12.01.03.53.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 01 Dec 2026 03:53:49 -0800 (PST) Message-ID: Date: Tue, 1 Dec 2026 13:53:48 +0200 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 7/8] media: qcom: camss: Timestamp buffers at start of frame To: Loic Poulain , Mauro Carvalho Chehab , Bryan O'Donoghue , Vladimir Zapolskiy Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org References: <20261127-camss-hw-ts-v3-0-e4b6ad98ce9c@oss.qualcomm.com> <20261127-camss-hw-ts-v3-7-e4b6ad98ce9c@oss.qualcomm.com> Content-Language: en-US From: "Gjorgji Rosikopulos (Consultant)" In-Reply-To: <20261127-camss-hw-ts-v3-7-e4b6ad98ce9c@oss.qualcomm.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-ORIG-GUID: 6uTi6xkH776sZ0aVNI8WjvD1OGmlArcF X-Proofpoint-GUID: 6uTi6xkH776sZ0aVNI8WjvD1OGmlArcF X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYxMjAxMDA0NyBTYWx0ZWRfX7+OrScfw3W3q BexZTbMpZf9B3spo7rX4eRH7IbQXp+Sbfr7O32er6hvwWH96eAjBmHq4PRHyt0DaQ3QkIkYbwoJ VYpTpejr3DdZn+fjkqFxPSjg1949LptLvEHK732j5C+YBkgvLi5oAD5l38akvzTrFHDMe8VerTp dd1YrL/Oq24wmf1zybq+GT6Ox0VOnzumu5sCRa9gcL+4iOE1BVWxJI5Q33Zd/CYSbCABuKJqXLl eufYd7/6CsuiYbb7TXGFzCwgo+qglQcj21c9OtOzYwOS0ftv6fPT5+PqTgr2d17s6yOCDKp/34v tkHUg2JXhPSizZx+/kYEiYUldM3slO1iRG4nXQ93jX1S8PDF7Hfnvd67jc2tJlVgejY9URoAm5w 4VrIEX3lD0UW15ls7mwIwjsRSvsSJe8ctiyWeDfgctyHTmCW54lXz6AHdF72HzWxZJMaDqmrUnY OXuESQ0elDEcqisO9BA== X-Proofpoint-Spam-Info: AW1haW4tMjYxMjAxMDA0NyBTYWx0ZWRfX/l8RNe9dtObo edtjKmjwVuluKKz3kUtCRPsJYXlDyhXSVA17NaSKSqSpYFC+ic5uccIzQ3Ut2hX7q9FCYNRV5qC JG65zGpBld3HUtu85zsAhmTX9rrEY8I= X-Authority-Analysis: v=2.4 cv=H8BOUOYi c=1 sm=1 tr=0 ts=6b0eb54f cx=c_pps a=qKBjSQ1v91RyAK45QCPf5w==:117 a=eGCDHFSXubCXFTSSGhjuOA==:17 a=IkcTkHD0fZMA:10 a=pUM-KoujPXoA:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=u7WPNUs3qKkmUXheDGA7:22 a=_glEPmIy2e8OvE2BGh3C:22 a=EUspDBNiAAAA:8 a=NnsE85wMPa-IRInw_3sA:9 a=QEXdDO2ut3YA:10 a=NFOGd7dJGGMPyQGDc5-O:22 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-01_02,2026-11-30_01,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 lowpriorityscore=0 malwarescore=0 phishscore=0 priorityscore=1501 bulkscore=0 adultscore=0 impostorscore=0 clxscore=1015 suspectscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2611040001 definitions=main-2612010047 Hi Loic, On 11/27/2026 6:11 PM, Loic Poulain wrote: > Buffers are stamped from the write master done interrupt, once the frame > has been written out to memory, while V4L2 defines vb2_buf.timestamp as > the time the first data byte was captured. Use the SOF time the CSID > already computes instead, handed to the VFE the same way as the SOF > sequence number. Hardware without SOF tracking keeps using the buf done > time. > > Signed-off-by: Loic Poulain > --- > drivers/media/platform/qcom/camss/camss-vfe-17x.c | 7 +++++-- > drivers/media/platform/qcom/camss/camss-vfe.c | 8 ++++++-- > drivers/media/platform/qcom/camss/camss-vfe.h | 1 + > 3 files changed, 12 insertions(+), 4 deletions(-) > > diff --git a/drivers/media/platform/qcom/camss/camss-vfe-17x.c b/drivers/media/platform/qcom/camss/camss-vfe-17x.c > index 4972d3ab65078387735ef2e853bf1c9c3d82baee..6b8df1f6e2a731ccd0e739edaa82221c18203f74 100644 > --- a/drivers/media/platform/qcom/camss/camss-vfe-17x.c > +++ b/drivers/media/platform/qcom/camss/camss-vfe-17x.c > @@ -472,7 +472,6 @@ static void vfe_isr_wm_done(struct vfe_device *vfe, u8 wm) > struct vfe_output *output; > unsigned long flags; > u32 index; > - u64 ts = ktime_get_ns(); > > spin_lock_irqsave(&vfe->output_lock, flags); > > @@ -490,7 +489,11 @@ static void vfe_isr_wm_done(struct vfe_device *vfe, u8 wm) > goto out_unlock; > } > > - ready_buf->vb.vb2_buf.timestamp = ts; > + if (line->sof_ts) > + ready_buf->vb.vb2_buf.timestamp = atomic64_read(line->sof_ts); > + else > + ready_buf->vb.vb2_buf.timestamp = ktime_get_ns(); I am not sure that this correct thing to do. WM done can be received after the next SOF in pixel path. I think that i have commented this for the sof_seq as well. The proper way is during SOF or RUP or EPOC to check what is the current active buffer (which is filled) and fill the sequence and timestamp there. ~Gjorgji > + > if (line->sof_seq) > ready_buf->vb.sequence = atomic_read(line->sof_seq); > else > diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c > index f9bd2367671f6e50c6948a6405f78b8c2b03e5f7..ab4edb14ed7486724f12fbd024e0600d70f8355d 100644 > --- a/drivers/media/platform/qcom/camss/camss-vfe.c > +++ b/drivers/media/platform/qcom/camss/camss-vfe.c > @@ -456,7 +456,6 @@ void vfe_buf_done(struct vfe_device *vfe, int wm) > struct vfe_output *output; > unsigned long flags; > u32 index; > - u64 ts = ktime_get_ns(); > > spin_lock_irqsave(&vfe->output_lock, flags); > > @@ -474,7 +473,11 @@ void vfe_buf_done(struct vfe_device *vfe, int wm) > goto out_unlock; > } > > - ready_buf->vb.vb2_buf.timestamp = ts; > + if (line->sof_ts) > + ready_buf->vb.vb2_buf.timestamp = atomic64_read(line->sof_ts); > + else > + ready_buf->vb.vb2_buf.timestamp = ktime_get_ns(); > + > if (line->sof_seq) > ready_buf->vb.sequence = atomic_read(line->sof_seq); > else > @@ -532,6 +535,7 @@ int vfe_enable_output_v2(struct vfe_line *line) > > csid_pad = media_pad_remote_pad_first(&line->pads[MSM_VFE_PAD_SINK]); > line->sof_seq = csid_get_sof_seq(csid_pad); > + line->sof_ts = csid_get_sof_ts(csid_pad); > > spin_lock_irqsave(&vfe->output_lock, flags); > > diff --git a/drivers/media/platform/qcom/camss/camss-vfe.h b/drivers/media/platform/qcom/camss/camss-vfe.h > index c37526caf9a6fc052c3f4ab4215e635167f6da95..8eda4592257169d04027a9a3c45233ac937eecae 100644 > --- a/drivers/media/platform/qcom/camss/camss-vfe.h > +++ b/drivers/media/platform/qcom/camss/camss-vfe.h > @@ -95,6 +95,7 @@ struct vfe_line { > const struct camss_format_info *formats; > unsigned int nformats; > atomic_t *sof_seq; > + atomic64_t *sof_ts; > }; > > struct vfe_device; >