Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp920250imj; Sat, 9 Feb 2019 10:48:42 -0800 (PST) X-Google-Smtp-Source: AHgI3IaXAE+hATtSgFa4gnC8yzOY56cHnrnXiCgVwG69d8XRi9UKWBYxVwUmPo/e2ODcgEoQ9v7X X-Received: by 2002:a65:6219:: with SMTP id d25mr11833830pgv.18.1549738122179; Sat, 09 Feb 2019 10:48:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549738122; cv=none; d=google.com; s=arc-20160816; b=onV5TJ/czE0y+FFhMjGmE9XrBvWThV+6TenNBVA88PWUpv+SbiXkOG4VIgLgnxLE0j jFHlKLIhxTMTnO9uAZBGsHE7pa3BjB3DHRtLJ2u89KHPCTM0m+zrmSZlg5aE4y1ggrnG o8G3d0J2GtScQHNhTOlem7PK/oaHoNpRpBhv5YGTuhDUPD88JGEiVJs+cCA5JICOCA8/ gIMXBg3tgmjt3InYXWkti8sF44JMBxUxwYB/5Ebto+GMYtiL/nImHgV5JG7bl+pBoTJT /8HHnNCpUE6k/Evi1NJc6sA2C4SVWggpMnVUuMQ26EzZm88097nu7Mw8JF6/h58vL0A4 ZDbw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MyzdWzFNEDqEhGfbzFWSbwvCxAmQ47kSrbrTgcuaxPE=; b=rRVIE+AXBpEh7T561Q1eL8d1Qo9PqYb/amAKGAP+8IGWp1BMXGSfR1xbYFCkIWQH5+ PCMJPoZgCuC1TIC5RAPybKMPk5l/0Uasm5c127RieT2UL06UT4zMhVzy46qx3arkbYnB 1FNQbs3/jAWwumcQuE3kHTk+m3g5tK6yqFENcq2O3UrapnfIjsNNprgn0r+Bhovnq08R RAjDr+CNwa44dJBff8Xci7N4XBwcP2TP+uG72M1akYIDcLVFTriUjAfqJo2RMji2/7HS ffvCuHY7ePCtxweAqqMCSJtipdU3KwxNydfbxPxfY1QsCHTX7jRuMlZZsU1jsvuqeXHN etlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fHRW+nOu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e67si5695112pfa.15.2019.02.09.10.48.26; Sat, 09 Feb 2019 10:48:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=fHRW+nOu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727528AbfBISsC (ORCPT + 99 others); Sat, 9 Feb 2019 13:48:02 -0500 Received: from mail.kernel.org ([198.145.29.99]:60744 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727478AbfBISr5 (ORCPT ); Sat, 9 Feb 2019 13:47:57 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 368D62192D; Sat, 9 Feb 2019 18:47:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1549738076; bh=Oh/j8VqRQMVPxxX41V4Rs1fKk4xphirq4r9MmXVLvzw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fHRW+nOuLJr1CABdkI3Rqvb7aAKk4RSV+QiJVFS0GWUyjbSjN2cHn/sizwY74hMd6 rvQ+hUHPV0i+5Kskk5m+4riIhtqqEX/MOyHkdh3NOZlizRWgvOntnWpQ2mYbfIdHlq Nmmsh02GzsdYci/k0oj07w8scBN53FaDFZkPD57Q= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Tomi Valkeinen , Andrzej Hajda , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 4.20 20/42] drm/bridge: tc358767: fix output H/V syncs Date: Sat, 9 Feb 2019 13:47:12 -0500 Message-Id: <20190209184734.125935-20-sashal@kernel.org> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20190209184734.125935-1-sashal@kernel.org> References: <20190209184734.125935-1-sashal@kernel.org> MIME-Version: 1.0 X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Tomi Valkeinen [ Upstream commit 7923e09c7a766e2d58de7fc395bb84c18e5bc625 ] The H and V syncs of the DP output are always set to active high. This patch fixes the syncs by configuring them according to the videomode. Signed-off-by: Tomi Valkeinen Reviewed-by: Andrzej Hajda Signed-off-by: Andrzej Hajda Link: https://patchwork.freedesktop.org/patch/msgid/20190103115954.12785-7-tomi.valkeinen@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/bridge/tc358767.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/bridge/tc358767.c b/drivers/gpu/drm/bridge/tc358767.c index a1f3dd2afbb1..391547358756 100644 --- a/drivers/gpu/drm/bridge/tc358767.c +++ b/drivers/gpu/drm/bridge/tc358767.c @@ -98,6 +98,8 @@ #define DP0_STARTVAL 0x064c #define DP0_ACTIVEVAL 0x0650 #define DP0_SYNCVAL 0x0654 +#define SYNCVAL_HS_POL_ACTIVE_LOW (1 << 15) +#define SYNCVAL_VS_POL_ACTIVE_LOW (1 << 31) #define DP0_MISC 0x0658 #define TU_SIZE_RECOMMENDED (63) /* LSCLK cycles per TU */ #define BPC_6 (0 << 5) @@ -726,7 +728,9 @@ static int tc_set_video_mode(struct tc_data *tc, struct drm_display_mode *mode) tc_write(DP0_ACTIVEVAL, (mode->vdisplay << 16) | (mode->hdisplay)); - tc_write(DP0_SYNCVAL, (vsync_len << 16) | (hsync_len << 0)); + tc_write(DP0_SYNCVAL, (vsync_len << 16) | (hsync_len << 0) | + ((mode->flags & DRM_MODE_FLAG_NHSYNC) ? SYNCVAL_HS_POL_ACTIVE_LOW : 0) | + ((mode->flags & DRM_MODE_FLAG_NVSYNC) ? SYNCVAL_VS_POL_ACTIVE_LOW : 0)); tc_write(DPIPXLFMT, VS_POL_ACTIVE_LOW | HS_POL_ACTIVE_LOW | DE_POL_ACTIVE_HIGH | SUB_CFG_TYPE_CONFIG1 | DPI_BPP_RGB888); -- 2.19.1