Skip to content
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

Fixes for the ov8865 driver #113

Merged
merged 2 commits into from
Nov 4, 2021

Conversation

djrscally
Copy link
Collaborator

Thanks to @jhautbois for spotting these.

The black image problem people are having comes when the exposure set goes too close to the VTS. Most sensor drivers have some margin built in to prevent that, but I forgot to include that in the changes to the exposure control in ov8865. Add one in to avoid the black screen issue.

Opportunistically fix the max analogue gain. The field is 12 bits wide which is where the 8191 figure came from, but the driver specifies it as having a max of 16x gain

Without this integration margin to reduce the max exposure, it seems
that we trip over a limit that results in the image being entirely
black when max exposure is set. Add the margin to prevent this issue.

With thanks to jhautbois for spotting and reporting.

Signed-off-by: Daniel Scally <djrscally@gmail.com>
The maximum gain figure in the v4l2 ctrl is wrong. The field is 12 bits
wide, which is where the 8191 figure comes from, but the datasheet is
specific that maximum gain is 16x (the low seven bits are fractional, so
16x gain is 2048)

Signed-off-by: Daniel Scally <djrscally@gmail.com>
Copy link
Member

@qzed qzed left a comment

Choose a reason for hiding this comment

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

Thanks!

@qzed qzed merged commit a99c1b9 into linux-surface:v5.14-surface-devel Nov 4, 2021
@qzed
Copy link
Member

qzed commented Nov 5, 2021

I can confirm that the "black image problem" is fixed by this on my SB2.

qzed added a commit to linux-surface/linux-surface that referenced this pull request Nov 5, 2021
Changes:
 - Fixes for the OV8865 camera sensor gain and exposure. See
   linux-surface/kernel#113 for details.

Links:
 - kernel: linux-surface/kernel@a99c1b9
qzed pushed a commit that referenced this pull request Jan 30, 2023
Privately, Heinz Mauelshagen showed that the embedded filename test is not
specific enough.

> WARNING: It's generally not useful to have the filename in the file
> #113: FILE: errors.c:113:
> +            block < registered_errors.blocks + registered_errors.count;

Extend the test to use the appropriate word boundary tests.

Link: https://lkml.kernel.org/r/36069dac5d07509dab1c7f1238f8cbb08db80ac6.camel@perches.com
Signed-off-by: Joe Perches <joe@perches.com>
Reported-by: Heinz Mauelshagen <heinzm@redhat.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
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.

None yet

2 participants