Re: [PATCH v2 2/3] media: vimc: Add missing {RGB,BGR,GBR}888 media bus codes
From: Helen Koike
Date: Mon Mar 30 2020 - 15:38:00 EST
On 3/26/20 6:56 PM, Shuah Khan wrote:
> On 3/26/20 3:47 PM, NÃcolas F. R. A. Prado wrote:
>> Add missing RGB888_*, BGR888_* and GBR888_* media bus codes in the
>> vimc_pix_map_list. Since there is no GBR24 pixelformat, use the RGB24
>> pixelformat for MEDIA_BUS_FMT_GBR888_1X24.
>>
>> Co-developed-by: Vitor Massaru Iha <vitor@xxxxxxxxxxx>
>> Signed-off-by: Vitor Massaru Iha <vitor@xxxxxxxxxxx>
>> Signed-off-by: NÃcolas F. R. A. Prado <nfraprado@xxxxxxxxxxxxxx>
>> ---
>>
>> Changes in v2:
>> - Fix array formatting
>> - Change commit message to reflect v2 changes
>> - Change code array size
>> - Add other BGR888 and RGB888 formats to BGR24 and RGB24 pixelformats
>>
>> Â drivers/media/platform/vimc/vimc-common.c | 16 ++++++++++++++--
>> Â drivers/media/platform/vimc/vimc-common.h |Â 2 +-
>> Â 2 files changed, 15 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/media/platform/vimc/vimc-common.c b/drivers/media/platform/vimc/vimc-common.c
>> index 119846f3eaa5..11489334cff7 100644
>> --- a/drivers/media/platform/vimc/vimc-common.c
>> +++ b/drivers/media/platform/vimc/vimc-common.c
>> @@ -19,13 +19,25 @@ static const struct vimc_pix_map vimc_pix_map_list[] = {
>> Â ÂÂÂÂÂ /* RGB formats */
>> ÂÂÂÂÂ {
>> -ÂÂÂÂÂÂÂ .code = { MEDIA_BUS_FMT_BGR888_1X24 },
>> +ÂÂÂÂÂÂÂ .code = {
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_BGR888_1X24,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_BGR888_3X8
>> +ÂÂÂÂÂÂÂ },
>> ÂÂÂÂÂÂÂÂÂ .pixelformat = V4L2_PIX_FMT_BGR24,
>> ÂÂÂÂÂÂÂÂÂ .bpp = 3,
>> ÂÂÂÂÂÂÂÂÂ .bayer = false,
>> ÂÂÂÂÂ },
>> ÂÂÂÂÂ {
>> -ÂÂÂÂÂÂÂ .code = { MEDIA_BUS_FMT_RGB888_1X24 },
>> +ÂÂÂÂÂÂÂ .code = {
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_RGB888_1X24,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_RGB888_2X12_BE,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_RGB888_2X12_LE,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_RGB888_3X8,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_RGB888_1X32_PADHI,
>> +ÂÂÂÂÂÂÂÂÂÂÂ MEDIA_BUS_FMT_GBR888_1X24
>> +ÂÂÂÂÂÂÂ },
>> ÂÂÂÂÂÂÂÂÂ .pixelformat = V4L2_PIX_FMT_RGB24,
>> ÂÂÂÂÂÂÂÂÂ .bpp = 3,
>> ÂÂÂÂÂÂÂÂÂ .bayer = false,
>> diff --git a/drivers/media/platform/vimc/vimc-common.h b/drivers/media/platform/vimc/vimc-common.h
>> index 585441694c86..d5e0e8d32542 100644
>> --- a/drivers/media/platform/vimc/vimc-common.h
>> +++ b/drivers/media/platform/vimc/vimc-common.h
>> @@ -69,7 +69,7 @@ do {ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ \
>> ÂÂ * V4L2_PIX_FMT_* fourcc pixelformat and its bytes per pixel (bpp)
>> ÂÂ */
>> Â struct vimc_pix_map {
>> -ÂÂÂ unsigned int code[1];
>
>> +ÂÂÂ unsigned int code[8];
> Please add a define for this instead of hard coded value.
With this change suggested by Shuah:
Acked-by: Helen Koike <helen.koike@xxxxxxxxxxxxx>
Regards,
Helen
>
>
>> ÂÂÂÂÂ unsigned int bpp;
>> ÂÂÂÂÂ u32 pixelformat;
>> ÂÂÂÂÂ bool bayer;
>>
>