From patchwork Sat Dec 16 16:26:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 179870 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:24d3:b0:fb:cd0c:d3e with SMTP id r19csp313605dyi; Sat, 16 Dec 2023 08:29:15 -0800 (PST) X-Google-Smtp-Source: AGHT+IGAL8J42S91jExCHz/KE7uVaU45FVdHAFvdhbNE3v2wtw8q0cZQSfpiYh2winBsEXP5dxc1 X-Received: by 2002:a7b:c8c2:0:b0:40c:279d:31a3 with SMTP id f2-20020a7bc8c2000000b0040c279d31a3mr6983971wml.176.1702744154953; Sat, 16 Dec 2023 08:29:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702744154; cv=none; d=google.com; s=arc-20160816; b=Y4lqHAljzpte4R8Pbr5vqEXQbj5K6WwXseU2x9FbcBoJmuzscoa3xlhKnVV33YFlMS UvaBPD2Q6E40XrxXwlw5jmRaO2j5WQlbMcUjYdsLAIlirdQwVIs0u/6Po9lLRQOhu1qj AxrU+kNSgi1qqJDEjSZMgJYo0lyYMATvjBhhJQoYYi65pFSv006fCTrj3n9bbmlZFR9D 0UWZfB8yMp8lJARrs/EmSNLXQCw5pYPvMzMB8OD2Z7azR/M+dppqGB6fNDCuuferSOA7 U/h2yr5OccBQxEiRs0K5W6QjLAdcRzgG2f5KCZbE4B4M4lnUI5vUEwIwuoMCb64HzziP B2Hw== 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=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; fh=3pXLQkDnu6mfL79fDWl5gUQ2rlGZpcfH88MDE/DTze4=; b=VRUqMrSFVmyeB5azGu7ppXbzzYm3UauDrciKWtKIiGtdhl13/WEdtM8ZO6N44sAEyz wXdltQ3IIqwBmYsUCJUSimt1Qx+tyDh5uMQ5psYdHxxGQzkFYmsJ/FeigdFhKac24KNx AzGFhnvIYizWu6keBC1wla29BynysOQzjb4LpbU4iwJZ6Fge4FPl+HZTzA7vlO2N2C6+ bdLNVtWSYuQMBPDFPbsFKX6km9Xwwub4FGgiDEnqtbKAJ58Es0wOy2fQ/e2mXQrJ9sna DKMjjZLC12XBFmXyA5y5nz34xeEQkjAWxmgSY1fRxOAM6q4TXHDFhczKzbmLz26DQuS6 a8IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MTLyyQTy; spf=pass (google.com: domain of linux-kernel+bounces-2252-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2252-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ka8-20020a170907990800b00a230f36ad7dsi2616777ejc.54.2023.12.16.08.29.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:29:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-2252-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=MTLyyQTy; spf=pass (google.com: domain of linux-kernel+bounces-2252-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-2252-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 904641F237C8 for ; Sat, 16 Dec 2023 16:29:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 25F7033CDC; Sat, 16 Dec 2023 16:27:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MTLyyQTy" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) (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 90DB230D1B; Sat, 16 Dec 2023 16:27:09 +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-ed1-f53.google.com with SMTP id 4fb4d7f45d1cf-54c7744a93fso2051734a12.2; Sat, 16 Dec 2023 08:27:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702744028; x=1703348828; 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=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; b=MTLyyQTyFUzMRpweOwN2a4P2t6HZlLsvqYYCzfi5ACj/FoJB7OPE/VxNKS1i5I1N7b UW3wpFOkZXX4uKUEhIMBuosEDvUZEKYA73lEESiZQy709pH1UAtjyT9bb6QVJv1MGmZL t3fPSVS6DJ4bJCSgFWvJ4vO5tTrVbDAeQ5lA+MJLGCmLfMatZ39zu//YbXMR5QAV2oga TbNw3EWQCsjReb0xOJpA9lZVjtGdHVZ5W98IDKxWeZpJ/TskKJWEprcWNUHBEXfPiC2T 5pl52dxrovT/7ZkgfEUFguRGimXLs5iMAmcx1Pza0sGv3asdSjpRQt5AuIST/6lWnwlb JbyQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702744028; x=1703348828; 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=qyAWfNkXQL+v/gZSDlmmFF5ztG5yHb26ZkJxvxzB8Hc=; b=D2HDZ5F9xsi9ODeoGbuJuUcMpFXwDBa9XeSuFZXAAXFElI+JFWeME1aE5/HlWlrAOp tZpxl4ch/3ibwGywpb4gYlKqxLUlXzUFtkIhnaPagqtQSpYrg4XB0NSbBbs1BCx0Y/ZV nY6UR9UPCITb1eUWiBki9GyQ+eVbEa2F8K8I70InlxtOSV2oUkMmjoVRZvnm9KFFwE/B NJhavkr/4dNxGUc92F6XxtJdKCgObznpzpLZqr7B6y0Ue7ZtjWOZBS0fGIp8ZcLryAwM HUflKt7OFmsenPO2rD303zKet0aHlHI8FFZzsrdY3+3mJoYlSueBV03FRRb+HKg4p0Jh gujw== X-Gm-Message-State: AOJu0Yx3s3lFrHjkV6ROrWeAphS6T0TYitsuVrfWyMHKnKd0oF1Z584N 2xh6gpsD9Y8rRiUsdb2xYg== X-Received: by 2002:a17:906:6a1d:b0:9c2:2d0a:320c with SMTP id qw29-20020a1709066a1d00b009c22d0a320cmr8522242ejc.46.1702744027873; Sat, 16 Dec 2023 08:27:07 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:e807:d345:6f47:1db9]) by smtp.gmail.com with ESMTPSA id st10-20020a170907c08a00b00a1cd0794696sm11990362ejc.53.2023.12.16.08.27.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 16 Dec 2023 08:27:07 -0800 (PST) From: Alex Bee To: Sandy Huang , =?utf-8?q?Heiko_St=C3=BCbner?= , Andy Yan , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann Cc: David Airlie , Daniel Vetter , 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 v2 03/27] drm/rockchip: inno_hdmi: Fix video timing Date: Sat, 16 Dec 2023 17:26:14 +0100 Message-ID: <20231216162639.125215-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231216162639.125215-1-knaerzche@gmail.com> References: <20231216162639.125215-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: 1785456654782600542 X-GMAIL-MSGID: 1785456654782600542 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 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;