From patchwork Mon Dec 25 21:21:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 10132733 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 C166C60388 for ; Mon, 25 Dec 2017 21:21:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AAE7A2EA65 for ; Mon, 25 Dec 2017 21:21:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9EDD62EB70; Mon, 25 Dec 2017 21:21:35 +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=-6.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,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 386B92EA65 for ; Mon, 25 Dec 2017 21:21:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753009AbdLYVVd (ORCPT ); Mon, 25 Dec 2017 16:21:33 -0500 Received: from mail-lf0-f67.google.com ([209.85.215.67]:39892 "EHLO mail-lf0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752914AbdLYVVc (ORCPT ); Mon, 25 Dec 2017 16:21:32 -0500 Received: by mail-lf0-f67.google.com with SMTP id m20so25052536lfi.6 for ; Mon, 25 Dec 2017 13:21:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cogentembedded-com.20150623.gappssmtp.com; s=20150623; h=from:message-id:user-agent:date:to:cc:subject:mime-version :content-disposition; bh=DYAKdLjjuGPT6K6wPjmV2aW/Uo98ES+631KKXmVaZnU=; b=IOklBS4XsPmXJQw1dvjJrRigtpkJnz7QLhhy8sMSNfZwpe3f/63zYh8q1vWzQCs0ho cvb8idJhol6S1q/xn0nN/2lajdxwESvMcOXO2Nn6qIeAqw+i6qtf8lZYZo/ErAZpVzuf /0wmsoKUV9886nkch1V4Y7FVhcJR+2+eNdgwxw6CSbGHoMk7s2F+bf4GZBnF1lyIEFXM p/l82thHE30IPpNNLzq1RV9gKAkXiNfovfIgesosu5D+6Tzawu8FM+k6kx1t9lKYci2i uyIWgkYt4pkpLCXdy7vqGKqDFLqeS4M5unbMfomV+BDlc0z+FBfjvaX/3Vu4gUuppSqO yEow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:message-id:user-agent:date:to:cc:subject :mime-version:content-disposition; bh=DYAKdLjjuGPT6K6wPjmV2aW/Uo98ES+631KKXmVaZnU=; b=UEcG9RvZjHPbLUG2kBg9j+9mUzzpPE58jT2wq6PK0YVZ+B9FCDfK4IyAXIvEMkUHFl f0eOzMybuz4sxabIH2Ne3TW02ocC9oj3L7v726SX+vEP0m8tw3Tj5wlZdU0pOKrchS5t 8syfgLFgINTNkJbBK220DLsDEItFIaE8M+Nsnc4Lhl5yrzeBXEKXQrlAkhIC5G/0FL3v ZZLcS5SMgKXquzCZ10+rEFtzK5bgevCwtENYzcvZl25xzZXighkilrfdA++Ep5xrVmsY XLXsJnNHygJZxdHb/SVv6YmRHzouhuWXgUf/gM8Z+kHRPytc+0i6JTL0sBrOTGixTNwA NJeQ== X-Gm-Message-State: AKGB3mJeQmB986P5Dx5IDOg1qoDnNeHmVS4FBi5csDHAH4M2uGeB0xxl Dmp4Ug20jSpJYNscJDhCQCFy5g== X-Google-Smtp-Source: ACJfBos6JB11FxIeKro0MlADy8qIU1ZqbZ7iMs2pk2x9n3/sySaL267XcBjWUnCKALaFlERZiMceSQ== X-Received: by 10.46.70.18 with SMTP id t18mr13715148lja.120.1514236890753; Mon, 25 Dec 2017 13:21:30 -0800 (PST) Received: from wasted.cogentembedded.com ([31.173.81.54]) by smtp.gmail.com with ESMTPSA id i66sm3391732lfb.11.2017.12.25.13.21.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Dec 2017 13:21:29 -0800 (PST) From: Sergei Shtylyov X-Google-Original-From: "Sergei Shtylyov" Received: by wasted.cogentembedded.com (sSMTP sendmail emulation); Tue, 26 Dec 2017 00:21:27 +0300 Message-Id: <20171225212127.024131449@cogentembedded.com> User-Agent: quilt/0.64 Date: Tue, 26 Dec 2017 00:21:17 +0300 To: Laurent Pinchart , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org Cc: Sergei Shtylyov Subject: [PATCH] vsp1: fix video output on R8A77970 MIME-Version: 1.0 Content-Disposition: inline; filename=vsp1-fix-video-output-on-R8A77970.patch 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 Laurent has added support for the VSP2-D found on R-Car V3M (R8A77970) but the video output that VSP2-D sends to DU has a greenish garbage-like line repeated every 8 or so screen rows. It turns out that V3M has a teeny LIF register (at least it's documented!) that you need to set to some kind of a magic value for the LIF to work correctly... Based on the original (and large) patch by Daisuke Matsushita . Fixes: d455b45f8393 ("v4l: vsp1: Add support for new VSP2-BS, VSP2-DL and VSP2-D instances") Signed-off-by: Sergei Shtylyov --- This patch is against the 'media_tree.git' repo's 'master' branch. drivers/media/platform/vsp1/vsp1_lif.c | 8 ++++++++ drivers/media/platform/vsp1/vsp1_regs.h | 5 +++++ 2 files changed, 13 insertions(+) Index: media_tree/drivers/media/platform/vsp1/vsp1_lif.c =================================================================== --- media_tree.orig/drivers/media/platform/vsp1/vsp1_lif.c +++ media_tree/drivers/media/platform/vsp1/vsp1_lif.c @@ -155,6 +155,14 @@ static void lif_configure(struct vsp1_en (obth << VI6_LIF_CTRL_OBTH_SHIFT) | (format->code == 0 ? VI6_LIF_CTRL_CFMT : 0) | VI6_LIF_CTRL_REQSEL | VI6_LIF_CTRL_LIF_EN); + + if ((entity->vsp1->version & + (VI6_IP_VERSION_MODEL_MASK | VI6_IP_VERSION_SOC_MASK)) == + (VI6_IP_VERSION_MODEL_VSPD_V3 | VI6_IP_VERSION_SOC_V3M)) { + vsp1_lif_write(lif, dl, VI6_LIF_LBA, + VI6_LIF_LBA_LBA0 | + (1536 << VI6_LIF_LBA_LBA1_SHIFT)); + } } static const struct vsp1_entity_operations lif_entity_ops = { Index: media_tree/drivers/media/platform/vsp1/vsp1_regs.h =================================================================== --- media_tree.orig/drivers/media/platform/vsp1/vsp1_regs.h +++ media_tree/drivers/media/platform/vsp1/vsp1_regs.h @@ -693,6 +693,11 @@ #define VI6_LIF_CSBTH_LBTH_MASK (0x7ff << 0) #define VI6_LIF_CSBTH_LBTH_SHIFT 0 +#define VI6_LIF_LBA 0x3b0c +#define VI6_LIF_LBA_LBA0 (1 << 31) +#define VI6_LIF_LBA_LBA1_MASK (0xfff << 16) +#define VI6_LIF_LBA_LBA1_SHIFT 16 + /* ----------------------------------------------------------------------------- * Security Control Registers */