linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Helen Koike <helen.koike@collabora.com>
To: Dafna Hirschfeld <dafna.hirschfeld@collabora.com>,
	Kaaira Gupta <kgupta@es.iitr.ac.in>
Cc: Shuah Khan <skhan@linuxfoundation.org>,
	laurent.pinchart@ideasonboard.com,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	kieran.bingham@ideasonboard.com,
	dafna Hirschfeld <dafna3@gmail.com>
Subject: Re: [PATCH] vimc: debayer: Add support for ARGB format
Date: Tue, 2 Jun 2020 07:55:30 -0300	[thread overview]
Message-ID: <f927c8e3-73de-598d-130d-97b5380579e5@collabora.com> (raw)
In-Reply-To: <273a36d8-fc87-f9d4-0cf2-15beddf1661c@collabora.com>



On 6/2/20 7:52 AM, Dafna Hirschfeld wrote:
> 
> 
> On 01.06.20 14:16, Kaaira Gupta wrote:
>> On Fri, May 29, 2020 at 05:43:57PM +0200, Dafna Hirschfeld wrote:
>>> Hi,
>>> Thanks for the patch
>>>
>>> I don't know how real devices handle ARGB formats,
>>> I wonder if it should be the part of the debayer.
>>
>> Hi! qcam tries to support BA24 as it is one of the formats that vimc
>> lists as its supported formats wih --list-formats. Shouldn't BA24 be
>> possible to capture with vimc?
> 
> Hi,
> Just to clarify, when listing the supported formats of a video node, the node lists
> the formats that the video node as an independent media entity support.
> It does not mean that the 'camera' as a whole (that is, the media topology graph) supports
> all the formats that the video node lists. When interacting with a video node or
> a subdevice node, one interacts only with that specific entity.
> In the case of vimc, the RGB video node as an independent entity supports BA24 so the format
> appears in the list of the its supported formats. But since the Debayer does not
> support it, the format can not be generated by the entire vimc topology.
> This is not a bug.

This is also my understanding.

You should have an -EPIPE error when start streaming though, it shouldn't fail silently.

Regards,
Helen

> 
> Hope t was helpful,
> Dafna
>  
>>
>> If yes, which entity should support it, if not debayer? Should there be
>> a separate conversion entity, or should we keep the support in debayer
>> itself for efficiency issues?
>>
>>>
>>>
>>> On 28.05.20 20:57, Kaaira Gupta wrote:
>>>> Running qcam for pixelformat 0x34324142 showed that vimc debayer does
>>>> not support it. Hence, add the support for Alpha (255).
>>>
>>> I would change the commit log to:
>>>
>>> Add support for V4L2_PIX_FMT_RGB24 format in the debayer
>>> and set the alpha channel to constant 255.
>>>
>>> Thanks,
>>> Dafna
>>>
>>>>
>>>> Signed-off-by: Kaaira Gupta <kgupta@es.iitr.ac.in>
>>>> ---
>>>>    .../media/test-drivers/vimc/vimc-debayer.c    | 27 ++++++++++++-------
>>>>    1 file changed, 18 insertions(+), 9 deletions(-)
>>>>
>>>> diff --git a/drivers/media/test-drivers/vimc/vimc-debayer.c b/drivers/media/test-drivers/vimc/vimc-debayer.c
>>>> index c3f6fef34f68..f34148717a40 100644
>>>> --- a/drivers/media/test-drivers/vimc/vimc-debayer.c
>>>> +++ b/drivers/media/test-drivers/vimc/vimc-debayer.c
>>>> @@ -62,6 +62,7 @@ static const u32 vimc_deb_src_mbus_codes[] = {
>>>>        MEDIA_BUS_FMT_RGB888_1X7X4_SPWG,
>>>>        MEDIA_BUS_FMT_RGB888_1X7X4_JEIDA,
>>>>        MEDIA_BUS_FMT_RGB888_1X32_PADHI,
>>>> +    MEDIA_BUS_FMT_ARGB8888_1X32
>>>>    };
>>>>    static const struct vimc_deb_pix_map vimc_deb_pix_map_list[] = {
>>>> @@ -322,15 +323,23 @@ static void vimc_deb_process_rgb_frame(struct vimc_deb_device *vdeb,
>>>>        unsigned int i, index;
>>>>        vpix = vimc_pix_map_by_code(vdeb->src_code);
>>>> -    index = VIMC_FRAME_INDEX(lin, col, vdeb->sink_fmt.width, 3);
>>>> -    for (i = 0; i < 3; i++) {
>>>> -        switch (vpix->pixelformat) {
>>>> -        case V4L2_PIX_FMT_RGB24:
>>>> -            vdeb->src_frame[index + i] = rgb[i];
>>>> -            break;
>>>> -        case V4L2_PIX_FMT_BGR24:
>>>> -            vdeb->src_frame[index + i] = rgb[2 - i];
>>>> -            break;
>>>> +
>>>> +    if (vpix->pixelformat == V4L2_PIX_FMT_ARGB32) {
>>>> +        index =  VIMC_FRAME_INDEX(lin, col, vdeb->sink_fmt.width, 4);
>>>> +        vdeb->src_frame[index] = 255;
>>>> +        for (i = 0; i < 3; i++)
>>>> +            vdeb->src_frame[index + i + 1] = rgb[i];
>>>> +    } else {
>>>> +        index =  VIMC_FRAME_INDEX(lin, col, vdeb->sink_fmt.width, 3);
>>>> +        for (i = 0; i < 3; i++) {
>>>> +            switch (vpix->pixelformat) {
>>>> +            case V4L2_PIX_FMT_RGB24:
>>>> +                vdeb->src_frame[index + i] = rgb[i];
>>>> +                break;
>>>> +            case V4L2_PIX_FMT_BGR24:
>>>> +                vdeb->src_frame[index + i] = rgb[2 - i];
>>>> +                break;
>>>> +            }
>>>>            }
>>>>        }
>>>>    }
>>>>

  reply	other threads:[~2020-06-02 10:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-28 18:57 [PATCH] vimc: debayer: Add support for ARGB format Kaaira Gupta
2020-05-29 15:43 ` Dafna Hirschfeld
2020-06-01 12:16   ` Kaaira Gupta
2020-06-01 12:37     ` Laurent Pinchart
2020-06-01 16:27       ` Helen Koike
2020-06-02 10:52     ` Dafna Hirschfeld
2020-06-02 10:55       ` Helen Koike [this message]
2020-06-02 11:24         ` Kieran Bingham
2020-06-02 11:31           ` Helen Koike
2020-06-02 12:45             ` Laurent Pinchart
2020-06-02 13:13               ` Helen Koike
2020-06-02 13:16               ` Dafna Hirschfeld
2020-06-02 15:14                 ` Laurent Pinchart

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f927c8e3-73de-598d-130d-97b5380579e5@collabora.com \
    --to=helen.koike@collabora.com \
    --cc=dafna.hirschfeld@collabora.com \
    --cc=dafna3@gmail.com \
    --cc=kgupta@es.iitr.ac.in \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).