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

uapi: bcm2835-isp: Add colour denoise mode config #4069

Merged
merged 2 commits into from
Jan 19, 2021

Conversation

naushir
Copy link
Contributor

@naushir naushir commented Jan 12, 2021

Add a field to the bcm2835_isp_denoise config structure to control
colour denoise operating modes.

Signed-off-by: Naushir Patuck naush@raspberrypi.com

@naushir naushir marked this pull request as draft January 12, 2021 14:22
@naushir
Copy link
Contributor Author

naushir commented Jan 12, 2021

@davidplowman and @6by9

Not ready to merge just yet though.

@6by9
Copy link
Contributor

6by9 commented Jan 12, 2021

Admittedly the uapi hasn't been officially released, but adding extra fields like this does cause problems of backwards compatibility.

What's it actually controlling? This generally maps directly onto the hardware, but I don't see any differentiation of modes there.

@naushir
Copy link
Contributor Author

naushir commented Jan 12, 2021

Admittedly the uapi hasn't been officially released, but adding extra fields like this does cause problems of backwards compatibility.

Yes, this is a bit of a problem. I feel that we should be able to get away with it in this case given that we have not upstreamed yet, and libcamera is not yet had a stable release. But if you do feel that this could cause problems, we may have to do alternative things.

What's it actually controlling? This generally maps directly onto the hardware, but I don't see any differentiation of modes there.

There are accompanying firmware changes in the works that will make things clearer.

naushir added a commit to raspberrypi/libcamera that referenced this pull request Jan 14, 2021
Update the bcm2835-isp.h file with the latest version available in the
downstream Raspberryp Pi linux repo.

This change adds support for colour denoise processing, and must be
synced with the downstream kernel change:
raspberrypi/linux#4069

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
@naushir naushir marked this pull request as ready for review January 14, 2021 16:25
@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2021

@6by9 and @davidplowman, can I get a review please?

@davidplowman
Copy link
Contributor

Hi Naush, this thing is showing up with 766 files changed and 481 commits, making me a bit scared of trying to review anything. Is there a way to see just the colour denoise changes? (Surely everything else was merged ages ago??)

@6by9
Copy link
Contributor

6by9 commented Jan 18, 2021

Dom has rebased the rpi-5.10.y parent branch, so naush needs fetch and rebase.
Or just look at the last one or two commits in the history.

Add a configuration structure for colour denoise to the bcm2835_isp
driver.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2021

Dom has rebased the rpi-5.10.y parent branch, so naush needs fetch and rebase.
Or just look at the last one or two commits in the history.

Done.

@davidplowman
Copy link
Contributor

Hi Naush, I had just a couple of minor comments to consider:

  1. If I interpreted the diffs correctly, did MMAL_PARAMETER_CDN seem to come in the middle of the list of enums rather than at the end? That made me slightly nervous as someone updating their firmware would have to be sure to update their linux (I suppose they would) and recompile their application (again, I expect they would). So maybe not a big deal.
  2. I wondered ever so slightly about adding a strength parameter into the mmal_parameter_colour_denoise structure, as there is a possibility we might need it in future (we would hard-code a single value there for now). Or do you think it's better to wait and see on that? I'm not sure, perhaps we should leave it until we know.

@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2021

  1. If I interpreted the diffs correctly, did MMAL_PARAMETER_CDN seem to come in the middle of the list of enums rather than at the end? That made me slightly nervous as someone updating their firmware would have to be sure to update their linux (I suppose they would) and recompile their application (again, I expect they would). So maybe not a big deal.

Yes, this is indeed the case here. I did expect users would have to simultaneously update FW, kernel, and libcamera once this change went through. If that does seem too restrictive, I could put this at the end of the enum.

  1. I wondered ever so slightly about adding a strength parameter into the mmal_parameter_colour_denoise structure, as there is a possibility we might need it in future (we would hard-code a single value there for now). Or do you think it's better to wait and see on that? I'm not sure, perhaps we should leave it until we know.

I could put in a strength field as a placeholder, and set the value to a constant through libcamera for now.

@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2021

`

  1. I wondered ever so slightly about adding a strength parameter into the mmal_parameter_colour_denoise structure, as there is a possibility we might need it in future (we would hard-code a single value there for now). Or do you think it's better to wait and see on that? I'm not sure, perhaps we should leave it until we know.

I could put in a strength field as a placeholder, and set the value to a constant through libcamera for now.

One question on this one - should I make it a rational value like the SDN strength?

@davidplowman
Copy link
Contributor

Maybe it should just be a low/medium/strong thing? Which is probably not a bad reason for leaving it until such time as we have good reason for it...!

@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2021

Maybe it should just be a low/medium/strong thing? Which is probably not a bad reason for leaving it until such time as we have good reason for it...!

Agreed, I won't make this change.

@davidplowman
Copy link
Contributor

Have an "LGTM" from me. I'll leave to it you if you want to change the enum order, I agree that in reality it will probably matter little.

Add colour denoise control to the bcm2835 driver through a new v4l2
control: V4L2_CID_USER_BCM2835_ISP_CDN.

Add the accompanying MMAL configuration structure definitions as well.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
@naushir
Copy link
Contributor Author

naushir commented Jan 18, 2021

Latest version has the enum value at the end.

@pelwell pelwell merged commit 839c811 into raspberrypi:rpi-5.10.y Jan 19, 2021
@naushir naushir deleted the cdn branch January 20, 2021 09:37
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Jan 21, 2021
kernel: bcm2835-isp: Add colour denoise mode config
See: raspberrypi/linux#4069

kernel: configs: Enable BCM2835 thermal driver in kernel8
See: raspberrypi/linux#4077

firmware: Export bootloader config via device-tree

firmware: ISP: Colour denoise
See: raspberrypi/linux#4083
popcornmix added a commit to Hexxeh/rpi-firmware that referenced this pull request Jan 21, 2021
kernel: bcm2835-isp: Add colour denoise mode config
See: raspberrypi/linux#4069

kernel: configs: Enable BCM2835 thermal driver in kernel8
See: raspberrypi/linux#4077

firmware: Export bootloader config via device-tree

firmware: ISP: Colour denoise
See: raspberrypi/linux#4083
kbingham pushed a commit to kbingham/libcamera that referenced this pull request Feb 9, 2021
Update the bcm2835-isp.h file with the latest version available in the
downstream Raspberry Pi linux repo at commit:
68878170d8a98afd6d519a3a2c909080c19de4ce

This change adds support for colour denoise processing, and the
following downstream kernel changes must be available:
raspberrypi/linux#4069
raspberrypi/linux#4083

The Raspberry Pi image must also be running the latest firmware,
obtained by running rpi-update.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
naushir added a commit to raspberrypi/libcamera that referenced this pull request Feb 14, 2021
Update the bcm2835-isp.h file with the latest version available in the
downstream Raspberry Pi linux repo at commit:
68878170d8a98afd6d519a3a2c909080c19de4ce

This change adds support for colour denoise processing, and the
following downstream kernel changes must be available:
raspberrypi/linux#4069
raspberrypi/linux#4083

The Raspberry Pi image must also be running the latest firmware,
obtained by running rpi-update.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
Acked-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
popcornmix pushed a commit to raspberrypi/userland that referenced this pull request Sep 28, 2021
This change adds a colour denoise config structure to allow us to set the
operating mode of the software colour denoise.  This essentially chooses
between the video and stills colour denoise variants.

The related kernel change is at:
raspberrypi/linux#4069
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

4 participants