From patchwork Mon Aug 16 04:31:33 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hirokazu Honda X-Patchwork-Id: 13363 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 0865EC3241 for ; Mon, 16 Aug 2021 04:31:57 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id BE2806888C; Mon, 16 Aug 2021 06:31:56 +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="Me7+xVkU"; dkim-atps=neutral Received: from mail-pj1-x1034.google.com (mail-pj1-x1034.google.com [IPv6:2607:f8b0:4864:20::1034]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 26C5F6888C for ; Mon, 16 Aug 2021 06:31:55 +0200 (CEST) Received: by mail-pj1-x1034.google.com with SMTP id j12-20020a17090aeb0c00b00179530520b3so9957438pjz.0 for ; Sun, 15 Aug 2021 21:31:55 -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=fE1vSWJEgZ6nlMPNgdHPWSi5Hp9OUVVHMgM8F+zZWPs=; b=Me7+xVkUe3b9qvmByrsnzJQPy6N0Bb/v9GMATEEGumulMclHhKBKicxdrgwLG0ULJG uEOdYmNXWcFjoTS9k+4vpZVfHsFZa6NyAoUgcXAxxgJ+IMMAVGoUkVs6LBIuUoElu+tn 6QKt9AUmIAJoQHX6yq9+CmGZH9Ss/QDfNRsWQ= 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=fE1vSWJEgZ6nlMPNgdHPWSi5Hp9OUVVHMgM8F+zZWPs=; b=GsadBhlB1GoIXfQRJkVnxygnknzOrH8luSjmTFS2/Fu3xHz9T9I53Imfu29SWSEXTH LL9ZnQkPBpDrdPqpADCmg26S/VGd1/IC41ICr00NdNT7gPfs20dZ9rF0ZBIvbRMYz3Hc ADqwGI3jVtYltmF0LEhdV0qoRDmzVIAOoyRAzhhYIf3yhzDz3DytyPuX9NBLXlqXCjff VhG7Lw3hrJGeoXV1lD1HvRxoBTBW297GtTNC3HuX5uaxGFy0iE1lIAcVH0pc235kpp+i My/+CzzbA0m8PftEFo5neViUGSqelcOLJ9vDsL1YECpg/e94+++RIGCA7yeFaOYMaFm2 zGIg== X-Gm-Message-State: AOAM532QcVTGDcOY7o5BB97dhXMbbxvTtVA56gGLOv/YGDyLbmw24uB/ fe4sFINmPkzzDpgMPtYjEw/V3oIUbwnYSw== X-Google-Smtp-Source: ABdhPJwmSW3Sq62mC1RogThotuMh4eQD/A7KPegPA+QR/5XQxNlJgBAETkyaZch6MRN3oqYRjtVNjQ== X-Received: by 2002:a17:90a:f10:: with SMTP id 16mr14955777pjy.80.1629088313532; Sun, 15 Aug 2021 21:31:53 -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.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 15 Aug 2021 21:31:53 -0700 (PDT) From: Hirokazu Honda To: libcamera-devel@lists.libcamera.org Date: Mon, 16 Aug 2021 13:31:33 +0900 Message-Id: <20210816043138.957984-6-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 05/10] ipa: rkisp1: Use offset in mapping IPABuffer 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" IPABuffer is represented by FrameBuffer. FrameBuffer::Plane has now an offset. This uses the offset variable to map the IPABuffer. Signed-off-by: Hirokazu Honda --- src/ipa/rkisp1/rkisp1.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/ipa/rkisp1/rkisp1.cpp b/src/ipa/rkisp1/rkisp1.cpp index 06fb9640..eb7a2705 100644 --- a/src/ipa/rkisp1/rkisp1.cpp +++ b/src/ipa/rkisp1/rkisp1.cpp @@ -165,7 +165,7 @@ void IPARkISP1::mapBuffers(const std::vector &buffers) * to applications). */ buffersMemory_[buffer.id] = mmap(NULL, - fb.planes()[0].length, + fb.planes()[0].offset + fb.planes()[0].length, PROT_READ | PROT_WRITE, MAP_SHARED, fb.planes()[0].fd.fd(), @@ -186,7 +186,7 @@ void IPARkISP1::unmapBuffers(const std::vector &ids) if (fb == buffers_.end()) continue; - munmap(buffersMemory_[id], fb->second.planes()[0].length); + munmap(buffersMemory_[id], fb->second.planes()[0].offset + fb->second.planes()[0].length); buffersMemory_.erase(id); buffers_.erase(id); }