Skip to contentSkip to conversation

staging: media: ipu3: Fix AWB x_start position when rightmost stripe is used

PATCH Superseded Kate Hsuan 2 participants 5 messages Apr 7, 2022 – Apr 8, 2022

Subsystems (3)

v2 of 3 Superseded Latest is v3 →

lore
Share & tools
lore

Kate Hsuan

author
#0 lore raw

PATCH v2 1/1 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.

---
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(+)
drivers/staging/media/ipu3/ipu3-css-params.c +11 -0
index f84cf11358a8..76ad802d694e 100644
@@ -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 */
Signature · 1 line
2.35.1
#1 lore raw
Quoted 5 lines · Kate Hsuan

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?

Quoted 3 lines

---
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

author
#2 lore raw

Hi Dan,

Quoted 9 lines · Dan Carpenter
Quoted 5 lines · Kate Hsuan

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.

Quoted 3 lines

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.

Quoted 10 lines
Quoted 4 lines

---
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.

Quoted 4 lines

regards,
dan carpenter

Signature · 2 lines
BR,
Kate
#3 lore raw
Quoted 12 lines · Kate Hsuan

Hi Dan,

Quoted 9 lines · Dan Carpenter
Quoted 5 lines · Kate Hsuan

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.

Quoted 7 lines
Quoted 3 lines

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

author
#4 lore raw

Hi Dan,

Quoted 18 lines · Dan Carpenter
Quoted 16 lines · Kate Hsuan

Hi Dan,

Quoted 12 lines · Dan Carpenter
Quoted 5 lines · Kate Hsuan

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?

Quoted 7 lines
Quoted 3 lines

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.

Quoted 3 lines

regards,
dan carpenter

Signature · 2 lines
BR,
Kate