Skip to contentSkip to conversation

media: staging: rkisp1: cap: change RGB24 format to XBGR32

PATCH Superseded Dafna Hirschfeld 2 participants 3 messages Mar 28, 2020 – May 15, 2020

Subsystems (3)

v1 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 media: staging: rkisp1: cap: change RGB24 format to XBGR32

According to the manual, the YUV->RGB conversion outputs "24 bit word" that means that each pixel is 4 byte but the last one should be ignored. This matches format V4L2_PIX_FMT_XBGR32.

---
The patch rebased on to of the patch
"media: staging: rkisp1: cap: remove field fmt_type from struct rkisp1_capture_fmt_cfg"

 drivers/staging/media/rkisp1/rkisp1-capture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/rkisp1/rkisp1-capture.c +1 -1
index 3abf38362f5a..5f248b68190e 100644
@@ -281,7 +281,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
 	},
 	/* rgb */
 	{
-		.fourcc = V4L2_PIX_FMT_RGB24,
+		.fourcc = V4L2_PIX_FMT_XBGR32,
 		.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
 		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB888,
 	}, {
Signature · 1 line
2.17.1
#1 lore raw
Quoted 1 line · Dafna Hirschfeld

According to the manual, the YUV->RGB conversion outputs

s/manual/datasheet

Quoted 2 lines

"24 bit word" that means that each pixel is 4 byte but the last one should be ignored. This matches format V4L2_PIX_FMT_XBGR32.

I think you can re-word this a bit, since 24bits is 3 bytes, and this doesn't mean 4 bytes are used.

I guess you meant that datasheet says 4 bytes are used, with 24bits for the RGB and the last byte is ignored.

Quoted 14 lines

---
The patch rebased on to of the patch
"media: staging: rkisp1: cap: remove field fmt_type from struct rkisp1_capture_fmt_cfg"

 drivers/staging/media/rkisp1/rkisp1-capture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/rkisp1/rkisp1-capture.c +0 -0
index 3abf38362f5a..5f248b68190e 100644

drivers/staging/media/rkisp1/rkisp1-capture.c static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { · line 284

Quoted 5 lines
drivers/staging/media/rkisp1/rkisp1-capture.c +1 -1
@@ -281,7 +281,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
 	},
 	/* rgb */
 	{
-		.fourcc = V4L2_PIX_FMT_RGB24,
+		.fourcc = V4L2_PIX_FMT_XBGR32,

Shouldn't it be V4L2_PIX_FMT_RGBX32 ?

Or the colors are inverted as well?

Regards,
Helen

Quoted 4 lines
drivers/staging/media/rkisp1/rkisp1-capture.c +0 -0
 		.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
 		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB888,
 	}, {
#2 lore raw

hi,
thanks for the review

Quoted 6 lines · Helen Koike
Quoted 1 line · Dafna Hirschfeld

According to the manual, the YUV->RGB conversion outputs

s/manual/datasheet

It is actually from the TRM

Quoted 7 lines
Quoted 3 lines

"24 bit word" that means that each pixel is 4 byte but the last one should be ignored. This matches format V4L2_PIX_FMT_XBGR32.

I think you can re-word this a bit, since 24bits is 3 bytes, and this doesn't mean 4 bytes are used.

I guess you meant that datasheet says 4 bytes are used, with 24bits for the RGB and the last byte is ignored.

indeed, i'll change that

Quoted 10 lines
Quoted 10 lines

---
The patch rebased on to of the patch
"media: staging: rkisp1: cap: remove field fmt_type from struct rkisp1_capture_fmt_cfg"

  drivers/staging/media/rkisp1/rkisp1-capture.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 12 lines

drivers/staging/media/rkisp1/rkisp1-capture.c static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = { · line 284

Quoted 10 lines
drivers/staging/media/rkisp1/rkisp1-capture.c +1 -1
index 3abf38362f5a..5f248b68190e 100644
@@ -281,7 +281,7 @@ static const struct rkisp1_capture_fmt_cfg rkisp1_sp_fmts[] = {
  	},
  	/* rgb */
  	{
-		.fourcc = V4L2_PIX_FMT_RGB24,
+		.fourcc = V4L2_PIX_FMT_XBGR32,

Shouldn't it be V4L2_PIX_FMT_RGBX32 ?> Or the colors are inverted as well?

yes, the bytes are inverted

Thanks,
Dafna

Quoted 8 lines

Regards,
Helen

Quoted 4 lines
drivers/staging/media/rkisp1/rkisp1-capture.c +0 -0
  		.write_format = RKISP1_MI_CTRL_SP_WRITE_PLA,
  		.output_format = RKISP1_MI_CTRL_SP_OUTPUT_RGB888,
  	}, {