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);