Skip to content

Conversation

@ngphibang
Copy link
Contributor

@ngphibang ngphibang commented Jul 21, 2024

This PR adds to the ov5640 camera driver

Copy link
Member

Choose a reason for hiding this comment

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

maybe these features should be optional? maybe not every platform can afford to link in math?

Copy link
Contributor

Choose a reason for hiding this comment

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

I saw many drivers including math.h without constraints, can you please explain why it might be necessary?

@dleach02
Copy link
Member

@ngphibang can you resolve the CI errors?

@dleach02
Copy link
Member

@ngphibang can you address the CI failures

@ngphibang
Copy link
Contributor Author

@dleach02 CI failures are due to the dependency on this PR which is not merged yet

@dleach02
Copy link
Member

@dleach02 CI failures are due to the dependency on this PR which is not merged yet

Okay, looks like you have a comment 10 hrs ago then in the other PR from the assignee. Please work with the assignee to get their approval.

@trunghieulenxp
Copy link
Contributor

Rebase because the PR #76393 is merged

Copy link
Contributor

@josuah josuah left a comment

Choose a reason for hiding this comment

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

Grateful for this addition! OV5640 is a complex sensor with a lot of features.

Just waiting the dependency PR to get validated before it: the comments below are informational.

@josuah josuah added the DNM This PR should not be merged (Do Not Merge) label Sep 16, 2024
josuah
josuah previously approved these changes Sep 16, 2024
Copy link
Contributor

@josuah josuah left a comment

Choose a reason for hiding this comment

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

Adding "DNM" to allow starting the review now and remove it once dependencies are met.

@josuah josuah removed the DNM This PR should not be merged (Do Not Merge) label Sep 24, 2024
@dleach02
Copy link
Member

dleach02 commented Oct 1, 2024

@loicpoulain @josuah, Can I get your reviews on this PR so we can move it along

Copy link
Contributor

@loicpoulain loicpoulain left a comment

Choose a reason for hiding this comment

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

@ngphibang you should check out-of-bound values in set_ctrl... as nothing is preventing bad values.

josuah
josuah previously approved these changes Oct 1, 2024
Copy link
Contributor

@josuah josuah left a comment

Choose a reason for hiding this comment

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

I missed the rebase from @trunghieulenxp. Thank you for reminding us.
I also did not notice that controls could be done out of bounds.
This could be interesting to introduce in a generic way (i.e. in another PR) for all sensors, once the MIN/MAX can be communicated from the driver to the API.

@loicpoulain
Copy link
Contributor

@ngphibang
Copy link
Contributor Author

ngphibang commented Oct 1, 2024

@loicpoulain @josuah : Yes, the ctrl value should be checked. The bigger problem is all control values in the API is defined as (void *) which causes some difficulties for drivers and applications. I am working on defining control types for each CID, will try to find time to finalize and push the PR soon.

@josuah josuah self-requested a review October 1, 2024 15:05
@josuah
Copy link
Contributor

josuah commented Oct 1, 2024

@loicpoulain: you are right, I gave my +1 too early. That was counting on this modification to be made but I should be patient.

ngphibang and others added 7 commits October 2, 2024 14:47
Run clang format before making any changes.

Signed-off-by: Phi Bang Nguyen <[email protected]>
Add some control IDs:

- VIDEO_CID_CAMERA_HUE
- VIDEO_CID_POWER_LINE_FREQUENCY
- VIDEO_CID_PIXEL_RATE which is needed for changing frame rate

Signed-off-by: Phi Bang Nguyen <[email protected]>
Color bar is one type of test patterns. Rename it to
VIDEO_CID_CAMERA_TEST_PATTERN to be more generic.

Signed-off-by: Phi Bang Nguyen <[email protected]>
Add some minor fixes and optimizations:

- Fix coding style
- Rename some variables
- Use the array variable size directly instead of defining a macro

Signed-off-by: Phi Bang Nguyen <[email protected]>
Signed-off-by: Trung Hieu Le <[email protected]>
Add support for 4 test pattern modes:
- Color bar
- Color bar rolling
- Square
- Square rolling

Signed-off-by: Phi Bang Nguyen <[email protected]>
Add some controls:
- hue
- saturation
- brightness
- contrast
- gain
- hflip
- vflip
- power line frequency filter
- pixel rate (read-only) which is needed for changing frame rate

Signed-off-by: Farah Fliss <[email protected]>
Signed-off-by: Phi Bang Nguyen <[email protected]>
Add support for changing frame rate

Signed-off-by: Trung Hieu Le <[email protected]>
Signed-off-by: Phi Bang Nguyen <[email protected]>
Copy link
Contributor

@josuah josuah left a comment

Choose a reason for hiding this comment

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

I thought having the variable initialization at the top was a requirement in Linux, but I might have been mixing with KNF.

It is apparently used in the kernel too.

Very glad to learn about IN_RANGE()!

@ngphibang ngphibang requested a review from loicpoulain October 3, 2024 15:44
@ngphibang
Copy link
Contributor Author

Hi @loicpoulain , could you revisit this ?
Thanks

@carlescufi carlescufi merged commit fc90c9f into zephyrproject-rtos:main Oct 10, 2024
23 checks passed
@ngphibang ngphibang deleted the add_controls_ov5640 branch October 10, 2024 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: Video Video subsystem platform: NXP Drivers NXP Semiconductors, drivers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants