From patchwork Mon Aug 16 04:31:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13360 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 BE8A6BD87D for ; Mon, 16 Aug 2021 04:31:52 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 7D1BD688A3; Mon, 16 Aug 2021 06:31:52 +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="a7COMVNi"; dkim-atps=neutral Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id ED090688A5 for ; Mon, 16 Aug 2021 06:31:49 +0200 (CEST) Received: by mail-pl1-x62e.google.com with SMTP id l11so19403618plk.6 for ; Sun, 15 Aug 2021 21:31:49 -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=MvGbJNKDMTcMJvLM1bMSKiW53fH3DOp/ai6lDpTjr3s=; b=a7COMVNiu3/omF99ctQ4E3/aJRIXBe7fSFSggW3kqDz+aqGE6ewYpo9zKzNTM+XTtd kAbmkXucA35qrix9S+OCb3ErVdKSTHMJ83tvD/6JVM7mqwyDboEgucrRospm6okBsLbN bnoc/g04TJ5Jv5na3eAc6XpORmwDajF5wcjmY= 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=MvGbJNKDMTcMJvLM1bMSKiW53fH3DOp/ai6lDpTjr3s=; b=iWA92HlrksY92Wiogdrgxxl7YrmleSDRz5hcUy/mTGdW6PkRi/A0AlzH7+NNCK9XBc bfA67zTl4XD3n9Ukzdc0I3i/i7IJCqgOOVySxfmrUp6BZ6RiqDoDwpW1wZ35GMK5isvh bTih+Wfh/OGnn4Qljiw25RIRb75k8W0wShVzMp5XjfNb7XUaSfjUVqIWqDwv7RphpoJe QTVInlZBjpzpXala/cmncE9+MryXUfyZsv8QE5ULQqQOXaUsoXy6OfEbzyh4q7KqlQga qc3maUHeQL9BgSqftilVlmRoT19PJe/RcqXreadBQU0nakbHs7nYLP3t17/8HQqnjL4f ZHfQ== X-Gm-Message-State: AOAM531nQfnIvhwXP1cJ07ykHPB6zEsVHsIg9EJimh5/ON1zfPqaCcha edTgOm/QWM8JwvIYXjmU3YVA7yLbtMZxbw== X-Google-Smtp-Source: ABdhPJxJLFbn7ckW5Ov2fbY0WDqCvXhIPBjXu09y4N+rS/A+RIbbIJp0PjGOuvBY+6JaUQq3VcyV+w== X-Received: by 2002:a17:90a:4211:: with SMTP id o17mr15290439pjg.176.1629088308238; Sun, 15 Aug 2021 21:31:48 -0700 (PDT) Received: from hiroh2.tok.corp.google.com ([2401:fa00:8f:203:6f5f:1479:a6ab:4229]) by smtp.gmail.com with ESMTPSA id u10sm2767417pgj.48.2021.08.15.21.31.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 21:31:47 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Aug 2021 13:31:30 +0900 Message-Id: <20210816043138.957984-3-hiroh@chromium.org> X-Mailer: git-send-email 2.33.0.rc1.237.g0d66db33f3-goog In-Reply-To: <20210816043138.957984-1-hiroh@chromium.org> References: <20210816043138.957984-1-hiroh@chromium.org> MIME-Version: 1.0 Subject: [libcamera-devel] [RFC PATCH 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 fb941e6b..144c3248 100644 --- a/src/libcamera/ipa_data_serializer.cpp +++ b/src/libcamera/ipa_data_serializer.cpp @@ -562,6 +562,7 @@ FileDescriptor IPADataSerializer::deserialize(const std::vector< * FrameBuffer::Plane is serialized as: * * 1 byte - FileDescriptor + * 4 bytes - uint32_t Offset * 4 bytes - uint32_t Length */ template<> @@ -580,6 +581,7 @@ IPADataSerializer::serialize(const FrameBuffer::Plane &data, fdsVec.insert(fdsVec.end(), fdFds.begin(), fdFds.end()); appendPOD(dataVec, data.length); + appendPOD(dataVec, data.offset); return { dataVec, fdsVec }; } @@ -596,7 +598,8 @@ IPADataSerializer::deserialize(std::vector::const_i ret.fd = IPADataSerializer::deserialize(dataBegin, dataBegin + 1, fdsBegin, fdsBegin + 1); - ret.length = readPOD(dataBegin, 1, dataEnd); + ret.offset = readPOD(dataBegin, 1, dataBegin + 2); + ret.length = readPOD(dataBegin + 1, 1, dataEnd); return ret; }