Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp644678ybm; Fri, 29 May 2020 08:46:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzPzo73mzt9P8sNJSk0nmgJ6pdkhMoQ+BRVrSW6uN9ERHwBTGyDpUHyokr3I2rXQr7kVCAr X-Received: by 2002:a17:906:415a:: with SMTP id l26mr8012333ejk.291.1590767178851; Fri, 29 May 2020 08:46:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590767178; cv=none; d=google.com; s=arc-20160816; b=zPLfxEIr/+Ear/399G+Zoonk0Bh9QNx5MUOHrHvQHAb7gP5d6GRHWnSUGa63AE1xqF xhfcQhszvsKqcIWlpOtuuDsj4RXGB2vZ/X2ffJyDhPHTfyGAGNZVplibFlQg+LxUdY4h /smnqxlJfv5Y8/0Z6Q4xloGfEkuUDI5QxvlQeYbsGv9bTmm0cqO+Z4gL9PqKnBQ1B8pQ +9VA7xJvstmlDfzsfn1EXaXS0JO8hkHpA1z7r8Qbsf8EFndVfhCTR5t1ettUYe4YONbf 6UeJt7DH9ccy5PRkPi1+3kzL+kuyOxBUFWwyhOKhdvr6wXO4zxiE5cnrgrsyxOBy8+lt c+8g== 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:to:subject; bh=6KkaiOlBnQGeGTvjNXqy6QHl+AfB6QPM7BzxfvBt28w=; b=Aunc5RUR2jIYGlrdNAFb5RWyrnbcIhmOLPui+qzrk0p3eOkrQd3ITK+OquICZJVJnP eFved4b4ajw7u+Wdr1xBDIidHGiKeHdME0OHB3IRV6DZzfMsof6x7yZmzq2BlOM2pOlC Dtg7l2PZ7eGEhZZQzOsb7zTIm46vsC38OCMoD8nk7UYASzAXCRsfwGfzO0zyz0W24fIw HxGV09GEfvxKbNup4tXc01EWivD9N9mQa9UgjEuqWO/U+RmwlIFAo1h/eCexc+jfY6JA 1sTLtxhB9IPLB89976jLEzFIOloMktsPNr0FEZ4s2mkihghszf4sCIVhly0dGcmlB6/y OXuw== 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 d5si559506edv.2.2020.05.29.08.45.55; Fri, 29 May 2020 08:46:18 -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 S1727774AbgE2PoC (ORCPT + 99 others); Fri, 29 May 2020 11:44:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727023AbgE2PoB (ORCPT ); Fri, 29 May 2020 11:44:01 -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 A1C94C03E969; Fri, 29 May 2020 08:44:01 -0700 (PDT) Received: from [IPv6:2003:cb:871f:5b00:5488:ffc1:6399:a6c0] (p200300cb871f5b005488ffc16399a6c0.dip0.t-ipconnect.de [IPv6:2003:cb:871f:5b00:5488:ffc1:6399:a6c0]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: dafna) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id F34212A440E; Fri, 29 May 2020 16:43:59 +0100 (BST) Subject: Re: [PATCH] vimc: debayer: Add support for ARGB format To: Kaaira Gupta , Helen Koike , Shuah Khan , 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> From: Dafna Hirschfeld Message-ID: <0ab57863-935d-3ab5-dfea-80a44c63ae18@collabora.com> Date: Fri, 29 May 2020 17:43:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200528185717.GA20581@kaaira-HP-Pavilion-Notebook> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. 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; > + } > } > } > } >