Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp430138ybg; Mon, 1 Jun 2020 05:18:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyj8FrqbxYQNVZiVgizVUTja6VB4BnUuG6tgyhVp7pZ4tJYeYK3eX6MbRRr7L58HK9COu/L X-Received: by 2002:a50:cdc6:: with SMTP id h6mr11103519edj.111.1591013929749; Mon, 01 Jun 2020 05:18:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591013929; cv=none; d=google.com; s=arc-20160816; b=aqs1/scSFk1NyKY+47j5CYpjmxb+4jt/ZogCBH4DpFzr+ndJNfuUCs8IRyqIzWxS+2 IpDgo0NHYHX3XJPmZ0/BZLfL1TH67G0y+xwp8xZUeJbEtMYSrZlqR+7yYTjfQirEjeYp fcdYj8vERRtR10S3WhS0UFk4e8evjCYIL0ZFHUjiS/01bCPiTqQnd4BAkyNVnWJY9tzU Bg3wISxA4DI0iOgPz9cGMO6WE7D7Yea8cRXOwyEbltPcKQasCcX9MV50PltAzUKSbJ6x zQ+ylZdMMGjLz+XKIuk+tyaZ1eCj1PyHV4rNga4RhLHWLxvEan8OCLqMuUdO6DqDj5Ab NTHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:date:from:dkim-signature; bh=Adc9Q8cwLIx/y058NsBjevbjaAdgThoe4xUlCWv9YbQ=; b=wNAsIZ2RNsqlXJEmhQq83MF/9GK/WUiZlGwsdZVA7eZbWbl0pBxK+pA5/dgsvPvM2V oaM2LVe8RfERoxZJnWSlqZySHDSyOsKebhc/KDQQPku3ZPGvc3+LI8rgQ34NDfdx8Pag JTEBqPJ6U8CL7RAc2otEuc8cb5xEwUjq0UVbvgYgLxZ1+XH9ASSs9TkRISkXmCclMqMA 3cV1nKvNH83VMUJ7aH5h1X2YpkJXZrg6L/WhN40fH3Fad8WEsh+DvnWy7IQiSyaqw+yb BpwqbuPw/+QQOgekMfkd6cA0P7uDH+8Ouvgr0bGITD9RWhFM6EZyTs7SUS1Lgw3og6G7 PuGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=s0YrPVZu; 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=QUARANTINE sp=NONE dis=NONE) header.from=iitr.ac.in Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l22si7660360ejb.500.2020.06.01.05.18.26; Mon, 01 Jun 2020 05:18:49 -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; dkim=pass header.i=@es-iitr-ac-in.20150623.gappssmtp.com header.s=20150623 header.b=s0YrPVZu; 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=QUARANTINE sp=NONE dis=NONE) header.from=iitr.ac.in Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726101AbgFAMQg (ORCPT + 99 others); Mon, 1 Jun 2020 08:16:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725976AbgFAMQf (ORCPT ); Mon, 1 Jun 2020 08:16:35 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C1847C061A0E for ; Mon, 1 Jun 2020 05:16:34 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id s10so3435200pgm.0 for ; Mon, 01 Jun 2020 05:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Adc9Q8cwLIx/y058NsBjevbjaAdgThoe4xUlCWv9YbQ=; b=s0YrPVZufkHndEoJJcFJlhncyyv5QPS6DHRcnQ1uMYCMUDPK8dvxHVyVS3Omnz8ZDN L2GiNuIZUEppwr3xwhMWzU7aAklk2qMmTpWiyL8zO3duJSbSbhBmrbZqzFVqWdhD1d9t xeC4a286hlTnDVGE+mY7EACs4+59R6a5j1ehPW19rmFWVWR2cz0p7ENP7Itzl1dN2zX9 lFf/uH1bk9YKk3ygJnxBO7z0pT1ZWP9Eme6NMIpt82oJ4a5tAUkYMbLzrzkC5WYMOT89 c3L8LkumGaluGEl2XQl8UrEHEFviY1sPU2TBSHQH87/KsStm/+ffMUExbIFAQnxKU1LW 2yRA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Adc9Q8cwLIx/y058NsBjevbjaAdgThoe4xUlCWv9YbQ=; b=ThZ4iGgi6ECGMAQKHu6raqp4lfI2KuYgE41WVtPv+ew7BI+02wyLor4xHVsVJ6dkhO PDHE+pWh5QgAsf5SZF3XQMduoolWj7KdPDlUvcm+0lL0eAvEdBxBM0IP9B/cNJgk74U7 RXsdZrdsnScZIOkOUERgbJUSa+E4D7zot2+BkEEfrxsrjzE4bPEn159nJiaCHX0I6Bpo h4D8KsBMJfBw98ETCe3Ya4GtAuYbvclRox5Tp3C3IuwVzrviACbXsnZYoQ6TD27g2VYP jzbWMd+TXdmE0ZYXw7N/rPEYSEr5HAzrcjy3rJTue9tmTB8QKqlQi5Paw+x2hIHp8SIu 8kXg== X-Gm-Message-State: AOAM530ekK7i3bk2tdMYYJdXPoi0caDUm44KMQ5PxbCMLlnsDn65i0mX x0fCZMqXFTE+wRjOJSND6tw4eA== X-Received: by 2002:a63:c948:: with SMTP id y8mr18877516pgg.118.1591013794218; Mon, 01 Jun 2020 05:16:34 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.174]) by smtp.gmail.com with ESMTPSA id d17sm7435775pjw.17.2020.06.01.05.16.30 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 01 Jun 2020 05:16:33 -0700 (PDT) From: Kaaira Gupta X-Google-Original-From: Kaaira Gupta Date: Mon, 1 Jun 2020 17:46:26 +0530 To: Dafna Hirschfeld Cc: Helen Koike , 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 Subject: [PATCH] vimc: debayer: Add support for ARGB format Message-ID: <20200601121626.GA13308@kaaira-HP-Pavilion-Notebook> References: <20200528185717.GA20581@kaaira-HP-Pavilion-Notebook> <0ab57863-935d-3ab5-dfea-80a44c63ae18@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <0ab57863-935d-3ab5-dfea-80a44c63ae18@collabora.com> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? 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; > > + } > > } > > } > > } > >