From patchwork Fri May 11 14:41:25 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10394451 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ECB99601A0 for ; Fri, 11 May 2018 14:42:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DDB3E28662 for ; Fri, 11 May 2018 14:42:08 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D07C528E61; Fri, 11 May 2018 14:42:08 +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 60BC328662 for ; Fri, 11 May 2018 14:42:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753194AbeEKOmH (ORCPT ); Fri, 11 May 2018 10:42:07 -0400 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:24046 "EHLO bin-mail-out-06.binero.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753186AbeEKOmG (ORCPT ); Fri, 11 May 2018 10:42:06 -0400 X-Halon-ID: 772ef616-5529-11e8-b831-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 772ef616-5529-11e8-b831-005056917f90; Fri, 11 May 2018 16:42:04 +0200 (CEST) From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: Laurent Pinchart , Hans Verkuil , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH v2 1/2] Revert "media: rcar-vin: enable field toggle after a set number of lines for Gen3" Date: Fri, 11 May 2018 16:41:25 +0200 Message-Id: <20180511144126.24804-2-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180511144126.24804-1-niklas.soderlund+renesas@ragnatech.se> References: <20180511144126.24804-1-niklas.soderlund+renesas@ragnatech.se> 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 The offending commit was an attempt to fix the issue of writing outside the capture buffer for VIN Gen3. Unfortunately it only fixed the symptom of the problem to such a degree I could no longer reproduce it. Revert the offending commit before a proper fix can be added in a follow-up patch. This reverts commit 015060cb7795eac34454696cc9c9f8b76926a401. Signed-off-by: Niklas Söderlund Acked-by: Kieran Bingham --- drivers/media/platform/rcar-vin/rcar-dma.c | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c b/drivers/media/platform/rcar-vin/rcar-dma.c index b41ba9a4a2b3ac90..ac07f99e3516a620 100644 --- a/drivers/media/platform/rcar-vin/rcar-dma.c +++ b/drivers/media/platform/rcar-vin/rcar-dma.c @@ -124,9 +124,7 @@ #define VNDMR2_VPS (1 << 30) #define VNDMR2_HPS (1 << 29) #define VNDMR2_FTEV (1 << 17) -#define VNDMR2_FTEH (1 << 16) #define VNDMR2_VLV(n) ((n & 0xf) << 12) -#define VNDMR2_HLV(n) ((n) & 0xfff) /* Video n CSI2 Interface Mode Register (Gen3) */ #define VNCSI_IFMD_DES1 (1 << 26) @@ -614,9 +612,8 @@ void rvin_crop_scale_comp(struct rvin_dev *vin) static int rvin_setup(struct rvin_dev *vin) { - u32 vnmc, dmr, dmr2, interrupts, lines; + u32 vnmc, dmr, dmr2, interrupts; bool progressive = false, output_is_yuv = false, input_is_yuv = false; - bool halfsize = false; switch (vin->format.field) { case V4L2_FIELD_TOP: @@ -631,15 +628,12 @@ static int rvin_setup(struct rvin_dev *vin) /* Use BT if video standard can be read and is 60 Hz format */ if (!vin->info->use_mc && vin->std & V4L2_STD_525_60) vnmc = VNMC_IM_FULL | VNMC_FOC; - halfsize = true; break; case V4L2_FIELD_INTERLACED_TB: vnmc = VNMC_IM_FULL; - halfsize = true; break; case V4L2_FIELD_INTERLACED_BT: vnmc = VNMC_IM_FULL | VNMC_FOC; - halfsize = true; break; case V4L2_FIELD_NONE: vnmc = VNMC_IM_ODD_EVEN; @@ -682,15 +676,11 @@ static int rvin_setup(struct rvin_dev *vin) break; } - if (vin->info->model == RCAR_GEN3) { - /* Enable HSYNC Field Toggle mode after height HSYNC inputs. */ - lines = vin->format.height / (halfsize ? 2 : 1); - dmr2 = VNDMR2_FTEH | VNDMR2_HLV(lines); - vin_dbg(vin, "Field Toogle after %u lines\n", lines); - } else { - /* Enable VSYNC Field Toogle mode after one VSYNC input. */ + /* Enable VSYNC Field Toogle mode after one VSYNC input */ + if (vin->info->model == RCAR_GEN3) + dmr2 = VNDMR2_FTEV; + else dmr2 = VNDMR2_FTEV | VNDMR2_VLV(1); - } /* Hsync Signal Polarity Select */ if (!(vin->mbus_cfg.flags & V4L2_MBUS_HSYNC_ACTIVE_LOW))