From patchwork Wed Oct 17 00:00:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Longerbeam X-Patchwork-Id: 10644425 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 65803157A for ; Wed, 17 Oct 2018 00:00:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 57D452A592 for ; Wed, 17 Oct 2018 00:00:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4BF3A2A5AD; Wed, 17 Oct 2018 00:00:39 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,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 CEBF32A56F for ; Wed, 17 Oct 2018 00:00:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727266AbeJQHx2 (ORCPT ); Wed, 17 Oct 2018 03:53:28 -0400 Received: from mail-pg1-f195.google.com ([209.85.215.195]:44920 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeJQHx2 (ORCPT ); Wed, 17 Oct 2018 03:53:28 -0400 Received: by mail-pg1-f195.google.com with SMTP id g2-v6so11593791pgu.11 for ; Tue, 16 Oct 2018 17:00:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1XQDrk/rzbQTPCX0roZIg0fUuBjddpdFXL3ehx2B2K0=; b=ehz4iCY6dNVV9tN5dq6pfwjACL93SvrY7g5whtSYsa75jHBFmU2qjajouFCZjhvE4e jj7aXTtxZng7dSaP897q5rEKDEEZVLbSfWk45Ss6qA4MnLhZ3xYwNcF/kXT86gkbG123 XGDuZMhfD+uBeVXgz7yuNiu3UVTj+o0Oc9YYJeDWeYdLt+9iGib9SPfBKQmzlzWS4IFJ NFyddcv6+Q+x2utuqd58Eh+ISau3Rn75HRGY05J9O2cnTM9WRZr+MSM2bj8P/gi21FVB eP/OQOXkMsVE7LJeH1Ij7hM2x5Al/ua58SOBoPrc67RO+8Q6eRmcstjHvX4gj95sCOSo maXA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1XQDrk/rzbQTPCX0roZIg0fUuBjddpdFXL3ehx2B2K0=; b=ZS2eHtsUaB5puLEp6x2E1VsDzjqb6LxutnoHyhMkvdNa9d3s3rnMUpZ81DqUtjYCxz xqgnmWkKAYntu3DS/j9Vb6PzTAZe7PVEYgwTWm5zX1Ckm97o4qTPpv2lcKLtEKKpoBOm IFKRO7F2ahztId0POYo89viH1dG/TGfqMUR+9/WUD4/67pLvqb2qacPTZo72bfeJVTo5 KsW8GSEejX99koWWWAs+EcoQU8gfIdAGc1fZkX0YHfkD1Tu1SHUZ3m/7gU420Bf6okw4 h93LkiN7yX7nZc/zkT0er19jW5EvRBfpTT/xk9Jd1EdD/NDPY7nidC9VEBlzcBpcy3Kp zTMw== X-Gm-Message-State: ABuFfoj5zYJZ2c5HEJu32m5FuuKR+g/m5NX3H4XkWFmnjY+hcm+PnCdX YcYIxzHhXcz/FwIVuTTRNOegCYL4 X-Google-Smtp-Source: ACcGV63FnNOGa0st+kWIyVYZYBEpPU3UfhkKtcGTmXOdoexcIdhgmOKtpjXSs1vPJJT/5cfsffm7+w== X-Received: by 2002:a63:d40c:: with SMTP id a12-v6mr21828175pgh.394.1539734436227; Tue, 16 Oct 2018 17:00:36 -0700 (PDT) Received: from majic.sklembedded.com (c-98-210-181-167.hsd1.ca.comcast.net. [98.210.181.167]) by smtp.googlemail.com with ESMTPSA id o12-v6sm17033117pgv.7.2018.10.16.17.00.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Oct 2018 17:00:35 -0700 (PDT) From: Steve Longerbeam To: linux-media@vger.kernel.org Cc: Steve Longerbeam Subject: [PATCH v5 00/12] imx-media: Fixes for interlaced capture Date: Tue, 16 Oct 2018 17:00:15 -0700 Message-Id: <20181017000027.23696-1-slongerbeam@gmail.com> X-Mailer: git-send-email 2.17.1 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 A set of patches that fixes some bugs with capturing from an interlaced source, and incompatibilites between IDMAC interlace interweaving and 4:2:0 data write reduction. History: v5: - Added a regression fix to allow empty endpoints to CSI (fix for imx6q SabreAuto). - Cleaned up some convoluted code in ipu_csi_init_interface(), suggested by Philipp Zabel. - Fixed a regression in csi_setup(), caught by Philipp. - Removed interweave_offset and replace with boolean interweave_swap, suggested by Philipp. - Make clear that it is IDMAC channel that does pixel reordering and interweave, not the CSI, in the imx.rst doc, caught by Philipp. v4: - rebased to latest media-tree master branch. - Make patch author and SoB email addresses the same. v3: - add support for/fix interweaved scan with YUV planar output. - fix bug in 4:2:0 U/V offset macros. - add patch that generalizes behavior of field swap in ipu_csi_init_interface(). - add support for interweaved scan with field order swap. Suggested by Philipp Zabel. - in v2, inteweave scan was determined using field types of CSI (and PRPENCVF) at the sink and source pads. In v3, this has been moved one hop downstream: interweave is now determined using field type at source pad, and field type selected at capture interface. Suggested by Philipp. - make sure to double CSI crop target height when input field type in alternate. - more updates to media driver doc to reflect above. v2: - update media driver doc. - enable idmac interweave only if input field is sequential/alternate, and output field is 'interlaced*'. - move field try logic out of *try_fmt and into separate function. - fix bug with resetting crop/compose rectangles. - add a patch that fixes a field order bug in VDIC indirect mode. - remove alternate field type from V4L2_FIELD_IS_SEQUENTIAL() macro Suggested-by: Nicolas Dufresne . - add macro V4L2_FIELD_IS_INTERLACED(). Steve Longerbeam (12): media: videodev2.h: Add more field helper macros gpu: ipu-csi: Swap fields according to input/output field types gpu: ipu-v3: Add planar support to interlaced scan media: imx: Fix field negotiation media: imx-csi: Input connections to CSI should be optional media: imx-csi: Double crop height for alternate fields at sink media: imx: interweave and odd-chroma-row skip are incompatible media: imx-csi: Allow skipping odd chroma rows for YVU420 media: imx: vdic: rely on VDIC for correct field order media: imx-csi: Move crop/compose reset after filling default mbus fields media: imx: Allow interweave with top/bottom lines swapped media: imx.rst: Update doc to reflect fixes to interlaced capture Documentation/media/v4l-drivers/imx.rst | 103 +++++++---- drivers/gpu/ipu-v3/ipu-cpmem.c | 26 ++- drivers/gpu/ipu-v3/ipu-csi.c | 119 +++++++++---- drivers/staging/media/imx/imx-ic-prpencvf.c | 46 +++-- drivers/staging/media/imx/imx-media-capture.c | 14 ++ drivers/staging/media/imx/imx-media-csi.c | 168 +++++++++++++----- drivers/staging/media/imx/imx-media-vdic.c | 12 +- include/uapi/linux/videodev2.h | 7 + include/video/imx-ipu-v3.h | 6 +- 9 files changed, 354 insertions(+), 147 deletions(-)