[libcamera-devel,IPU3-IPA] libcamera-helpers: mapped_framebuffer: Update to new FD API
diff mbox series

Message ID 20211203174853.130537-1-kieran.bingham@ideasonboard.com
State Accepted
Headers show
Series
  • [libcamera-devel,IPU3-IPA] libcamera-helpers: mapped_framebuffer: Update to new FD API
Related show

Commit Message

Kieran Bingham Dec. 3, 2021, 5:48 p.m. UTC
The plane file descriptors API has been updated in the libcamera
base library.

Update our mapped_framebuffer class accordingly.

Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/libcamera-helpers/mapped_framebuffer.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Laurent Pinchart Dec. 3, 2021, 6:56 p.m. UTC | #1
Hi Kieran,

Thank you for the patch.

On Fri, Dec 03, 2021 at 05:48:53PM +0000, Kieran Bingham wrote:
> The plane file descriptors API has been updated in the libcamera
> base library.
> 
> Update our mapped_framebuffer class accordingly.
> 
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>

Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  src/libcamera-helpers/mapped_framebuffer.cpp | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/src/libcamera-helpers/mapped_framebuffer.cpp b/src/libcamera-helpers/mapped_framebuffer.cpp
> index a65740831331..3d231147ed91 100644
> --- a/src/libcamera-helpers/mapped_framebuffer.cpp
> +++ b/src/libcamera-helpers/mapped_framebuffer.cpp
> @@ -198,7 +198,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
>  	std::map<int, MappedBufferInfo> mappedBuffers;
>  
>  	for (const FrameBuffer::Plane &plane : buffer->planes()) {
> -		const int fd = plane.fd.fd();
> +		const int fd = plane.fd.get();
>  		if (mappedBuffers.find(fd) == mappedBuffers.end()) {
>  			const size_t length = lseek(fd, 0, SEEK_END);
>  			mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };
> @@ -220,7 +220,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
>  	}
>  
>  	for (const FrameBuffer::Plane &plane : buffer->planes()) {
> -		const int fd = plane.fd.fd();
> +		const int fd = plane.fd.get();
>  		auto &info = mappedBuffers[fd];
>  		if (!info.address) {
>  			void *address = mmap(nullptr, info.mapLength, mmapFlags,
Umang Jain Dec. 6, 2021, 5:51 a.m. UTC | #2
Hi Kieran,

On 12/3/21 11:18 PM, Kieran Bingham wrote:
> The plane file descriptors API has been updated in the libcamera
> base library.
>
> Update our mapped_framebuffer class accordingly.
>
> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
> ---
>   src/libcamera-helpers/mapped_framebuffer.cpp | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/src/libcamera-helpers/mapped_framebuffer.cpp b/src/libcamera-helpers/mapped_framebuffer.cpp
> index a65740831331..3d231147ed91 100644
> --- a/src/libcamera-helpers/mapped_framebuffer.cpp
> +++ b/src/libcamera-helpers/mapped_framebuffer.cpp
> @@ -198,7 +198,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
>   	std::map<int, MappedBufferInfo> mappedBuffers;
>   
>   	for (const FrameBuffer::Plane &plane : buffer->planes()) {
> -		const int fd = plane.fd.fd();
> +		const int fd = plane.fd.get();
>   		if (mappedBuffers.find(fd) == mappedBuffers.end()) {
>   			const size_t length = lseek(fd, 0, SEEK_END);
>   			mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };
> @@ -220,7 +220,7 @@ MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
>   	}
>   
>   	for (const FrameBuffer::Plane &plane : buffer->planes()) {
> -		const int fd = plane.fd.fd();
> +		const int fd = plane.fd.get();
>   		auto &info = mappedBuffers[fd];
>   		if (!info.address) {
>   			void *address = mmap(nullptr, info.mapLength, mmapFlags,

Patch
diff mbox series

diff --git a/src/libcamera-helpers/mapped_framebuffer.cpp b/src/libcamera-helpers/mapped_framebuffer.cpp
index a65740831331..3d231147ed91 100644
--- a/src/libcamera-helpers/mapped_framebuffer.cpp
+++ b/src/libcamera-helpers/mapped_framebuffer.cpp
@@ -198,7 +198,7 @@  MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
 	std::map<int, MappedBufferInfo> mappedBuffers;
 
 	for (const FrameBuffer::Plane &plane : buffer->planes()) {
-		const int fd = plane.fd.fd();
+		const int fd = plane.fd.get();
 		if (mappedBuffers.find(fd) == mappedBuffers.end()) {
 			const size_t length = lseek(fd, 0, SEEK_END);
 			mappedBuffers[fd] = MappedBufferInfo{ nullptr, 0, length };
@@ -220,7 +220,7 @@  MappedFrameBuffer::MappedFrameBuffer(const FrameBuffer *buffer, MapFlags flags)
 	}
 
 	for (const FrameBuffer::Plane &plane : buffer->planes()) {
-		const int fd = plane.fd.fd();
+		const int fd = plane.fd.get();
 		auto &info = mappedBuffers[fd];
 		if (!info.address) {
 			void *address = mmap(nullptr, info.mapLength, mmapFlags,