[{"id":3847,"web_url":"https://patchwork.libcamera.org/comment/3847/","msgid":"<20200226014147.GX4764@pendragon.ideasonboard.com>","date":"2020-02-26T01:41:47","subject":"Re: [libcamera-devel] [PATCH] qcam: format_convertor: Extend 32 bit\n\tARGB format combinations","submitter":{"id":2,"url":"https://patchwork.libcamera.org/api/people/2/","name":"Laurent Pinchart","email":"laurent.pinchart@ideasonboard.com"},"content":"Hi Kieran,\n\nThank you for the patch.\n\nOn Mon, Feb 24, 2020 at 01:08:55PM +0000, Kieran Bingham wrote:\n> Add further support to the pixel format convertor to allow ARGB, RGBA,\n> and ABGR formats to be displayed in qcam.\n> \n> Blank lines are added between the sections for NV, RGB, YUV, and MJPEG\n> configurations.\n> \n> The implementation of the RGB conversions are highly inefficient, and\n> where possible should be extended to use hardware accellerations such as\n\ns/accellerations/accelerations/\n\n> OpenGL, or in the event that the input format is identical (or\n> compatible) with the output format - a more optimised memcpy should be\n> implemented.\n> \n> Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\nReviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\n> ---\n>  src/qcam/format_converter.cpp | 25 +++++++++++++++++++++++++\n>  1 file changed, 25 insertions(+)\n> \n> diff --git a/src/qcam/format_converter.cpp b/src/qcam/format_converter.cpp\n> index 383d48223140..4604143419dd 100644\n> --- a/src/qcam/format_converter.cpp\n> +++ b/src/qcam/format_converter.cpp\n> @@ -67,6 +67,7 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n>  \t\tvertSubSample_ = 1;\n>  \t\tnvSwap_ = true;\n>  \t\tbreak;\n> +\n>  \tcase DRM_FORMAT_RGB888:\n>  \t\tformatFamily_ = RGB;\n>  \t\tr_pos_ = 2;\n> @@ -81,6 +82,27 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n>  \t\tb_pos_ = 2;\n>  \t\tbpp_ = 3;\n>  \t\tbreak;\n> +\tcase DRM_FORMAT_ARGB8888:\n> +\t\tformatFamily_ = RGB;\n> +\t\tr_pos_ = 2;\n> +\t\tg_pos_ = 1;\n> +\t\tb_pos_ = 0;\n> +\t\tbpp_ = 4;\n> +\t\tbreak;\n> +\tcase DRM_FORMAT_RGBA8888:\n> +\t\tformatFamily_ = RGB;\n> +\t\tr_pos_ = 3;\n> +\t\tg_pos_ = 2;\n> +\t\tb_pos_ = 1;\n> +\t\tbpp_ = 4;\n> +\t\tbreak;\n> +\tcase DRM_FORMAT_ABGR8888:\n> +\t\tformatFamily_ = RGB;\n> +\t\tr_pos_ = 0;\n> +\t\tg_pos_ = 1;\n> +\t\tb_pos_ = 2;\n> +\t\tbpp_ = 4;\n> +\t\tbreak;\n>  \tcase DRM_FORMAT_BGRA8888:\n>  \t\tformatFamily_ = RGB;\n>  \t\tr_pos_ = 1;\n> @@ -88,6 +110,7 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n>  \t\tb_pos_ = 3;\n>  \t\tbpp_ = 4;\n>  \t\tbreak;\n> +\n>  \tcase DRM_FORMAT_VYUY:\n>  \t\tformatFamily_ = YUV;\n>  \t\ty_pos_ = 1;\n> @@ -108,9 +131,11 @@ int FormatConverter::configure(unsigned int format, unsigned int width,\n>  \t\ty_pos_ = 0;\n>  \t\tcb_pos_ = 1;\n>  \t\tbreak;\n> +\n>  \tcase DRM_FORMAT_MJPEG:\n>  \t\tformatFamily_ = MJPEG;\n>  \t\tbreak;\n> +\n>  \tdefault:\n>  \t\treturn -EINVAL;\n>  \t};","headers":{"Return-Path":"<laurent.pinchart@ideasonboard.com>","Received":["from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 8DC406042F\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 26 Feb 2020 02:42:09 +0100 (CET)","from pendragon.ideasonboard.com (81-175-216-236.bb.dnainternet.fi\n\t[81.175.216.236])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id D93B843F;\n\tWed, 26 Feb 2020 02:42:08 +0100 (CET)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1582681329;\n\tbh=bZtOWjzNaBubga3Y+Ny4sBrnnYDw/t9pXOEtIvOtvbc=;\n\th=Date:From:To:Cc:Subject:References:In-Reply-To:From;\n\tb=prtPaKaix+vu7sQq6UQ7Ya7bQwVub9v7K1Z8+Yonxg8naJpWcorX5116CBHr5xJte\n\tr15Dm26rEhf4wRxyIcNbpPP2k6BIV3qjuigl/1LeAwLYKM3BOsR4hpjWgdXfqTx7jg\n\tV5vHpI3oV2VHhs11TYz2NG7rtlqH/sUFX8tI++WE=","Date":"Wed, 26 Feb 2020 03:41:47 +0200","From":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","To":"Kieran Bingham <kieran.bingham@ideasonboard.com>","Cc":"libcamera devel <libcamera-devel@lists.libcamera.org>","Message-ID":"<20200226014147.GX4764@pendragon.ideasonboard.com>","References":"<20200224130855.4858-1-kieran.bingham@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<20200224130855.4858-1-kieran.bingham@ideasonboard.com>","User-Agent":"Mutt/1.10.1 (2018-07-13)","Subject":"Re: [libcamera-devel] [PATCH] qcam: format_convertor: Extend 32 bit\n\tARGB format combinations","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Wed, 26 Feb 2020 01:42:09 -0000"}}]