[libcamera-devel] [RFC PATCH 05/10] ipa: rkisp1: Use offset in mapping IPABuffer

Hirokazu Honda hiroh at chromium.org
Mon Aug 16 06:31:33 CEST 2021


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 <hiroh at chromium.org>
---
 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<IPABuffer> &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<unsigned int> &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);
 	}
-- 
2.33.0.rc1.237.g0d66db33f3-goog



More information about the libcamera-devel mailing list