From patchwork Wed Dec 13 19:51:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Bee X-Patchwork-Id: 178280 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:3b04:b0:fb:cd0c:d3e with SMTP id c4csp8030555dys; Wed, 13 Dec 2023 11:52:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IHSSA9jhyBu/sG9B6DoNgD7blZ2fs56r7yIVxts67Rt2Ol3/3VN9xmS7hqU5kfphKAC2w8r X-Received: by 2002:a05:6a20:96db:b0:18f:97c:4f53 with SMTP id hq27-20020a056a2096db00b0018f097c4f53mr4381643pzc.95.1702497137950; Wed, 13 Dec 2023 11:52:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702497137; cv=none; d=google.com; s=arc-20160816; b=lqesjgOUTh+Mfu/GN1HMh6uBdFCZcMrHL+nbPq5pB0nkdXXZEWdC+iWz/m8pwDXVA3 HabGdeZZoIU/fymf1sJ9YI9tsMIRNqJCNT38q8KnRRF8OKd/nqanSboKJXfVmG6fKKum n4lxPvKrWlACL50wFJ9/ZN2hJitwYOHl2ko9hIxymooefzZzGxAdEFGl6KDpQ6uJbUn1 pkJhjN0D+ji9EkfkR2QTndtVvYZQd2AO3kudYwnZ+NvxucYHkw09eaKm3xLzfzdI39GG Whx6NUdVwgUSVcg41yFP3UO2DWkIq68Ek9aFkRg0dshDmFCrJSg1PwBQWV9WCDnW6PCb eIUg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5MfDHxrabIf+gmAYTXlhPOQXkHPRDrfLTxd0p36e6Hg=; fh=3pXLQkDnu6mfL79fDWl5gUQ2rlGZpcfH88MDE/DTze4=; b=PFLeyk8a8yoCLJmovu3T/X+cqBQBWfe2xeOwh+jMTFj4WJFrgSMB19xPEy8XqHAGHZ JyB1MBb6jussYxZI+hddqukNC4bm8WCeP8ajrAnkJsr7QE+zSuihN7AWF86pi95ymsja avtPeNPZt7odzb1h3WW7l5jptWi6Wj0sg+pJ/4R5Smkx8U+gQDE+kv6pi9dAfJ+QSec2 1rX9mIoSctKxDbX17OnhxrxawxiK/jhHfhpGSgbH0b6H9BtrQpRWiN0y1nbOQl7ARD2g 1trcw83SOUpGFOqi+K0+VTJa08TmlsmW6SVCB3vCF0Descz/sJ1zNP3+K6NiM9thTHGJ Yk+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dTDxRp59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id y3-20020a056a001c8300b006ce4050b6b6si9825583pfw.39.2023.12.13.11.52.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:52:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=dTDxRp59; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 90F33802FD35; Wed, 13 Dec 2023 11:51:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1442143AbjLMTvc (ORCPT + 99 others); Wed, 13 Dec 2023 14:51:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233790AbjLMTvX (ORCPT ); Wed, 13 Dec 2023 14:51:23 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6407ECF; Wed, 13 Dec 2023 11:51:30 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id 5b1f17b1804b1-40c2c65e6aaso76177655e9.2; Wed, 13 Dec 2023 11:51:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702497089; x=1703101889; 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=5MfDHxrabIf+gmAYTXlhPOQXkHPRDrfLTxd0p36e6Hg=; b=dTDxRp595qKXYuA9Zogr4UM0eHnKgV9JbcxQPkMxrl2Whq2OJPf0SWdV7BcBhZ9tfN LlQ79JKe8XL4VdfKW/xPpvgKk4pok93lZdJ6KhvqH83gla9qN10aPz6+0GOkqB5XDlEo UbACHYirTU+pu39XU9/8QlarmBjIoa3ohsnPM9DYyoAgNE4JITpgnGS38mON6/QJhuYX wHhdPDSgeuhyb0O5NVIZkoLEK1GrMBqPxozxqj6AleDytKBf/Iqk2tZDoQnzlAdv+0bn hjibvn3rRSQe/rT+2IoAH17JZ2k2i6SLcDunj4dLnY5n9r8oL0PKb7aXZAHECPBCxhmr zggQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702497089; x=1703101889; 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=5MfDHxrabIf+gmAYTXlhPOQXkHPRDrfLTxd0p36e6Hg=; b=Rr/nH0e2yowMyMwhHkenX0ViimtFc6QHKOnC7Qgk2VtJ/uPkVSpsf8/E71hDOj4bcP Sbqkp6Q0x0LRWMN6eeQxOoXYQGKc47DCz+TBFBI68N9IeksTwFjrv3UW7s5wAibaDh0v PY/rWLOeH60pCYxsOIeJppvHoH5VGZELu/OEwmvBKAzUqO8G7mcGhorJ93/pGl2lwAMK lttXuEKp+Zbn6UxP9dcpyzW1SLsCECXSw4AJT8LOAm02KzvW9QTqQCic/JDOePX2gUDd vdR8B4deEdbgKdwtefDYoxLuiF8QnAaJDVzFMCVHS3hP7w4aMOU6k4ZK0OCRsMxk7Agb glIA== X-Gm-Message-State: AOJu0Yyl1A7ekK1lmAuBPEUKo2UWyTTAtc8o7DNrelF9kamy96RgEcdE QmJ/izzt6I8VPyMFG2Ps3A== X-Received: by 2002:a7b:c4d0:0:b0:40c:3272:1fea with SMTP id g16-20020a7bc4d0000000b0040c32721feamr4145598wmk.87.1702497088887; Wed, 13 Dec 2023 11:51:28 -0800 (PST) Received: from U4.lan ([2a02:810b:f40:4300:92dc:8b1c:e01c:b93c]) by smtp.gmail.com with ESMTPSA id fm14-20020a05600c0c0e00b00407b93d8085sm24050698wmb.27.2023.12.13.11.51.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 11:51:28 -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 03/11] drm/rockchip: inno_hdmi: Fix video timing Date: Wed, 13 Dec 2023 20:51:17 +0100 Message-ID: <20231213195125.212923-4-knaerzche@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20231213195125.212923-1-knaerzche@gmail.com> References: <20231213195125.212923-1-knaerzche@gmail.com> MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 11:51:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1785197638967772592 X-GMAIL-MSGID: 1785197638967772592 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 --- 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;