diff --git a/system/camerad/cameras/camera_common.cc b/system/camerad/cameras/camera_common.cc index cf398a3a2c..3310822bed 100644 --- a/system/camerad/cameras/camera_common.cc +++ b/system/camerad/cameras/camera_common.cc @@ -30,7 +30,7 @@ public: "-DFRAME_WIDTH=%d -DFRAME_HEIGHT=%d -DFRAME_STRIDE=%d -DFRAME_OFFSET=%d " "-DRGB_WIDTH=%d -DRGB_HEIGHT=%d -DYUV_STRIDE=%d -DUV_OFFSET=%d " "-DIS_OX=%d -DCAM_NUM=%d%s", - ci->frame_width, ci->frame_height, compat ? 2880 : ci->frame_stride, ci->frame_offset, + ci->frame_width, ci->frame_height, compat ? ci->frame_width*12/8 : ci->frame_stride, ci->frame_offset, b->rgb_width, b->rgb_height, buf_width, uv_offset, ci->image_sensor == cereal::FrameData::ImageSensor::OX03C10, s->camera_num, s->camera_num==1 ? " -DVIGNETTING" : ""); const char *cl_file = "cameras/real_debayer.cl"; @@ -38,7 +38,7 @@ public: krnl_ = CL_CHECK_ERR(clCreateKernel(prg_debayer, "debayer10", &err)); CL_CHECK(clReleaseProgram(prg_debayer)); - twelve.allocate(2880 * 1080); + twelve.allocate(ci->frame_width*12/8 * ci->frame_height); twelve.init_cl(device_id, context); } diff --git a/system/camerad/sensors/os04c10.cc b/system/camerad/sensors/os04c10.cc index 3fa4728074..b7bcbbb9e7 100644 --- a/system/camerad/sensors/os04c10.cc +++ b/system/camerad/sensors/os04c10.cc @@ -25,9 +25,9 @@ OS04C10::OS04C10() { image_sensor = cereal::FrameData::ImageSensor::OS04C10; data_word = false; - frame_width = 1920; - frame_height = 1080; - frame_stride = (1920*10/8); + frame_width = 2688; + frame_height = 1520; + frame_stride = (frame_width*10/8); /* frame_width = 0xa80; diff --git a/system/camerad/sensors/os04c10_registers.h b/system/camerad/sensors/os04c10_registers.h index 04946570c3..a165fde59e 100644 --- a/system/camerad/sensors/os04c10_registers.h +++ b/system/camerad/sensors/os04c10_registers.h @@ -152,7 +152,7 @@ const struct i2c_random_wr_payload init_array_os04c10[] = { // ISP {0x5001, 0x09}, {0x5004, 0x00}, - //{0x5080, 0x00 | (0b1 << 7)}, // test mode + // {0x5080, 0x00 | (0b1 << 7)}, // test mode {0x5036, 0x00}, {0x5180, 0x70}, {0x5181, 0x10}, @@ -248,27 +248,31 @@ const struct i2c_random_wr_payload init_array_os04c10[] = { {0x4008, 0x02}, {0x4009, 0x0d}, - // crop mode 1928x1208 - {0x3800, 0x01}, {0x3801, 0x7c}, // x addr start = 364 + 16 - {0x3802, 0x00}, {0x3803, 0x9c}, // y addr start = 140 + 16 - {0x3804, 0x09}, {0x3805, 0x13}, // x addr end = 2324 - 1 - {0x3806, 0x05}, {0x3807, 0x63}, // y addr end = 1380 - 1 + // full frame mode 2688x1520 + {0x3800, 0x00}, {0x3801, 0x00}, // x addr start + {0x3802, 0x00}, {0x3803, 0x00}, // y addr start + {0x3804, 0x0a}, {0x3805, 0x8f}, // x addr end = 2704 - 1 + {0x3806, 0x05}, {0x3807, 0xff}, // y addr end = 1536 - 1 {0x3810, 0x00}, {0x3811, 0x08}, // isp x = 8 {0x3812, 0x00}, {0x3813, 0x08}, // isp y = 8 - {0x3808, 0x07}, {0x3809, 0x88}, // x out size = 1928 - {0x380a, 0x04}, {0x380b, 0xb8}, // y out size = 1208 + {0x3808, 0x0a}, {0x3809, 0x80}, // x out size + {0x380a, 0x05}, {0x380b, 0xf0}, // y out size + /* + {0x3800, 0x01}, {0x3801, 0x80}, // x addr start = 384 + {0x3802, 0x00}, {0x3803, 0xdc}, // y addr start = 220 + {0x3804, 0x09}, {0x3805, 0x0f}, // x addr end = 2320 - 1 + {0x3806, 0x05}, {0x3807, 0x23}, // y addr end = 1316 - 1 + {0x3810, 0x00}, {0x3811, 0x08}, // isp x = 8 + {0x3812, 0x00}, {0x3813, 0x08}, // isp y = 8 + {0x3808, 0x07}, {0x3809, 0x80}, // x out size = 1920 + {0x380a, 0x04}, {0x380b, 0x38}, // y out size = 1080 + */ // HTS - {0x380c, 0x04}, {0x380d, 0x2e}, + {0x380c, 0x04}, {0x380d, 0x4c}, // VTS - {0x380e, 0x12}, {0x380f, 0x70}, + {0x380e, 0x12}, {0x380f, 0x30}, - {0x3811, 0x08}, - {0x3813, 0x08}, - {0x3814, 0x01}, - {0x3815, 0x01}, - {0x3816, 0x01}, - {0x3817, 0x01}, {0x3820, 0xB0}, {0x3821, 0x00}, {0x3880, 0x25}, @@ -294,34 +298,23 @@ const struct i2c_random_wr_payload init_array_os04c10[] = { {0x5000, 0xf9}, {0x3c8c, 0x10}, - // exposure - {0x3501, 0x00}, + {0x3500, 0x00}, + {0x3501, 0x01}, {0x3502, 0xff}, // AEC manual {0x3503, 0x88}, // gain - {0x3508, 0x02}, {0x3509, 0x00}, // LONG_GAIN - {0x350a, 0x04}, {0x350b, 0x00}, // LONG digital gain. leave as default? - {0x350c, 0x00}, - {0x350d, 0x80}, // don't mess - wx - {0x350e, 0x04}, - {0x350f, 0x00}, - {0x3510, 0x00}, - {0x3511, 0x00}, - {0x3512, 0x20}, + {0x3508, 0x02}, {0x3509, 0x00}, // LONG real gain + {0x350a, 0x04}, {0x350b, 0x00}, // LONG digi gain // WB gain {0x5100, 0x04}, {0x5101, 0x00}, {0x5102, 0x04}, {0x5103, 0x00}, {0x5104, 0x04}, {0x5105, 0x00}, - {0x5140, 0x04}, {0x5141, 0x00}, - {0x5142, 0x04}, {0x5143, 0x00}, - {0x5144, 0x04}, {0x5145, 0x00}, // AWB digigain {0x5106, 0x02}, {0x5107, 0x00}, - {0x5146, 0x02}, {0x5147, 0x00}, };