From patchwork Thu Aug 23 15:12:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jacopo Mondi X-Patchwork-Id: 10574841 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 1467A920 for ; Fri, 24 Aug 2018 07:09:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F40ED2C46F for ; Fri, 24 Aug 2018 07:09:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8AE12C475; Fri, 24 Aug 2018 07:09:36 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A90832C46F for ; Fri, 24 Aug 2018 07:09:36 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 19EA76E610; Fri, 24 Aug 2018 07:09:23 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by gabe.freedesktop.org (Postfix) with ESMTPS id E2F8B89971 for ; Thu, 23 Aug 2018 15:12:31 +0000 (UTC) X-Originating-IP: 2.224.242.101 Received: from w540.lan (2-224-242-101.ip172.fastwebnet.it [2.224.242.101]) (Authenticated sender: jacopo@jmondi.org) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id 92C34E0011; Thu, 23 Aug 2018 15:12:29 +0000 (UTC) From: Jacopo Mondi To: Laurent Pinchart , David Airlie Subject: [PATCH 2/4] drm: rcar-du: Write OTAR for DPAD channels only Date: Thu, 23 Aug 2018 17:12:12 +0200 Message-Id: <1535037134-373-3-git-send-email-jacopo+renesas@jmondi.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1535037134-373-1-git-send-email-jacopo+renesas@jmondi.org> References: <1535037134-373-1-git-send-email-jacopo+renesas@jmondi.org> X-Mailman-Approved-At: Fri, 24 Aug 2018 07:09:20 +0000 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: ulrich.hecht+renesas@gmail.com, "open list:DRM DRIVERS FOR RENESAS" , Jacopo Mondi , kieran.bingham@ideasonboard.com, "open list:DRM DRIVERS FOR RENESAS" MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP According to revision 1.00 of R-Car Gen3 SoC manual, writing to OTAR register is valid only if the channel is equipped with a digital output pad (DPAD). Signed-off-by: Jacopo Mondi --- drivers/gpu/drm/rcar-du/rcar_du_crtc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c index 7b1c05b..9ba5551 100644 --- a/drivers/gpu/drm/rcar-du/rcar_du_crtc.c +++ b/drivers/gpu/drm/rcar-du/rcar_du_crtc.c @@ -315,7 +315,10 @@ static void rcar_du_crtc_set_display_timing(struct rcar_du_crtc *rcrtc) params.escr); } - rcar_du_crtc_write(rcrtc, rcrtc->index % 2 ? OTAR13 : OTAR02, 0); + if (rcrtc->index & + rcdu->info->routes[RCAR_DU_OUTPUT_DPAD0].possible_crtcs) + rcar_du_crtc_write(rcrtc, rcrtc->index % 2 ? OTAR13 : OTAR02, + 0); /* Signal polarities */ dsmr = ((mode->flags & DRM_MODE_FLAG_PVSYNC) ? DSMR_VSL : 0)