| Message ID | 20260804101949.353266-11-barnabas.pocze@ideasonboard.com |
|---|---|
| State | Superseded |
| Headers | show |
| Series |
|
| Related | show |
Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes: > In `SoftwareIsp`, the worker thread is recreated each time it is started. > In order to avoid any potential leaks from the egl implementation, remove > the currently bound egl context in `DebayerEGL::stop()`. Should it be perhaps done in resetEGLContext, the counterpart of initEGLContext, where the context is set? > Mesa does not seem to have any destructors for its egl thread data, > so the context in those cases does not seem to be properly destroyed. > > Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> > --- > src/libcamera/software_isp/debayer_egl.cpp | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp > index afc6b02748..3405cdd56a 100644 > --- a/src/libcamera/software_isp/debayer_egl.cpp > +++ b/src/libcamera/software_isp/debayer_egl.cpp > @@ -680,6 +680,7 @@ void DebayerEGL::stop() > if (programId_) > glDeleteProgram(programId_); > > + egl_.makeCurrent(false); > egl_.resetEGLContext(); > }
2026. 08. 05. 13:36 keltezéssel, Milan Zamazal írta: > Barnabás Pőcze <barnabas.pocze@ideasonboard.com> writes: > >> In `SoftwareIsp`, the worker thread is recreated each time it is started. >> In order to avoid any potential leaks from the egl implementation, remove >> the currently bound egl context in `DebayerEGL::stop()`. > > Should it be perhaps done in resetEGLContext, the counterpart of > initEGLContext, where the context is set? Good point, I initially did not want to do that because the context should be destroy-able from a different thread, as far as I'm aware. But given the very narrow use cases here, and that it would make it a perfect "inverse" of `initEGLContext()`, I'll try to do it. And then I suppose the modification to `makeCurrent()` won't be needed. > >> Mesa does not seem to have any destructors for its egl thread data, >> so the context in those cases does not seem to be properly destroyed. >> >> Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> >> --- >> src/libcamera/software_isp/debayer_egl.cpp | 1 + >> 1 file changed, 1 insertion(+) >> >> diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp >> index afc6b02748..3405cdd56a 100644 >> --- a/src/libcamera/software_isp/debayer_egl.cpp >> +++ b/src/libcamera/software_isp/debayer_egl.cpp >> @@ -680,6 +680,7 @@ void DebayerEGL::stop() >> if (programId_) >> glDeleteProgram(programId_); >> >> + egl_.makeCurrent(false); >> egl_.resetEGLContext(); >> } >
diff --git a/src/libcamera/software_isp/debayer_egl.cpp b/src/libcamera/software_isp/debayer_egl.cpp index afc6b02748..3405cdd56a 100644 --- a/src/libcamera/software_isp/debayer_egl.cpp +++ b/src/libcamera/software_isp/debayer_egl.cpp @@ -680,6 +680,7 @@ void DebayerEGL::stop() if (programId_) glDeleteProgram(programId_); + egl_.makeCurrent(false); egl_.resetEGLContext(); }
In `SoftwareIsp`, the worker thread is recreated each time it is started. In order to avoid any potential leaks from the egl implementation, remove the currently bound egl context in `DebayerEGL::stop()`. Mesa does not seem to have any destructors for its egl thread data, so the context in those cases does not seem to be properly destroyed. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> --- src/libcamera/software_isp/debayer_egl.cpp | 1 + 1 file changed, 1 insertion(+)