* [Buildroot] [PATCH 1/1] package/libcec: Add option to use kernel framework
@ 2026-06-29 2:06 Stefan Ott via buildroot
2026-10-10 20:15 ` Peter Korsgaard
0 siblings, 1 reply; 2+ messages in thread
From: Stefan Ott via buildroot @ 2026-06-29 2:06 UTC (permalink / raw)
To: buildroot; +Cc: Bernd Kuhls, Stefan Ott
As explained in libcec's README.raspberrypi.md:
On a recent Raspberry Pi that's using the vc4_kms_3d dtoverlay,
you have to use the Linux Kernel driver and disable the Raspberry Pi
driver with -DHAVE_RPI_API=0 to use CEC.
This patch adds an option to do just that to the libcec package.
Signed-off-by: Stefan Ott <stefan@ott.net>
---
package/libcec/Config.in | 9 +++++++++
package/libcec/libcec.mk | 6 ++++++
2 files changed, 15 insertions(+)
diff --git a/package/libcec/Config.in b/package/libcec/Config.in
index 2dddc53635..136891a6e3 100644
--- a/package/libcec/Config.in
+++ b/package/libcec/Config.in
@@ -13,6 +13,15 @@ config BR2_PACKAGE_LIBCEC
http://libcec.pulse-eight.com
+config BR2_PACKAGE_LIBCEC_LINUX_API
+ bool "enable Linux kernel CEC framework support"
+ default y if BR2_arm || BR2_aarch64
+ depends on BR2_PACKAGE_LIBCEC
+ help
+ enable modern Linux Kernel CEC Framework support
+
+ This is needed to use CEC on the Raspberry Pi
+
comment "libcec needs a toolchain w/ C++, wchar, threads, dynamic library, gcc >= 4.7"
depends on !BR2_INSTALL_LIBSTDCPP || !BR2_TOOLCHAIN_HAS_THREADS || \
!BR2_USE_WCHAR || !BR2_TOOLCHAIN_GCC_AT_LEAST_4_7 || \
diff --git a/package/libcec/libcec.mk b/package/libcec/libcec.mk
index 0e730503da..f7c5bce204 100644
--- a/package/libcec/libcec.mk
+++ b/package/libcec/libcec.mk
@@ -24,6 +24,12 @@ ifeq ($(BR2_PACKAGE_XLIB_LIBXRANDR),y)
LIBCEC_DEPENDENCIES += xlib_libXrandr
endif
+ifeq ($(BR2_PACKAGE_LIBCEC_LINUX_API),y)
+LIBCEC_CONF_OPTS += \
+ -DHAVE_RPI_API=0 \
+ -DHAVE_LINUX_API=1
+endif
+
# Disable information about how libCEC is compiled.
LIBCEC_CONF_OPTS += -DHAVE_GIT_BIN="" \
-DHAVE_WHOAMI_BIN="" \
--
2.54.0
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Buildroot] [PATCH 1/1] package/libcec: Add option to use kernel framework
2026-06-29 2:06 [Buildroot] [PATCH 1/1] package/libcec: Add option to use kernel framework Stefan Ott via buildroot
@ 2026-10-10 20:15 ` Peter Korsgaard
0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2026-10-10 20:15 UTC (permalink / raw)
To: Stefan Ott via buildroot; +Cc: Stefan Ott, Bernd Kuhls
>>>>> "Stefan" == Stefan Ott via buildroot <buildroot@buildroot.org> writes:
Hi,
> As explained in libcec's README.raspberrypi.md:
> On a recent Raspberry Pi that's using the vc4_kms_3d dtoverlay,
> you have to use the Linux Kernel driver and disable the Raspberry Pi
> driver with -DHAVE_RPI_API=0 to use CEC.
> This patch adds an option to do just that to the libcec package.
..
> +ifeq ($(BR2_PACKAGE_LIBCEC_LINUX_API),y)
> +LIBCEC_CONF_OPTS += \
> + -DHAVE_RPI_API=0 \
> + -DHAVE_LINUX_API=1
HAVE_RPI_API defaults to off, so no need to explicitly set it 0. The
Linux API needs the linux/cec.h header which was added in 4.10, so we
need a dependency on >= 4.10 headers.
The Linux API support only adds around ~3% to the build size, so I
think it makes most sense to automatically enable it if the kernel
headers are new enough rather than an option:
-rwxr-xr-x 1 peko peko 594K Oct 10 18:53 target/usr/lib/libcec.so.8.1.7.without
-rwxr-xr-x 1 peko peko 614K Oct 10 18:53 target/usr/lib/libcec.so.8.1.7.with
Committed with that changed, thanks.
--
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-10 20:16 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-29 2:06 [Buildroot] [PATCH 1/1] package/libcec: Add option to use kernel framework Stefan Ott via buildroot
2026-10-10 20:15 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox