daemon: link daedalus-fourier + log substrate availability at startup #13
@@ -28,6 +28,20 @@ find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(FFMPEG REQUIRED IMPORTED_TARGET
|
||||
libavformat libavcodec libavutil)
|
||||
|
||||
# daedalus-fourier — VC VII (V3D) + ARM NEON back-end kernel library.
|
||||
# Linked statically. Today only the no-QPU smoke-test path is wired
|
||||
# (a ctx_create_no_qpu at daemon startup, log-and-destroy at exit);
|
||||
# follow-up patches (per daedalus-v4l2#11) substitute the
|
||||
# `daedalus_recipe_dispatch_h264_*` family for libavcodec's per-MB
|
||||
# pixel primitives, one cycle at a time.
|
||||
#
|
||||
# We bypass IMPORTED_TARGET and consume pkg-config's static variables
|
||||
# (--static --libs path) directly so we control the link order:
|
||||
# libdaedalus_core.a must precede -lvulkan because the static archive
|
||||
# references vulkan symbols and the linker resolves left-to-right.
|
||||
pkg_check_modules(DAEDALUS_FOURIER REQUIRED daedalus-fourier)
|
||||
find_package(Vulkan REQUIRED)
|
||||
|
||||
add_executable(daedalus_v4l2_daemon
|
||||
src/main.c
|
||||
src/ffmpeg_loader.c
|
||||
@@ -45,13 +59,23 @@ target_include_directories(daedalus_v4l2_daemon
|
||||
src
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/../include
|
||||
${FFMPEG_INCLUDE_DIRS}
|
||||
${DAEDALUS_FOURIER_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
# dl for dlopen, pthread for future threading work.
|
||||
target_link_directories(daedalus_v4l2_daemon
|
||||
PRIVATE
|
||||
${DAEDALUS_FOURIER_LIBRARY_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(daedalus_v4l2_daemon
|
||||
PRIVATE
|
||||
dl
|
||||
pthread
|
||||
# Order matters: libdaedalus_core.a first (so its undefined
|
||||
# vulkan symbols register), then -lvulkan to satisfy them.
|
||||
${DAEDALUS_FOURIER_LIBRARIES}
|
||||
Vulkan::Vulkan
|
||||
)
|
||||
|
||||
install(TARGETS daedalus_v4l2_daemon
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
|
||||
#include <libavutil/log.h>
|
||||
|
||||
#include <daedalus.h>
|
||||
|
||||
static volatile sig_atomic_t g_terminate = 0;
|
||||
|
||||
static void on_signal(int sig)
|
||||
@@ -120,6 +122,26 @@ int main(int argc, char **argv)
|
||||
/* Mute FFmpeg's own chattiness unless the user asked. */
|
||||
fm.av_log_set_level(verbose ? AV_LOG_INFO : AV_LOG_WARNING);
|
||||
|
||||
/*
|
||||
* Initialise daedalus-fourier early so we can log substrate
|
||||
* availability up front. daedalus_ctx_create_no_qpu() skips
|
||||
* the V3D Vulkan probe — we're not dispatching any kernels
|
||||
* yet, this is just the linkage sanity check + a marker in the
|
||||
* journal that the binary is wired against the right
|
||||
* daedalus-fourier version. Future work (per daedalus-v4l2#11)
|
||||
* promotes to daedalus_ctx_create() once shader-path resolution
|
||||
* is wired through the public API.
|
||||
*/
|
||||
daedalus_ctx *df_ctx = daedalus_ctx_create_no_qpu();
|
||||
if (df_ctx) {
|
||||
log_info("daedalus-fourier: linked, ctx alive (no_qpu mode; "
|
||||
"has_qpu=%d)",
|
||||
daedalus_ctx_has_qpu(df_ctx));
|
||||
} else {
|
||||
log_warn("daedalus-fourier: ctx_create_no_qpu returned NULL "
|
||||
"(out of memory?) — continuing without backend kernels");
|
||||
}
|
||||
|
||||
int rc;
|
||||
const char *cmd = argv[i++];
|
||||
if (strcmp(cmd, "parse") == 0) {
|
||||
@@ -132,6 +154,8 @@ int main(int argc, char **argv)
|
||||
rc = 2;
|
||||
}
|
||||
|
||||
if (df_ctx)
|
||||
daedalus_ctx_destroy(df_ctx);
|
||||
ffmpeg_loader_cleanup(&fm);
|
||||
log_cleanup();
|
||||
return rc;
|
||||
|
||||
Reference in New Issue
Block a user