-
Notifications
You must be signed in to change notification settings - Fork 5.2k
add mira220 image sensor #6717
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
base: rpi-6.12.y
Are you sure you want to change the base?
add mira220 image sensor #6717
Conversation
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.
I've started to review this, but I'm noticing a lot of my comments from #6552 haven't been addressed.
If embedded data isn't required, then do not include it.
drivers/media/i2c/mira220.c
Outdated
|
||
/* Embedded metadata stream structure */ | ||
#define MIRA220_EMBEDDED_LINE_WIDTH 16384 | ||
#define MIRA220_NUM_EMBEDDED_LINES 1 |
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.
Does this sensor actually have useful embedded metadata? It's disabled in libcamera.
I'd made the same comment in #6552 (comment) that this isn't how mainline are implementing metadata, so it's simpler to not implement it in the driver if not needed.
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.
I have removed the embedded data
drivers/media/i2c/mira220.c
Outdated
|
||
// 1600_1400_30fps_12b_2lanes | ||
|
||
static const struct mira220_reg full_1600_1400_1500_12b_2lanes_reg[] = { |
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.
You have about 18 registers that differ between these 3 huge tables. Break out all the common stuff into a common table, and only send the bits that change per mode
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.
thanks, will do.
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.
simplified, reduced driver to 1 mode only.
I'll warn you now that, once the content of these commits has been approved, the end result should ideally be 3 commits - driver changes, config changes, and overlay/README changes. |
@@ -58,28 +58,6 @@ | |||
}; | |||
}; | |||
|
|||
fragment@102 { |
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.
Did you delete this fragment by mistake? The media-controller
parameter refers to it.
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.
Yes that is a mistake.
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.
I put it back. thanks for finding out.
I will keep it in mind. Once all is approved by you I will refactor it to 3 commits. |
I cleaned up the driver a bit, implemented the new CCI_REG style writes, and took care of 6by9's comments. |
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.
Apart from the extra blank lines in the README, the overlay looks good.
Checkpatch has lots of complaints about the driver which you should really fix. Nobody using printk
directly anymore, for example.
The only additional change I would like (apart from refactoring down to 3 commits as discussed) is the addition of CONFIG_VIDEO_MIRA220 to the new PREEMPT_RT config file arm64/bcm2711_rt_defconfig.
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.
Still a number of my previous review comments haven't been addressed.
- Please remove the references to the embedded data pad.
- Please remove all commented out code.
- Please remove all redundant comments.
- Please rationalise the logging messages. Very few should be needed at all.
- Regulator names should be consistently in lower case.
FYI the build checks explicitly set CONFIG_WERROR=y, overriding the defconfigs:
|
6c62034
to
a0c3d9c
Compare
@pelwell could you run your checks again? I split my changes into 3 commits as requested. |
It looks like somebody has started them. Please mark the PR as "Ready for review" when you think it is. However, there is no excuse for some of these (https://github.com/raspberrypi/linux/actions/runs/14470568709/job/40583365956?pr=6717#step:6:80) checkpatch errors such as trailing whitespace. |
I still get this error in checkpatch, what does it mean?
|
Is it possibly just that your name appears with and without uppercase letters? I'm not bothered about that, but it makes sense to fix it to avoid such errors in the future. |
that seems to be the case indeed. i modified the commit signoff message + some of the checkpatch remarks. Hope it is ok now. |
That's fixed it. I'll give these builds time to complete, in which time 6by9 may want to chip in, but I've been taking his silence for consent. |
No, just hadn't had a chance to look through. |
So - what are the next steps to get this driver into the raspberry linux kernel? thanks. |
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.
In reading through to see if my previous comments had been addressed, add a number more.
There are a fair number of commented out blocks of code. They should be reviewed and removed where redundant.
Older kernels won't get updated. Later kernels will get a forward port, as long as there aren't any significant build changes required by the every-changing kernel APIs. Simple changes are likely to get fixed up. Significant changes without obvious fixups will be reported back to you to fix - we don't undertake the full support burden of 3rd party drivers, and they may get dropped from the defconfigs if not fixed and/or get the rpi-update gets kernel updates normally several time a week. |
Adds defconfig for the Mira220 1600x1400 global shutter image sensor Signed-off-by: philippe baetens <[email protected]>
Adds an overlay for the Mira220 1600x1400 global shutter image sensor Signed-off-by: philippe baetens <[email protected]>
Adds a driver for the NIR-enhanced Mira220 1600x1400 global shutter image sensor. Signed-off-by: philippe baetens <[email protected]>
Some of @6by9's comments have yet to be addressed, but the overlay and general structure look okay to me. |
Thanks for reviewing. I believe I addressed all of @6by9's comments, but I might have missed something.. Can you be a bit more specific? thanks! Also: each time I just 'force push' 3 new commits (overlay, conf, i2c driver) - not sure if this is your preferred way, or if you like to see my full commit history? |
On this page (https://github.com/raspberrypi/linux/pull/6717/files), scroll down and expand mira.c, then look at the comments that remain, e.g.: https://github.com/raspberrypi/linux/pull/6717/files#r2027459784 and https://github.com/raspberrypi/linux/pull/6717/files#r2027467385 |
Small fixes, mostly cosmetic. Removed unneeded code. Differentiate between physical array and active array. Signed-off-by: philippe baetens <[email protected]>
Remove commented out code. Signed-off-by: philippe baetens <[email protected]>
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.
There are still a number of remnants from the metadata pad kicking around. The things I've listed below would be nice to be cleaned up, but seeing as you'll be retaining responsibility for maintaining it, I'm not going to fuss. None of them should break the system.
You would be picked up on all these things if you try upstreaming the driver.
Fix vflip hflip. Still need to implement correct bayer pattern. Small fixes, mostly cosmetic. Removed unneeded code. Signed-off-by: philippe baetens <[email protected]>
vflip and hflip work now with correct bayer format.
i think the driver is now in good shape. requesting another review please.. |
This still applies (both aspects):
|
okay, if all is good - I'll start refactoring down to 3 commits. I've added the rt_defconfig too. |
add driver / device tree support for ams mira220
needed changes also done for libcamera.