From patchwork Tue Dec 19 17:00:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 181103 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp2079247dyi; Tue, 19 Dec 2023 09:02:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IG2+V1BNUBNjQ60ha2cZAJu1iC69x+zBsh+ja6noHGQBl2iV/UarBJKO+h4UKA/RQdnb5JT X-Received: by 2002:a05:6870:3d96:b0:203:1c21:75e0 with SMTP id lm22-20020a0568703d9600b002031c2175e0mr12884267oab.15.1703005373328; Tue, 19 Dec 2023 09:02:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703005373; cv=none; d=google.com; s=arc-20160816; b=gfdhQWfOBnOUeY7CGiWrA8loZwYnrv3JRyYSu9ZreXxuczkXxoBSAfFFfD/7TNMRJp 6xdvFWcUtJeSiCq2D5RsibymkaguW/kTU8uOFCPZSFPlgvzDHBM7fpQd64ybWc3lnYvE DRRYouBGn7dNp/9nI6e1MQMiBMtR11zTK7NHAe4kjvunHTKBa8/QZIGfcMiAqb5pJjh6 pY2b0cYuXF5vUUgNtjIoPLpJsyDVLpHFsmKaPvb/ZSrBd8R4W2Uv8Gnvb3LKab7XZEDE 0txnMk6HE8/b7I/9K8GtvWRaibVEHZy00526pI678oEH73ZeohK2XGgaTJO/L2zAL/vj OJog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; fh=ofylbV+bzQmJfsy0tRuyz0Yfc9dw4CDRyyw48UzeJ8A=; b=j+sHS5mRe4luvd5a+0S1RZpEWkWyi0Lgi+PT06BRuKn5SA6CbWqNRAfiTJbGvh8QKz Gd71r0G7gOSa7ZyrqIc4Vh/VZYqBJV/AtlMoKGOOO7OEGNgylBsiyGcwDVKNppqgXn4b yQQRC5A5zYuaBDWZ7G1GW4NMRx4QgAi13Xmw9rJTHYCXnHJCOWiVLWgoM5gjUSbYUkhQ ABjoFjBgCYxr9SDHOHIeSf6hG/Gbq7I8SaXx3WqHBpXINQnsz1d6kx1NtCjVnNZJNiLH H4HPncm9b/Wy3M1b91c3hdAxBxzo2fs/csLbhVwuJJtcojmflBXeTu1VGTvuQj9EWRNb YlGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PTe2ZN4f; spf=pass (google.com: domain of linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id d2-20020a1fcd02000000b004b6a3f04e7dsi1667356vkg.301.2023.12.19.09.02.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:02:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PTe2ZN4f; spf=pass (google.com: domain of linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-5621-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 197701C24BEC for ; Tue, 19 Dec 2023 17:02:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0428E37178; Tue, 19 Dec 2023 17:01:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PTe2ZN4f" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41BF620DE0; Tue, 19 Dec 2023 17:01:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-40c60dfa5bfso56957465e9.0; Tue, 19 Dec 2023 09:01:10 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703005269; x=1703610069; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=PTe2ZN4fgiZ06579gZZOQFCsE+SlG3Kij9e/UIQ0/9apXPXF3/qbWInkmFuULsScDJ /Re70XvtGsOHayTMEat3Wug0ZYmpW6viRawc/uYAa8ZCxr0g9h6Zny+N6OD/EZWCyz1G CDB4N3FbQZsOighRD/LmQLQG3g33jn0a3GkY54bkoy6B2KD8VUpeExziEtB7Cdrf0SNC 9oEJ9a5umSP//bXTpGHL5EOuDvJzMYogUrbUYPmXpf6EO7/JNbiftG0vTJST7f71J497 N0vjT0SEQ3ntGASc/R78xhEDmBx6kddHwPBvffBbi3iWYs644/iC9h6UjvCNm2GoFBDf PjFw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703005269; x=1703610069; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uClaQQ2dRjLaUKPRgkZZsqsXWCBLw2oyW3zHKJRRqCQ=; b=bW1Y65SCECURu4e5Hk+Gyu4Qe72iTlumu8XIFwur5D46l4YFU0wj9xUrU3YqNeX/7G r9ioULlKeY/5AtaSQhtkzdXDAzJBtiEW3/bpkndu1NsWYdbA8GgQyBGH7wI7JpDdAv2j KXTWj+lWVXI64WsQ45uonK0hkH/Z3eY/DKHR2QOHV/5lT+Jg32sriJ9LLVSrVCqLgUaX CzEnZScMHhjYXA7W8/QMtFdU61RwHrpC6jSRodQTKCfHQywpIcVBJ+VY7qzNXMW+CTRe E9znlWCIXCEUapxF/1BQyUKBkRZyAFh+shIbS2y9SJ9pD9EFX+RQAs/HN/+QU4XXZLBA bVSg== X-Gm-Message-State: AOJu0Ywh4o0msj5XGWrm1S+alNffA7+NGDrLEC7IKXQ9K221eYWiSOER XzAAPtAltf0vsjZoEqJW3g== X-Received: by 2002:a05:600c:2212:b0:40c:6160:98f7 with SMTP id z18-20020a05600c221200b0040c616098f7mr5158875wml.17.1703005269466; Tue, 19 Dec 2023 09:01:09 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:7ae5:3e:d1c6:a138]) by smtp.gmail.com with ESMTPSA id i7-20020a05600c354700b0040d2805d158sm3225878wmq.48.2023.12.19.09.01.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 09:01:09 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: David Airlie , Daniel Vetter , dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org, Alex Bee , Zheng Yang Subject: [PATCH v3 03/29] drm/rockchip: inno_hdmi: Fix video timing Date: Tue, 19 Dec 2023 18:00:33 +0100 Message-ID: <20231219170100.188800-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231219170100.188800-1-knaerzche@gmail.com> References: <20231219170100.188800-1-knaerzche@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785730561970953323 X-GMAIL-MSGID: 1785730561970953323 The controller wants the difference between *total and *sync_start in the HDMI_VIDEO_EXT_*DELAY registers. Otherwise the signal is very unstable for certain non-VIC modes. See downstream commit [0]. [0] https://github.com/rockchip-linux/kernel/commit/8eb559f2502c Fixes: 412d4ae6b7a5 ("drm/rockchip: hdmi: add Innosilicon HDMI support") Co-developed-by: Zheng Yang Signed-off-by: Zheng Yang Signed-off-by: Alex Bee --- changes in v2: - none changes in v3: - none drivers/gpu/drm/rockchip/inno_hdmi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/rockchip/inno_hdmi.c b/drivers/gpu/drm/rockchip/inno_hdmi.c index 6e5b922a121e..345253e033c5 100644 --- a/drivers/gpu/drm/rockchip/inno_hdmi.c +++ b/drivers/gpu/drm/rockchip/inno_hdmi.c @@ -412,7 +412,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HBLANK_H, (value >> 8) & 0xFF); - value = mode->hsync_start - mode->hdisplay; + value = mode->htotal - mode->hsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_L, value & 0xFF); hdmi_writeb(hdmi, HDMI_VIDEO_EXT_HDELAY_H, (value >> 8) & 0xFF); @@ -427,7 +427,7 @@ static int inno_hdmi_config_video_timing(struct inno_hdmi *hdmi, value = mode->vtotal - mode->vdisplay; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VBLANK, value & 0xFF); - value = mode->vsync_start - mode->vdisplay; + value = mode->vtotal - mode->vsync_start; hdmi_writeb(hdmi, HDMI_VIDEO_EXT_VDELAY, value & 0xFF); value = mode->vsync_end - mode->vsync_start;