diff mbox series

[v3,01/10] media: staging: rkisp1: cap: change RGB24 format to XBGR32

Message ID 20200723132014.4597-2-dafna.hirschfeld@collabora.com (mailing list archive)
State New, archived
Headers show
Series media: staging: rkisp1: add support to V4L2_CAP_IO_MC | expand

Commit Message

Dafna Hirschfeld July 23, 2020, 1:20 p.m. UTC
According to the TRM [1], the YUV->RGB conversion outputs
RGB 888 format with 4 bytes, where the last byte is ignored,
using big endian representation:

Comments

Helen Mae Koike Fornazier Aug. 3, 2020, 11:49 p.m. UTC | #1
On 7/23/20 10:20 AM, Dafna Hirschfeld wrote:
> According to the TRM [1], the YUV->RGB conversion outputs
> RGB 888 format with 4 bytes, where the last byte is ignored,
> using big endian representation:
> 
> ________________________________

For some reason, it seems that patchwork ignored the rest of the message from this line

https://patchwork.linuxtv.org/project/linux-media/patch/20200723132014.4597-2-dafna.hirschfeld@collabora.com/

This is just a thing to be careful when picking from patchwork.

Regards,
Helen


> |___X___|___R___|___G___|___B___|
> 31      24      16      8       0
> 
> Which matches format V4L2_PIX_FMT_XBGR32 in little endian
> representation, so replace it accordingly.
> 
> "24 bit word". What it means is that 4 bytes are used with
> 24bit for the RGB and the last byte is ignored.
> This matches format V4L2_PIX_FMT_XBGR32.
> 
> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
> Acked-by: Helen Koike <helen.koike@collabora.com>
> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
> ---
>  drivers/staging/media/rkisp1/rkisp1-capture.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c
> index c05280950ea0..2333d2dcd2e6 100644
> --- a/drivers/staging/media/rkisp1/rkisp1-capture.c
> +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c
> @@ -276,7 +276,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,
>  	}, {
>
Dafna Hirschfeld Aug. 31, 2020, 4:33 p.m. UTC | #2
Am 04.08.20 um 01:49 schrieb Helen Koike:
> 
> 
> On 7/23/20 10:20 AM, Dafna Hirschfeld wrote:
>> According to the TRM [1], the YUV->RGB conversion outputs
>> RGB 888 format with 4 bytes, where the last byte is ignored,
>> using big endian representation:
>>
>> ________________________________
> 
> For some reason, it seems that patchwork ignored the rest of the message from this line
> 
> https://patchwork.linuxtv.org/project/linux-media/patch/20200723132014.4597-2-dafna.hirschfeld@collabora.com/
> 
> This is just a thing to be careful when picking from patchwork.

I think this line signifies that what under it is a comment.
I'll remove it

Thanks,
Dafna


> 
> Regards,
> Helen
> 
> 
>> |___X___|___R___|___G___|___B___|
>> 31      24      16      8       0
>>
>> Which matches format V4L2_PIX_FMT_XBGR32 in little endian
>> representation, so replace it accordingly.
>>
>> "24 bit word". What it means is that 4 bytes are used with
>> 24bit for the RGB and the last byte is ignored.
>> This matches format V4L2_PIX_FMT_XBGR32.
>>
>> Signed-off-by: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>
>> Acked-by: Helen Koike <helen.koike@collabora.com>
>> Reviewed-by: Tomasz Figa <tfiga@chromium.org>
>> ---
>>   drivers/staging/media/rkisp1/rkisp1-capture.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c
>> index c05280950ea0..2333d2dcd2e6 100644
>> --- a/drivers/staging/media/rkisp1/rkisp1-capture.c
>> +++ b/drivers/staging/media/rkisp1/rkisp1-capture.c
>> @@ -276,7 +276,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,
>>   	}, {
>>
diff mbox series

Patch

diff --git a/drivers/staging/media/rkisp1/rkisp1-capture.c b/drivers/staging/media/rkisp1/rkisp1-capture.c
index c05280950ea0..2333d2dcd2e6 100644
--- a/drivers/staging/media/rkisp1/rkisp1-capture.c
+++ b/drivers/staging/media/rkisp1/rkisp1-capture.c
@@ -276,7 +276,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,
 	}, {