Skip to content

drivers: bcm2835_unicam: Disable trigger mode operation #4834

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

Merged
merged 1 commit into from
Jan 18, 2022

Conversation

naushir
Copy link
Contributor

@naushir naushir commented Jan 18, 2022

On a Pi3 B/B+ platform the imx219 sensor frequently generates a single corrupt
frame when the sensor first starts. This can either be a missing line, or
invalid samples within the line. This only occurrs using the Unicam kernel
driver.

Disabling trigger mode elimiates this corruption. Since trigger mode is a
legacy feature copied from the firmeare driver and not expected to be needed,
remove it. Tested on the Raspberry Pi cameras and shows no ill effects.

Signed-off-by: Naushir Patuck [email protected]

@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2022

@6by9, this does seem to be a valid fix for the pink frames (fingers crossed)!

@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2022

Only question is do we disable this selectively based on a dt config? Ideally I would hope we can disable this globally.

@@ -983,11 +983,6 @@ static irqreturn_t unicam_isr(int irq, void *dev)
}
}

if (reg_read(unicam, UNICAM_ICTL) & UNICAM_FCM) {
/* Switch out of trigger mode if selected */
reg_write_field(unicam, UNICAM_ICTL, 1, UNICAM_TFC);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To someone who knows nothing about the subject matter, the 1 here is unexpected.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's hitting the trigger bit in the ICTL register. It's using UNICAM_TFC as the bitmask.

@naushir naushir marked this pull request as ready for review January 18, 2022 14:13
@6by9
Copy link
Contributor

6by9 commented Jan 18, 2022

I see little reason not to disable it globally.

Typo in commit message "firmeare", but otherwise I'm happy.

Possibly worth pinging Laurent et al about this patch as they are upstreaming Unicam.

On a Pi3 B/B+ platform the imx219 sensor frequently generates a single corrupt
frame when the sensor first starts. This can either be a missing line, or
invalid samples within the line. This only occurrs using the Unicam kernel
driver.

Disabling trigger mode elimiates this corruption. Since trigger mode is a
legacy feature copied from the firmware driver and not expected to be needed,
remove it. Tested on the Raspberry Pi cameras and shows no ill effects.

Signed-off-by: Naushir Patuck <[email protected]>
@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2022

Possibly worth pinging Laurent et al about this patch as they are upstreaming Unicam.

Yes, I will ping Laurent and co. about this commit.

@pelwell pelwell merged commit 59aeb16 into raspberrypi:rpi-5.10.y Jan 18, 2022
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jan 27, 2022
See: raspberrypi/linux#4845

kernel: drm/vc4_hdmi: Add Broadcast RGB property to allow override of RGB range
See: raspberrypi/linux#4850

kernel: Update rpi-display overlay
See: raspberrypi/linux#4841

kernel: ARM: dts: BCM2711 AON_INTR2 generates IRQ edges
See: raspberrypi/linux#4838

kernel: drivers: bcm2835_unicam: Disable trigger mode operation
See: raspberrypi/linux#4834

kernel: random: fix crash on multiple early calls to add_bootloader_randomness
See: raspberrypi/linux#4829
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Jan 27, 2022
See: raspberrypi/linux#4845

kernel: drm/vc4_hdmi: Add Broadcast RGB property to allow override of RGB range
See: raspberrypi/linux#4850

kernel: Update rpi-display overlay
See: raspberrypi/linux#4841

kernel: ARM: dts: BCM2711 AON_INTR2 generates IRQ edges
See: raspberrypi/linux#4838

kernel: drivers: bcm2835_unicam: Disable trigger mode operation
See: raspberrypi/linux#4834

kernel: random: fix crash on multiple early calls to add_bootloader_randomness
See: raspberrypi/linux#4829
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants