Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp306390pxh; Tue, 9 Nov 2021 11:01:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJxrSuqYQvHuJnepqtymiqIibjj1EHjrixIOooe2UAF2q33+J8E2awjF5eZGPC+J4TRoq4ax X-Received: by 2002:a17:907:3f83:: with SMTP id hr3mr12672576ejc.555.1636484477522; Tue, 09 Nov 2021 11:01:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636484477; cv=none; d=google.com; s=arc-20160816; b=ru1vNFn/5Jbvr8RBC1+ljm961znP9kBklCTnk//RReQacCTovHzRgjTIOkpCXqyWQj hiT+N4Hp8Ul1aU1FvKjNIHQTgzk7BUlM6e90HXy5a4v5ClSzzdJX/kFdZTNT4uyAWqbN 0ba9Bgve3TC7fIbzk+nhTpqKWoUuZRS7XDBK2veMO6dHzK5CaYqZ/I/bBumeYLAjKlUE ZldQ9msz5QQz4AqPuxfeErc2FgMlk5pjUE/HJyEsmagbmM/IITM7SInDXxDaBgC8OZmb 13RnnRrrJ4/ayrgr4pqGZqOhfT3RIj5hNkok5MMpFMnJaBk1WVTm7Q8cs6I65UB6nmQi OhRg== 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 :message-id:date:subject:to:from; bh=rfWBcrl93LmOTCADyUc5B7Jc5eWtq6rB1r2EfW3lgEE=; b=bU4eeJZRWoeS7+ZPt9a5Bir0Fop93yYF9Ny3vaqVy3On5/mA/Tyf8Ay0WTQpWPiLUS ftpvgvoisPBhEU6MltXsJtA4fOodTsmjnILKbGektdW8JHbaItLpWHzpq3+Fn0Cuyli8 Py+dpVPEReGi5lIHBZrFX58KCyB7dq+lU69Mu6whu7g4m7SWA+oveeuKzwONuTh1Vs6C wkhmtF5RXGa7DI0rGb2J5aycyL7DokhLD01H08AZm5/UkBU92W63CPz9Ybf+f+gHTx4P DWXcuKV7Hpnl3RYHQL4RDfWbusIyEhBCvTiPbUHf/siNcuLsy+AQ4NSbmKUdXf75F+B2 VKag== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si34008765ejb.4.2021.11.09.11.00.48; Tue, 09 Nov 2021 11:01:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243025AbhKIJ5j (ORCPT + 99 others); Tue, 9 Nov 2021 04:57:39 -0500 Received: from twspam01.aspeedtech.com ([211.20.114.71]:47369 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241704AbhKIJ5i (ORCPT ); Tue, 9 Nov 2021 04:57:38 -0500 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 1A99VZMQ096262; Tue, 9 Nov 2021 17:31:35 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from JammyHuang-PC.aspeed.com (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Tue, 9 Nov 2021 17:54:50 +0800 From: Jammy Huang To: , , , , , , , , Subject: [PATCH] media: aspeed: Fix incorrect resolution detected Date: Tue, 9 Nov 2021 17:54:53 +0800 Message-ID: <20211109095453.12363-1-jammy_huang@aspeedtech.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 1A99VZMQ096262 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org During the process of os-installation, detected resolution's height could be less than the correct one. Increase min-required-count of stable signal to fix the problem. Fixes: d2b4387f3bdf ("media: platform: Add Aspeed Video Engine driver") Signed-off-by: Jammy Huang --- drivers/media/platform/aspeed-video.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/media/platform/aspeed-video.c b/drivers/media/platform/aspeed-video.c index 5da52646b298..625a77ddb479 100644 --- a/drivers/media/platform/aspeed-video.c +++ b/drivers/media/platform/aspeed-video.c @@ -196,6 +196,12 @@ #define VE_INTERRUPT_VSYNC_DESC BIT(11) #define VE_MODE_DETECT 0x30c +#define VE_MODE_DT_HOR_TOLER GENMASK(31, 28) +#define VE_MODE_DT_VER_TOLER GENMASK(27, 24) +#define VE_MODE_DT_HOR_STABLE GENMASK(23, 20) +#define VE_MODE_DT_VER_STABLE GENMASK(19, 16) +#define VE_MODE_DT_EDG_THROD GENMASK(15, 8) + #define VE_MEM_RESTRICT_START 0x310 #define VE_MEM_RESTRICT_END 0x314 @@ -1199,7 +1205,12 @@ static void aspeed_video_init_regs(struct aspeed_video *video) aspeed_video_write(video, VE_SCALING_FILTER3, 0x00200000); /* Set mode detection defaults */ - aspeed_video_write(video, VE_MODE_DETECT, 0x22666500); + aspeed_video_write(video, VE_MODE_DETECT, + FIELD_PREP(VE_MODE_DT_HOR_TOLER, 2) | + FIELD_PREP(VE_MODE_DT_VER_TOLER, 2) | + FIELD_PREP(VE_MODE_DT_HOR_STABLE, 10) | + FIELD_PREP(VE_MODE_DT_VER_STABLE, 10) | + FIELD_PREP(VE_MODE_DT_EDG_THROD, 0x65)); aspeed_video_write(video, VE_BCD_CTRL, 0); } -- 2.25.1