Skip to content

Commit

Permalink
camerad: build camerad on PC (#25726)
Browse files Browse the repository at this point in the history
* compile camerad on PC

* scons cleanup

Co-authored-by: Adeeb Shihadeh <[email protected]>
  • Loading branch information
deanlee and adeebshihadeh authored Sep 11, 2022
1 parent f6398ea commit 29f9c53
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 54 deletions.
3 changes: 0 additions & 3 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,6 @@ if arch == "larch64":
"#third_party/libyuv/larch64/lib",
"/usr/lib/aarch64-linux-gnu"
]
cpppath += [
"#system/camerad/include",
]
cflags = ["-DQCOM2", "-mcpu=cortex-a57"]
cxxflags = ["-DQCOM2", "-mcpu=cortex-a57"]
rpath += ["/usr/local/lib"]
Expand Down
24 changes: 10 additions & 14 deletions system/camerad/SConscript
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
Import('env', 'arch', 'cereal', 'messaging', 'common', 'gpucommon', 'visionipc')

libs = ['m', 'pthread', common, 'jpeg', 'OpenCL', 'yuv', cereal, messaging, 'zmq', 'capnp', 'kj', visionipc, gpucommon]
libs = ['m', 'pthread', common, 'jpeg', 'OpenCL', 'yuv', cereal, messaging, 'zmq', 'capnp', 'kj', visionipc, gpucommon, 'atomic']

cameras = []
if arch == "larch64":
libs += ['atomic']
cameras = ['cameras/camera_qcom2.cc']
cenv = env.Clone()
cenv['CPPPATH'].append('include/')

env.Program('camerad', [
'main.cc',
'cameras/camera_common.cc',
'cameras/camera_util.cc',
'imgproc/utils.cc',
cameras,
], LIBS=libs)
camera_obj = cenv.Object(['cameras/camera_qcom2.cc', 'cameras/camera_common.cc', 'cameras/camera_util.cc'])
cenv.Program('camerad', [
'main.cc',
camera_obj,
], LIBS=libs)

if GetOption("test") and arch == "x86_64":
env.Program('test/ae_gray_test', [
cenv.Program('test/ae_gray_test', [
'test/ae_gray_test.cc',
'cameras/camera_common.cc',
camera_obj,
], LIBS=libs)
4 changes: 1 addition & 3 deletions system/camerad/cameras/camera_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,9 @@
#include "system/hardware/hw.h"
#include "msm_media_info.h"

#include "system/camerad/cameras/camera_qcom2.h"
#ifdef QCOM2
#include "CL/cl_ext_qcom.h"
#include "system/camerad/cameras/camera_qcom2.h"
#else
#include "system/camerad/test/camera_test.h"
#endif

ExitHandler do_exit;
Expand Down
1 change: 0 additions & 1 deletion system/camerad/cameras/camera_qcom2.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1304,4 +1304,3 @@ void cameras_run(MultiCameraState *s) {

cameras_close(s);
}

15 changes: 9 additions & 6 deletions system/camerad/main.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
#include "system/hardware/hw.h"

int main(int argc, char *argv[]) {
if (!Hardware::PC()) {
int ret;
ret = util::set_realtime_priority(53);
assert(ret == 0);
ret = util::set_core_affinity({6});
assert(ret == 0 || Params().getBool("IsOffroad")); // failure ok while offroad due to offlining cores
if (Hardware::PC()) {
printf("camerad is not meant to run on PC\n");
return 0;
}

int ret;
ret = util::set_realtime_priority(53);
assert(ret == 0);
ret = util::set_core_affinity({6});
assert(ret == 0 || Params().getBool("IsOffroad")); // failure ok while offroad due to offlining cores

camerad_thread();
return 0;
}
27 changes: 0 additions & 27 deletions system/camerad/test/camera_test.h

This file was deleted.

0 comments on commit 29f9c53

Please sign in to comment.