diff --git a/selfdrive/camerad/cameras/camera_common.cc b/selfdrive/camerad/cameras/camera_common.cc index 4db6eaa12..b901dc39d 100644 --- a/selfdrive/camerad/cameras/camera_common.cc +++ b/selfdrive/camerad/cameras/camera_common.cc @@ -28,8 +28,6 @@ #include "selfdrive/camerad/cameras/camera_replay.h" #endif -const int YUV_COUNT = 100; - class Debayer { public: Debayer(cl_device_id device_id, cl_context context, const CameraBuf *b, const CameraState *s) { @@ -109,7 +107,7 @@ void CameraBuf::init(cl_device_id device_id, cl_context context, CameraState *s, vipc_server->create_buffers(rgb_type, UI_BUF_COUNT, true, rgb_width, rgb_height); rgb_stride = vipc_server->get_buffer(rgb_type)->stride; - vipc_server->create_buffers(yuv_type, YUV_COUNT, false, rgb_width, rgb_height); + vipc_server->create_buffers(yuv_type, YUV_BUFFER_COUNT, false, rgb_width, rgb_height); if (ci->bayer) { debayer = new Debayer(device_id, context, this, s); diff --git a/selfdrive/camerad/cameras/camera_common.h b/selfdrive/camerad/cameras/camera_common.h index e994fc220..f55bbd840 100644 --- a/selfdrive/camerad/cameras/camera_common.h +++ b/selfdrive/camerad/cameras/camera_common.h @@ -14,6 +14,7 @@ #include "selfdrive/common/queue.h" #include "selfdrive/common/swaglog.h" #include "selfdrive/common/visionimg.h" +#include "selfdrive/hardware/hw.h" #define CAMERA_ID_IMX298 0 #define CAMERA_ID_IMX179 1 @@ -26,7 +27,9 @@ #define CAMERA_ID_AR0231 8 #define CAMERA_ID_MAX 9 -#define UI_BUF_COUNT 4 +const int UI_BUF_COUNT = 4; +const int YUV_BUFFER_COUNT = Hardware::EON() ? 100 : 40; + enum CameraType { RoadCam = 0,