[RFC,v1,08/10] libcamera: software_isp: debayer_egl: Remove EGL context switch
diff mbox series

Message ID 20260804101949.353266-9-barnabas.pocze@ideasonboard.com
State Superseded
Headers show
Series
  • libcamera: software_isp: debayer_egl: Remove some leaks
Related show

Commit Message

Barnabás Pőcze Aug. 4, 2026, 10:19 a.m. UTC
`eGL::initEGLContext()`, which is called from the worker thread already
includes a call to `eGL::makeCurrent()`, so calling it for each
`process()` is not necessary, so skip it.

Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
---
 src/libcamera/software_isp/debayer_egl.cpp | 3 ---
 1 file changed, 3 deletions(-)

Comments

Milan Zamazal Aug. 5, 2026, 11:24 a.m. UTC | #1
Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes:

> `eGL::initEGLContext()`, which is called from the worker thread already
> includes a call to `eGL::makeCurrent()`, so calling it for each
> `process()` is not necessary, so skip it.

Tracing threads is difficult.  It might be good to add ASSERT on tid_ in
place of the removed makeCurrent() call.

> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com>
> ---
>  src/libcamera/software_isp/debayer_egl.cpp | 3 ---
>  1 file changed, 3 deletions(-)
>
> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
> index 35a5c56321..afc6b02748 100644
> --- a/src/libcamera/software_isp/debayer_egl.cpp
> +++ b/src/libcamera/software_isp/debayer_egl.cpp
> @@ -578,9 +578,6 @@ int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, const Debaye
>  	eGLImage *eglImageIn;
>  	eGLImage *eglImageOut;
>  
> -	/* eGL context switch */
> -	egl_.makeCurrent();
> -
>  	eglImageIn = getCachedInputFrameBuffer(input, inMapped, inDmaSyncer);
>  	if (!eglImageIn)
>  		return -ENOMEM;

Patch
diff mbox series

diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp
index 35a5c56321..afc6b02748 100644
--- a/src/libcamera/software_isp/debayer_egl.cpp
+++ b/src/libcamera/software_isp/debayer_egl.cpp
@@ -578,9 +578,6 @@  int DebayerEGL::debayerGPU(FrameBuffer *input, FrameBuffer *output, const Debaye
 	eGLImage *eglImageIn;
 	eGLImage *eglImageOut;
 
-	/* eGL context switch */
-	egl_.makeCurrent();
-
 	eglImageIn = getCachedInputFrameBuffer(input, inMapped, inDmaSyncer);
 	if (!eglImageIn)
 		return -ENOMEM;