From patchwork Fri Apr 26 19:51:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Almeida?= X-Patchwork-Id: 10919637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AB4DC15E9 for ; Fri, 26 Apr 2019 19:51:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 995FD28E6E for ; Fri, 26 Apr 2019 19:51:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C75A28E72; Fri, 26 Apr 2019 19:51:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DF29E28E71 for ; Fri, 26 Apr 2019 19:51:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726779AbfDZTvl (ORCPT ); Fri, 26 Apr 2019 15:51:41 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:40632 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726310AbfDZTvk (ORCPT ); Fri, 26 Apr 2019 15:51:40 -0400 Received: from localhost.localdomain (unknown [IPv6:2804:431:9718:9080:61b7:f4a4:2020:fc95]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: tonyk) by bhuna.collabora.co.uk (Postfix) with ESMTPSA id 038C32725B1; Fri, 26 Apr 2019 20:51:35 +0100 (BST) From: =?utf-8?q?Andr=C3=A9_Almeida?= To: linux-media@vger.kernel.org Cc: mchehab@kernel.org, hverkuil@xs4all.nl, helen.koike@collabora.com, kernel@collabora.com, lucmaga@gmail.com, lkcamp@lists.libreplanetbr.org, =?utf-8?q?Andr=C3=A9_Almeida?= Subject: [PATCH v5 00/14] media: vimc: Add support for multiplanar formats Date: Fri, 26 Apr 2019 16:51:00 -0300 Message-Id: <20190426195114.5002-1-andrealmeid@collabora.com> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hello, This series implements support for multiplane pixel formats at Vimc. A lot of changes were required since vimc support for singleplane was "hardcoded". The code has been adapted in order to support both formats. When was possible, the functions were written generically, avoiding functions for just one type of pixel format. The debayer subdevice is the only one that currently doesn't supports multiplanar formats. Documentation to each device will be made in a future patch. In hardcoded topology, the exposed capture device `RGB/YUV Capture` have a debayer in the pipeline, so it will fail when tested with multiplanar formats. The last commit of this series was tested using Hans' virtme.sh[1] script here are the summary of results: Grand Total for vivid device /dev/media0: 631, Succeeded: 631, Failed: 0, Warnings: 6 Grand Total for vivid device /dev/media1: 631, Succeeded: 631, Failed: 0, Warnings: 6 Grand Total for vim2m device /dev/media3: 61, Succeeded: 61, Failed: 0, Warnings: 0 Grand Total for vimc device /dev/media3: 478, Succeeded: 478, Failed: 0, Warnings: 0 Final Summary: 1801, Succeeded: 1801, Failed: 0, Warnings: 12 Thanks, André [1] https://hverkuil.home.xs4all.nl/virtme/virtme.sh Changes in v5: - Remove bpp from vimc_sca_device Changes in v4: - Remove unutilized commit "Propagate multiplanar state in the stream" - Split "Create multiplanar parameter and ioctls" - Check for try_fmt return value - Change ret from `unsigned int` to `int` - Remove label `free_planes` from else scope - Change vars at vimc-scaler Changes in v3: - Refactor vimc_frame and vimc_fill_frame in order to be more clear and simple - Squash "Add handler for multiplanar fmt ioctls" and "Create multiplanar parameter" - Define format ioctls of capture device according to it capabilities - Get rid of `IS_MULTIPLANAR(vcap)` verification on format ioctls - Remove some format ioctl handlers - Reorder "Move sp2mp functions to v4l2-common" - Minimal code style and comments changes - Assign ioctls according to capture device capabilities Changes in v2: - Fix typos - Fix indentations - Enhance v4l2_fmt_* documentation - Change the order of commits, now the multiplanar parameter is the last one with the commit to set the device capabilities - Squash "unnecessary checks" commits together - In v1, the whole media device was in singleplanar or in multiplanar format. Now, each stream/pipeline can be in a format - Check the capture capabilities to get if the stream is in singleplanar/multiplanar mode, instead of checking the module parameter. - Change `if (multiplanar)` to `if (IS_MULTIPLANAR(vcap))` - Add a new commit to propagate in the stream if the capture device is in multiplanar or singleplanar mode André Almeida (14): media: vimc: Remove unnecessary stream checks media: vimc: cap: Change vimc_cap_device.format type media: vimc: cap: Dynamically define stream pixelformat media: Move sp2mp functions to v4l2-common media: vimc: cap: refactor singleplanar as a subset of multiplanar media: vimc: cap: Add handler for multiplanar fmt ioctls media: vimc: cap: Add multiplanar formats media: vimc: cap: Add multiplanar default format media: vimc: cap: Allocate and verify mplanar buffers media: vimc: Add and use new struct vimc_frame media: vimc: sen: Add support for multiplanar formats media: vimc: sca: Add support for multiplanar formats media: vimc: cap: Add support for multiplanar formats media: vimc: Create multiplanar parameter drivers/media/platform/vimc/vimc-capture.c | 288 ++++++++++++++---- drivers/media/platform/vimc/vimc-common.c | 8 + drivers/media/platform/vimc/vimc-common.h | 41 ++- drivers/media/platform/vimc/vimc-debayer.c | 38 ++- drivers/media/platform/vimc/vimc-scaler.c | 127 ++++---- drivers/media/platform/vimc/vimc-sensor.c | 67 ++-- drivers/media/platform/vimc/vimc-streamer.c | 2 +- drivers/media/platform/vivid/vivid-vid-cap.c | 6 +- .../media/platform/vivid/vivid-vid-common.c | 59 ---- .../media/platform/vivid/vivid-vid-common.h | 9 - drivers/media/platform/vivid/vivid-vid-out.c | 6 +- drivers/media/v4l2-core/v4l2-common.c | 62 ++++ include/media/v4l2-common.h | 37 +++ 13 files changed, 511 insertions(+), 239 deletions(-)