From 2cedc8715e7ffcee32a90c8eedc721a5a9777069 Mon Sep 17 00:00:00 2001 From: George Hotz <72895+geohot@users.noreply.github.com> Date: Mon, 14 Dec 2020 13:59:48 -0800 Subject: [PATCH] Set camerad CL priority to 4 (#2747) * priority 2 get * add to files_common * cl_ext_qcom Co-authored-by: Comma Device old-commit-hash: cb238fd2ee22bcc6c02c3556f96439b3e08d9415 --- phonelibs/opencl/include/CL/cl_ext_qcom.h | 3 +++ selfdrive/camerad/main.cc | 10 ++++++++++ 2 files changed, 13 insertions(+) create mode 100644 phonelibs/opencl/include/CL/cl_ext_qcom.h diff --git a/phonelibs/opencl/include/CL/cl_ext_qcom.h b/phonelibs/opencl/include/CL/cl_ext_qcom.h new file mode 100644 index 0000000000..6f73335f58 --- /dev/null +++ b/phonelibs/opencl/include/CL/cl_ext_qcom.h @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:11c26633f533f14f5ffac1cc227932e251d6ad86fcac4c7f4e217f046a6e35c5 +size 9331 diff --git a/selfdrive/camerad/main.cc b/selfdrive/camerad/main.cc index 700459c5fc..0712b55a2a 100644 --- a/selfdrive/camerad/main.cc +++ b/selfdrive/camerad/main.cc @@ -319,6 +319,10 @@ void party(cl_device_id device_id, cl_context context) { server_thread.join(); } +#if defined(QCOM) || defined(QCOM2) +#include "CL/cl_ext_qcom.h" +#endif + int main(int argc, char *argv[]) { set_realtime_priority(51); #if defined(QCOM) @@ -331,7 +335,13 @@ int main(int argc, char *argv[]) { signal(SIGTERM, (sighandler_t)set_do_exit); cl_device_id device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT); + +#if defined(QCOM) || defined(QCOM2) + const cl_context_properties props[] = {CL_CONTEXT_PRIORITY_HINT_QCOM, CL_PRIORITY_HINT_HIGH_QCOM, 0}; + cl_context context = CL_CHECK_ERR(clCreateContext(props, 1, &device_id, NULL, NULL, &err)); +#else cl_context context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err)); +#endif party(device_id, context);