2022-04-07 16:53:44

by Kate Hsuan

[permalink] [raw]
Subject: [PATCH v2] staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used

A not calibrated x_start setting would result in an incorrect AWB location
configuration on a sensor when only the rightmost stripe is used. x_start
should be calibrated by subtracting the stripe offset to set the coordinate
to the correct position on the second stripe.

Signed-off-by: Kate Hsuan <[email protected]>
---
Correct the patch. The correction should be awb, not awb_fr.
---
drivers/staging/media/ipu3/ipu3-css-params.c | 11 +++++++++++
1 file changed, 11 insertions(+)

diff --git a/drivers/staging/media/ipu3/ipu3-css-params.c b/drivers/staging/media/ipu3/ipu3-css-params.c
index f84cf11358a8..76ad802d694e 100644
--- a/drivers/staging/media/ipu3/ipu3-css-params.c
+++ b/drivers/staging/media/ipu3/ipu3-css-params.c
@@ -2636,6 +2636,17 @@ int imgu_css_cfg_acc(struct imgu_css *css, unsigned int pipe,
acc->stripe.down_scaled_stripes[1].offset + min_overlap) {
/* Enable only for rightmost stripe, disable left */
acc->awb.stripes[0].rgbs_thr_b &= ~IPU3_UAPI_AWB_RGBS_THR_B_EN;
+
+ acc->awb.stripes[1].grid.x_start =
+ (acc->awb.stripes[1].grid.x_start -
+ acc->stripe.down_scaled_stripes[1].offset) &
+ IPU3_UAPI_GRID_START_MASK;
+
+ b_w_log2 = acc->awb.stripes[1].grid.block_width_log2;
+ acc->awb.stripes[1].grid.x_end =
+ imgu_css_grid_end(acc->awb.stripes[1].grid.x_start,
+ acc->awb.stripes[1].grid.width,
+ b_w_log2);
} else if (acc->awb.config.grid.x_end <=
acc->stripe.bds_out_stripes[0].width - min_overlap) {
/* Enable only for leftmost stripe, disable right */
--
2.35.1


2022-04-07 17:28:55

by Kate Hsuan

[permalink] [raw]
Subject: Re: [PATCH v2] staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used

Hi Dan,

On Thu, Apr 7, 2022 at 7:52 PM Dan Carpenter <[email protected]> wrote:
>
> On Thu, Apr 07, 2022 at 06:57:24PM +0800, Kate Hsuan wrote:
> > A not calibrated x_start setting would result in an incorrect AWB location
> > configuration on a sensor when only the rightmost stripe is used. x_start
> > should be calibrated by subtracting the stripe offset to set the coordinate
> > to the correct position on the second stripe.
> >

>
> I wish the commit description said more about what the bug looks like to
> the user. This is the front facing camera, right? Is part of the video
> blank or what's the deal?

This is IPU3 image processor. I tried to fix the configuration issues
on stripe 1 coordinate settings.

>
> > Signed-off-by: Kate Hsuan <[email protected]>
> > ---
> > Correct the patch. The correction should be awb, not awb_fr.
>
> I tried to review the original patch and it was impossible. I saw
> you're from an @redhat.com email address so I decided it must be right.
>
> I kind of get that you need to be a domain expert to review these
> patches but this function is such a mess...

Sorry for the misunderstanding in my comments.
Since I made some mistakes on my v1 patch, so I had corrected this
part and quickly sent the v2 patch. You are welcome to pinpoint the
errors for my v2 patch. I could fix them.

Thank you.

>
> regards,
> dan carpenter
>


--
BR,
Kate

2022-04-07 19:36:02

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH v2] staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used

On Thu, Apr 07, 2022 at 09:17:38PM +0800, Kate Hsuan wrote:
> Hi Dan,
>
> On Thu, Apr 7, 2022 at 7:52 PM Dan Carpenter <[email protected]> wrote:
> >
> > On Thu, Apr 07, 2022 at 06:57:24PM +0800, Kate Hsuan wrote:
> > > A not calibrated x_start setting would result in an incorrect AWB location
> > > configuration on a sensor when only the rightmost stripe is used. x_start
> > > should be calibrated by subtracting the stripe offset to set the coordinate
> > > to the correct position on the second stripe.
> > >
>
> >
> > I wish the commit description said more about what the bug looks like to
> > the user. This is the front facing camera, right? Is part of the video
> > blank or what's the deal?
>
> This is IPU3 image processor. I tried to fix the configuration issues
> on stripe 1 coordinate settings.
>

So in terms of users, if you configure it in a certain way then it
crashes? What happens in terms of what the ordinary user sees?

regards,
dan carpenter

2022-04-07 19:50:15

by Dan Carpenter

[permalink] [raw]
Subject: Re: [PATCH v2] staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used

On Thu, Apr 07, 2022 at 06:57:24PM +0800, Kate Hsuan wrote:
> A not calibrated x_start setting would result in an incorrect AWB location
> configuration on a sensor when only the rightmost stripe is used. x_start
> should be calibrated by subtracting the stripe offset to set the coordinate
> to the correct position on the second stripe.
>

I wish the commit description said more about what the bug looks like to
the user. This is the front facing camera, right? Is part of the video
blank or what's the deal?

> Signed-off-by: Kate Hsuan <[email protected]>
> ---
> Correct the patch. The correction should be awb, not awb_fr.

I tried to review the original patch and it was impossible. I saw
you're from an @redhat.com email address so I decided it must be right.

I kind of get that you need to be a domain expert to review these
patches but this function is such a mess...

regards,
dan carpenter

2022-04-08 03:40:51

by Kate Hsuan

[permalink] [raw]
Subject: Re: [PATCH v2] staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used

Hi Dan,

On Thu, Apr 7, 2022 at 9:27 PM Dan Carpenter <[email protected]> wrote:
>
> On Thu, Apr 07, 2022 at 09:17:38PM +0800, Kate Hsuan wrote:
> > Hi Dan,
> >
> > On Thu, Apr 7, 2022 at 7:52 PM Dan Carpenter <[email protected]> wrote:
> > >
> > > On Thu, Apr 07, 2022 at 06:57:24PM +0800, Kate Hsuan wrote:
> > > > A not calibrated x_start setting would result in an incorrect AWB location
> > > > configuration on a sensor when only the rightmost stripe is used. x_start
> > > > should be calibrated by subtracting the stripe offset to set the coordinate
> > > > to the correct position on the second stripe.
> > > >
> >
> > >
> > > I wish the commit description said more about what the bug looks like to
> > > the user. This is the front facing camera, right? Is part of the video
> > > blank or what's the deal?
> >
> > This is IPU3 image processor. I tried to fix the configuration issues
> > on stripe 1 coordinate settings.
> >
>
> So in terms of users, if you configure it in a certain way then it
> crashes? What happens in terms of what the ordinary user sees?
>

It will not crash. Currently, application, such as libcamara only uses
stripe 0 to estimate 3A (AE AWB AF). The grid coordinate can be used
to determine the area on a sensor where we use this area to determine
the 3A status. If we start to move the grid and it crosses the stripe
1 offset. The grid will be at the rightmost edge of the sensor. The
user may only feel the location of AF, AWB, AE of the image is not the
user's expectation.

I'll update them in the v3 patch.

> regards,
> dan carpenter
>


--
BR,
Kate