From patchwork Mon Aug 23 13:12:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13445 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id BB9A1BD87C for ; Mon, 23 Aug 2021 13:12:39 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 79D10688E5; Mon, 23 Aug 2021 15:12:39 +0200 (CEST) Authentication-Results: lancelot.ideasonboard.com; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.b="RASyjUv1"; dkim-atps=neutral Received: from mail-pg1-x52f.google.com (mail-pg1-x52f.google.com [IPv6:2607:f8b0:4864:20::52f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 38C3268892 for ; Mon, 23 Aug 2021 15:12:37 +0200 (CEST) Received: by mail-pg1-x52f.google.com with SMTP id e7so16617252pgk.2 for ; Mon, 23 Aug 2021 06:12:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=dA3NswfHOdIMk4OjM0SyDPL0RUS/V4KcyBeK+nmoKVg=; b=RASyjUv1jP3B3By56raG7xNoz7ieeMvSfA/PctIqaaI93BMfBqmi0s6Xp/s2nVdtmI 65xcf1V9P5bONudQY0NnPGdG2Dc/fmNYdBeoqo5++YtyA+0SLkF7ldlQ9m8gjL8vNZYf TUOjvtWLtLNV8+Bty+dJlsM09NSkOYUtLILeE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=dA3NswfHOdIMk4OjM0SyDPL0RUS/V4KcyBeK+nmoKVg=; b=hkj2Yjx/52rgDXMHZPq1ecEsbGLvp+63cNU4c0PQsUYPJkBoP9PysnbesehH38HoMD 0UBCNEpOIFdmZD5YaiCvk7kaBofM8KA5/BlkTa5ZJGm7eRWzk3C6ydpaqC+hs61fO9W/ Zkpj+EEnGspOXejRQa+IF3wXv8T6HDPwYcC6D9AFB6/Y4YrEGj3EbG7TLeOCqmLqTSFH dA5gTrLpBpnke9vFGtiVZjMJuPwv8lcBkGVuhYsxuDi6BWwkhX4TqTlLuTZV85u2PWVo CxFydcDAomv0NLMV2cU4YIEhEcdw2BMml3Ws745ZobmINmMtp+ZLO1P1E6VlcAqI9iJL yKgg== X-Gm-Message-State: AOAM531jYBotx3UH9giqx9zCBy4CuPoSTeJX07jE3716rGX1ByXZz2qy IWxNVT6GRpY9iwCO+0kI1afYAG4agT/s5w== X-Google-Smtp-Source: ABdhPJx6DVyRE2wSoZxr5tyIs9/nC2E4Dj1U7o1d3K3efLxmXTgyWTtcTDq/xQrrJPwbzkrVziDECw== X-Received: by 2002:a62:1b92:0:b0:3eb:3f92:724 with SMTP id b140-20020a621b92000000b003eb3f920724mr2026550pfb.3.1629724355547; Mon, 23 Aug 2021 06:12:35 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:184e:5d20:8fcb:dfcd]) by smtp.gmail.com with ESMTPSA id j4sm18596891pgi.6.2021.08.23.06.12.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Aug 2021 06:12:35 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 23 Aug 2021 22:12:13 +0900 Message-Id: <20210823131221.1034059-3-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc2.250.ged5fa647cd-goog In-Reply-To: <20210823131221.1034059-1-hiroh@chromium.org> References: <20210823131221.1034059-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH v2 02/10] libcamera: ipa_data_serializer: Modify (de)serialization for offset X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" The offset variable is added to FrameBuffer::Plane. This modifies the serialization and deserialization code for the offset variable. Signed-off-by: Hirokazu Honda Reviewed-by: Laurent Pinchart --- src/libcamera/ipa_data_serializer.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/libcamera/ipa_data_serializer.cpp b/src/libcamera/ipa_data_serializer.cpp index 5b183c70..8d1ae4d2 100644 --- a/src/libcamera/ipa_data_serializer.cpp +++ b/src/libcamera/ipa_data_serializer.cpp @@ -569,6 +569,7 @@ FileDescriptor IPADataSerializer::deserialize(const std::vector< * FrameBuffer::Plane is serialized as: * * 4 byte - FileDescriptor + * 4 bytes - uint32_t Offset * 4 bytes - uint32_t Length */ template<> @@ -586,6 +587,7 @@ IPADataSerializer::serialize(const FrameBuffer::Plane &data, dataVec.insert(dataVec.end(), fdBuf.begin(), fdBuf.end()); fdsVec.insert(fdsVec.end(), fdFds.begin(), fdFds.end()); + appendPOD(dataVec, data.offset); appendPOD(dataVec, data.length); return { dataVec, fdsVec }; @@ -603,7 +605,8 @@ IPADataSerializer::deserialize(std::vector::const_i ret.fd = IPADataSerializer::deserialize(dataBegin, dataBegin + 4, fdsBegin, fdsBegin + 1); - ret.length = readPOD(dataBegin, 4, dataEnd); + ret.offset = readPOD(dataBegin, 1, dataEnd); + ret.length = readPOD(dataBegin, 5, dataEnd); return ret; }