-
Notifications
You must be signed in to change notification settings - Fork 30
Enabling Y12I mode for IR calibration stream #313
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 4 commits
3923172
3b4898e
dcaef93
7846575
daf6ddf
f4ee05b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1014,6 +1014,15 @@ static const struct ds5_resolution d46x_calibration_sizes[] = { | |
| }, | ||
| }; | ||
|
|
||
| static const struct ds5_resolution ds5_calibration_sizes[] = { | ||
| { | ||
| .width = 1280, | ||
| .height = 800, | ||
| .framerates = ds5_framerate_15_25, | ||
| .n_framerates = ARRAY_SIZE(ds5_framerate_15_25), | ||
| }, | ||
| }; | ||
|
|
||
| static const struct ds5_resolution ds5_size_imu[] = { | ||
| { | ||
| .width = 32, | ||
|
|
@@ -1136,6 +1145,26 @@ static const struct ds5_format ds5_y_formats_41x[] = { | |
| }, | ||
| }; | ||
|
|
||
| static const struct ds5_format ds5_y_formats_45x[] = { | ||
| { | ||
| /* First format: default */ | ||
| .data_type = GMSL_CSI_DT_RAW_8, /* Y8 */ | ||
| .mbus_code = MEDIA_BUS_FMT_Y8_1X8, | ||
| .n_resolutions = ARRAY_SIZE(y8_sizes), | ||
| .resolutions = y8_sizes, | ||
| }, { | ||
| .data_type = GMSL_CSI_DT_YUV422_8, /* Y8I */ | ||
| .mbus_code = MEDIA_BUS_FMT_VYUY8_1X16, | ||
| .n_resolutions = ARRAY_SIZE(y8_sizes), | ||
| .resolutions = y8_sizes, | ||
| }, { | ||
| .data_type = GMSL_CSI_DT_RGB_888, /* 24-bit Calibration */ | ||
| .mbus_code = MEDIA_BUS_FMT_RGB888_1X24, /* FIXME */ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Remove the comment FIXME
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shall I change the previous line comment to Y12I as well? |
||
| .n_resolutions = ARRAY_SIZE(ds5_calibration_sizes), | ||
| .resolutions = ds5_calibration_sizes, | ||
| }, | ||
| }; | ||
|
|
||
| static const struct ds5_format ds5_41x_rgb_format = { | ||
| .data_type = GMSL_CSI_DT_YUV422_8, /* UYVY */ | ||
| .mbus_code = MEDIA_BUS_FMT_YUYV8_1X16, | ||
|
|
@@ -1713,9 +1742,7 @@ static int ds5_configure(struct ds5 *state) | |
| #ifdef CONFIG_VIDEO_D4XX_SERDES | ||
| data_type1 = sensor->config.format->data_type; | ||
| data_type2 = state->is_imu ? 0x00 : md_fmt; | ||
| /* do not have metadata for y12i */ | ||
| if (state->is_y8 && data_type1 == GMSL_CSI_DT_RGB_888) | ||
| data_type2 = 0; | ||
|
|
||
| vc_id = state->g_ctx.dst_vc; | ||
|
|
||
| ret = ds5_setup_pipeline(state, data_type1, data_type2, sensor->pipe_id, | ||
|
|
@@ -4817,6 +4844,10 @@ static int ds5_fixed_configuration(struct i2c_client *client, struct ds5 *state) | |
| sensor->formats = ds5_y_formats_41x; | ||
| sensor->n_formats = ARRAY_SIZE(ds5_y_formats_41x); | ||
| break; | ||
| case DS5_DEVICE_TYPE_D45X: | ||
| sensor->formats = ds5_y_formats_45x; | ||
| sensor->n_formats = ARRAY_SIZE(ds5_y_formats_45x); | ||
| break; | ||
| default: | ||
| sensor->formats = state->variant->formats; | ||
| sensor->n_formats = state->variant->n_formats; | ||
|
|
@@ -5897,4 +5928,4 @@ MODULE_AUTHOR("Guennadi Liakhovetski <guennadi.liakhovetski@intel.com>,\n\ | |
| Shikun Ding <shikun.ding@intel.com>,\n\ | ||
| Dmitry Perchanov <dmitry.perchanov@intel.com>"); | ||
| MODULE_LICENSE("GPL v2"); | ||
| MODULE_VERSION("1.0.1.31"); | ||
| MODULE_VERSION("1.0.1.32"); | ||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,14 @@ | ||||||||||||||||||
| diff --git a/drivers/media/platform/tegra/camera/vi/vi5_fops.c b/drivers/media/platform/tegra/camera/vi/vi5_fops.c | ||||||||||||||||||
| index 7d07ccd7..c64dcc38 100644 | ||||||||||||||||||
| --- a/drivers/media/platform/tegra/camera/vi/vi5_fops.c | ||||||||||||||||||
| +++ b/drivers/media/platform/tegra/camera/vi/vi5_fops.c | ||||||||||||||||||
| @@ -612,7 +612,7 @@ static void vi5_capture_dequeue(struct tegra_channel *chan, | ||||||||||||||||||
| trace_tegra_channel_capture_frame("sof", &ts); | ||||||||||||||||||
| vb->vb2_buf.timestamp = descr->status.sof_timestamp; | ||||||||||||||||||
|
|
||||||||||||||||||
| - if (frame_err) | ||||||||||||||||||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add here a TODO comment for the future to remove this "false" |
||||||||||||||||||
| + if (false && frame_err) | ||||||||||||||||||
|
Comment on lines
+10
to
+11
|
||||||||||||||||||
| + /* TODO: Remove the branch or process the error for Y12I only */ | |
| + if (false && frame_err) | |
| + /* | |
| + * Error checking is disabled for Y12I format due to known issues with | |
| + * error reporting for this format. For other formats, process errors normally. | |
| + * See issue tracker #<insert-issue-number-if-any> for details. | |
| + */ | |
| + if (frame_err && chan->fmtinfo->fourcc != V4L2_PIX_FMT_Y12I) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../6.0/0003-Fix-y12i-calibration-stream.patch |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| ../6.0/0003-Fix-y12i-calibration-stream.patch |
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -218,7 +218,7 @@ void requestBuffers(int fd, uint32_t type, uint32_t memory, uint32_t count) | |||||||||
| } | ||||||||||
| } | ||||||||||
|
|
||||||||||
| void* queryMapQueueBuf(int fd, uint32_t type, uint32_t memory, uint8_t index, uint32_t size) | ||||||||||
| void* queryMapQueueBuf(int fd, uint32_t type, uint32_t memory, uint8_t index) | ||||||||||
| { | ||||||||||
| struct v4l2_buffer v4l2Buffer; | ||||||||||
| memset(&v4l2Buffer, 0, sizeof(v4l2Buffer)); | ||||||||||
|
|
@@ -229,7 +229,7 @@ void* queryMapQueueBuf(int fd, uint32_t type, uint32_t memory, uint8_t index, ui | |||||||||
| if (ret) | ||||||||||
| return NULL; | ||||||||||
| void* buffer = mmap(NULL, | ||||||||||
| size, | ||||||||||
| v4l2Buffer.length, | ||||||||||
| PROT_READ | PROT_WRITE, | ||||||||||
| MAP_SHARED, | ||||||||||
| fd, | ||||||||||
|
|
@@ -295,13 +295,11 @@ int main(int argc, char** argv) { | |||||||||
| depthBuffers[i] = queryMapQueueBuf(video_fd, | ||||||||||
| V4L2_BUF_TYPE_VIDEO_CAPTURE, | ||||||||||
| V4L2_MEMORY_MMAP, | ||||||||||
| i, | ||||||||||
| 2 * width * height); | ||||||||||
| i); | ||||||||||
| metaDataBuffers[i] = queryMapQueueBuf(md_fd, | ||||||||||
| V4L2_BUF_TYPE_META_CAPTURE, | ||||||||||
| V4L2_MEMORY_MMAP, | ||||||||||
| i, | ||||||||||
| 4096); | ||||||||||
| i); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| int ret = ioctl(md_fd, VIDIOC_STREAMON, &mdType); | ||||||||||
|
|
@@ -356,13 +354,11 @@ int main(int argc, char** argv) { | |||||||||
| depthBuffers[i] = queryMapQueueBuf(video_fd, | ||||||||||
| V4L2_BUF_TYPE_VIDEO_CAPTURE, | ||||||||||
| V4L2_MEMORY_MMAP, | ||||||||||
| i, | ||||||||||
| 2 * width * height); | ||||||||||
| i); | ||||||||||
| metaDataBuffers[i] = queryMapQueueBuf(md_fd, | ||||||||||
| V4L2_BUF_TYPE_META_CAPTURE, | ||||||||||
| V4L2_MEMORY_MMAP, | ||||||||||
| i, | ||||||||||
| 4096); | ||||||||||
| i); | ||||||||||
| } | ||||||||||
|
|
||||||||||
| int ret = ioctl(md_fd, VIDIOC_STREAMON, &mdType); | ||||||||||
|
|
@@ -406,7 +402,9 @@ int main(int argc, char** argv) { | |||||||||
| fprintf(stderr, "Error opening Ir video devices\n"); | ||||||||||
| return 1; | ||||||||||
| } | ||||||||||
|
||||||||||
| } | |
| } | |
| // Alternate the IR stream format with each iteration: | |
| // If stream_repeat is odd, use V4L2_PIX_FMT_Y12I; if even, use V4L2_PIX_FMT_GREY. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why ds5 and not d45x_calibration_size?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will be fixed with next commit