Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp1195835ybg; Tue, 2 Jun 2020 03:57:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwvyQ1dl+b0NuOZcnDSkSPFDq5ML2QKMUMmpRsm7JVyAlfE3N3dSrIUMcSqVnf0GKeO8dBv X-Received: by 2002:a05:6402:21c2:: with SMTP id bi2mr18896617edb.296.1591095467146; Tue, 02 Jun 2020 03:57:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591095467; cv=none; d=google.com; s=arc-20160816; b=RcT27ljDck4bTf706HPVpZqKbRqZOtCwwlAxGmX8Eo7Kox8ixlNbBLbYwRWjAR5jTy WJGhCJ0vhUgGXx+7VY7BQP7IKbdD4OfXb2dbwzTbH+1pTt788+iU7tISi9/H7zoiZd4R CF/8+zLNyqWxdNyBD/ZzTLp3UC6lsA/2qhRI2W1fTEON28I0j9QIaVuQ4NLaMpYLVzdu 95N1t3GuD5SmvNInUqnm7l5i+aFzC+ZcEJtxE628eBk9rHRWiBZu/+fqMnFemj0kgM5L 8PGUwbliA2i0h3vKSL8HNkwrc98KZ6vfOKX7r+MlaC8d7hOzha19AQ11s7ULiV9sGKsL HbZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=7NfzErNchGpmZu5SsT/GB2R71GIGLhRcxv3fMLH7HPw=; b=KrQHlA0BJkxMpSLGqRsHPWpv+hJT5jqwg+f3/51ySLav5HWfGlmTprRH4DBLF0J+Zq YCgXBCXBZRU/NPspP7ZLhirgdtv6WXw9dQSN0aG4kpQReKSnTP2XDem+pgKCI2aGyvwA 5jePRxjyRb/egA4zQqpt+WayuikAPyc3GkNb2CJorgFYIvYctojwyofMRE9ZO7S9LH6C 8TjlRYW2xE8Ki9S9/R2yU6/UJkTG4IzugJy+pEkE9YBNIPC1dSGvBqDdz4hzqXEtGee5 /HrBxMB2lsvRsoBo3kzic3Famc1v9+KinoHrB8QTtxbBCW/ncZEQ1b4JX36U3I/AQBY+ t/Pw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y92si1238868edy.117.2020.06.02.03.57.23; Tue, 02 Jun 2020 03:57:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726809AbgFBKzj (ORCPT + 99 others); Tue, 2 Jun 2020 06:55:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726110AbgFBKzi (ORCPT ); Tue, 2 Jun 2020 06:55:38 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80ABAC061A0E; Tue, 2 Jun 2020 03:55:38 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: koike) with ESMTPSA id 3ECEF2A2D03 Subject: Re: [PATCH] vimc: debayer: Add support for ARGB format To: Dafna Hirschfeld , Kaaira Gupta Cc: Shuah Khan , laurent.pinchart@ideasonboard.com, Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, kieran.bingham@ideasonboard.com, dafna Hirschfeld References: <20200528185717.GA20581@kaaira-HP-Pavilion-Notebook> <0ab57863-935d-3ab5-dfea-80a44c63ae18@collabora.com> <20200601121626.GA13308@kaaira-HP-Pavilion-Notebook> <273a36d8-fc87-f9d4-0cf2-15beddf1661c@collabora.com> From: Helen Koike Message-ID: Date: Tue, 2 Jun 2020 07:55:30 -0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <273a36d8-fc87-f9d4-0cf2-15beddf1661c@collabora.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>>> --- >>>>    .../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; >>>> +            } >>>>            } >>>>        } >>>>    } >>>>