-
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 5 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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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.
[nitpick] The comment now clarifies this is 'Y12I, 24-bit Calibration' which is an improvement. However, consider adding a brief explanation of why Y12I uses RGB_888 data type and RGB888 media bus format, as this mapping may not be immediately obvious.