[vlc-commits] mmal: initialize the VideoCore Shared Memory
John Cox
git at videolan.org
Mon Jan 20 08:25:34 CET 2020
vlc | branch: master | John Cox <jc at kynesim.co.uk> | Fri Jan 17 12:02:42 2020 +0100| [54d74eb21cc075525b359aff58acb6ea952a61cd] | committer: Steve Lhomme
mmal: initialize the VideoCore Shared Memory
Signed-off-by: Steve Lhomme <robux4 at ycbcr.xyz>
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=54d74eb21cc075525b359aff58acb6ea952a61cd
---
configure.ac | 2 +-
modules/hw/mmal/mmal_picture.c | 14 ++++++++++++--
2 files changed, 13 insertions(+), 3 deletions(-)
diff --git a/configure.ac b/configure.ac
index c2a2a231ce..f69d719553 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3667,7 +3667,7 @@ if test "${enable_mmal}" != "no"; then
VLC_ADD_PLUGIN([mmal])
VLC_ADD_LDFLAGS([mmal],[ -L/opt/vc/lib ])
VLC_ADD_CFLAGS([mmal],[ -isystem /opt/vc/include -isystem /opt/vc/include/interface/vcos/pthreads -isystem /opt/vc/include/interface/vmcs_host/linux ])
- VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif ]) ], [
+ VLC_ADD_LIBS([mmal],[ -lbcm_host -lmmal -lmmal_core -lmmal_components -lmmal_util -lvchostif -lvcsm ]) ], [
AS_IF([test "${enable_mmal}" = "yes"],
[ AC_MSG_ERROR([Cannot find bcm library...]) ],
[ AC_MSG_WARN([Cannot find bcm library...]) ])
diff --git a/modules/hw/mmal/mmal_picture.c b/modules/hw/mmal/mmal_picture.c
index 0da944b72c..5dd5169a9d 100644
--- a/modules/hw/mmal/mmal_picture.c
+++ b/modules/hw/mmal/mmal_picture.c
@@ -29,6 +29,7 @@
#include <interface/mmal/util/mmal_util.h>
#include <interface/mmal/util/mmal_default_components.h>
#include <interface/vmcs_host/vcgencmd.h>
+#include <interface/vcsm/user-vcsm.h>
#include "mmal_picture.h"
@@ -1020,9 +1021,17 @@ vcsm_init_type_t cma_vcsm_type(void)
vcsm_init_type_t cma_vcsm_init(void)
{
- vcsm_init_type_t rv = VCSM_INIT_LEGACY;
+ vcsm_init_type_t rv = VCSM_INIT_NONE;
+
+ {
+ if (vcsm_init_ex(0, -1) == 0)
+ rv = VCSM_INIT_LEGACY;
+ }
+
+ // Just in case this affects vcsm init do after that
+ if (rv != VCSM_INIT_NONE)
+ bcm_host_init();
- bcm_host_init();
last_vcsm_type = rv;
return rv;
}
@@ -1031,6 +1040,7 @@ void cma_vcsm_exit(const vcsm_init_type_t init_mode)
{
if (init_mode != VCSM_INIT_NONE)
{
+ vcsm_exit();
bcm_host_deinit(); // Does nothing but add in case it ever does
}
}
More information about the vlc-commits
mailing list