Received: by 2002:a05:6a10:8395:0:0:0:0 with SMTP id n21csp795621pxh; Tue, 9 Nov 2021 19:36:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJzPY/hlG1OOnRK724vVtdPWZ90x7U/6oRRnm5g0dEicKWIRf3nRlBWjCxIYcXDEpoLKieAx X-Received: by 2002:a92:9513:: with SMTP id y19mr8831067ilh.300.1636515402659; Tue, 09 Nov 2021 19:36:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1636515402; cv=none; d=google.com; s=arc-20160816; b=HaOisX0sbf5Gdh3q+o7nrJdAKW/PgfPG7adQ8LypjPsQZqGi/ZYX25OyqlWYUd/N68 igO1/Pun97ECaY0g947V9k8FJvxCYbIzyh7L4rNWO2YCoLitej6lEpMj7zjXiGKIy3gC tZwvPePtj+OV1n+IRPjH2jJhhX7mYgF/SlmxLWrasZiQ/1psvuRsz77D0VRFbalGzDDC D5k418tGIxTPzvIR0k7zW6Y1JcAqlPpOMvVSYkUfXPn6Pq29CUxBQnJAdLWBD+Gkkc5b JA3d+g2eaLyCftWGtrplDm3PjXi/cKRT2HYbSMSysPfi3tKCpR16JprqKLvVOLu+wkMn 4YZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=mqoX6tLwcbQp7MXQggGlQSvlQO5+9oHybIyIM1uNZVs=; b=mA7Vxz55IvaavZkjIvpmgspEbdH7F+7mxND1KE0BtuuHjvrqJL+OtPI3ixJNQYGuqu F2K6xJCV4dHjZXy4MVX22vD7gO9X3dWpc8ByBoHKnolRijy63abqKgtGSNJ8+Jw8X7wJ zMJLjqaLKkOgxXdZF75lWuunxwSHs6ssbhfX4nI78Cugpga5mcv1NpVtT8MlK6XhCgYM X5q/wsabZdYfMJJgI4S8vSLh4UgbZ525IvJ7/1Cr/LKrJzCilKJujrJBVkRp1A2ZCcuV D2FpgDcPUqao9sZNG1V+up4ByFvKdLeOC+RRfTXM6yZoQzA8Ikk3ejVQfUPPkdfBByJl 9sSg== 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 t10si42022739ilu.111.2021.11.09.19.36.16; Tue, 09 Nov 2021 19:36:42 -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 S230228AbhKJDgp (ORCPT + 99 others); Tue, 9 Nov 2021 22:36:45 -0500 Received: from twspam01.aspeedtech.com ([211.20.114.71]:32101 "EHLO twspam01.aspeedtech.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229963AbhKJDgo (ORCPT ); Tue, 9 Nov 2021 22:36:44 -0500 Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 1AA39hMY095864; Wed, 10 Nov 2021 11:09:43 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from [192.168.2.115] (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 10 Nov 2021 11:33:01 +0800 Message-ID: Date: Wed, 10 Nov 2021 11:33:02 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.3.0 Subject: Re: [PATCH] media: aspeed: Fix incorrect resolution detected Content-Language: en-US To: Paul Menzel CC: "eajames@linux.ibm.com" , "mchehab@kernel.org" , "joel@jms.id.au" , "andrew@aj.id.au" , "linux-media@vger.kernel.org" , "openbmc@lists.ozlabs.org" , "linux-arm-kernel@lists.infradead.org" , "linux-aspeed@lists.ozlabs.org" , "linux-kernel@vger.kernel.org" References: <20211109095453.12363-1-jammy_huang@aspeedtech.com> From: Jammy Huang In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit 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 1AA39hMY095864 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Dear Paul, On 2021/11/9 下午 07:22, Paul Menzel wrote: > Dear Jammy, > > > Am 09.11.21 um 10:54 schrieb Jammy Huang: >> During the process of os-installation, detected resolution's height >> could be less than the correct one. > Can you please elaborate? What OS? What resolution was and what > resolution should have been detected? My bad. This is the scenario our QA used to find this problem, but it could happen in any scenario with successive timing-change condition. I will update to have a more elaborate message > >> Increase min-required-count of stable signal to fix the problem. > So you do two changes in the patch? First use the bitfield access > macros, and then change VE_MODE_DT_HOR_STABLE and VE_MODE_DT_VER_STABLE > from 6 to 10? Is that the amount of iterations? Why 10 and not 20? > How much time do four iterations add? VE_MODE_DT_HOR_STABLE means the min required count in detecting stable HSYNC signal to set mode detection horizontal signal stable. VE_MODE_DT_VER_STABLE means the min required count in detecting stable VSYNC signal to set mode detection vertical signal stable. How much time these iterations take varies by the input timing. If VE_MODE_DT_VER_STABLE is 10, it means 10 successive stable vsync required to make vertical signal stable flag raised. If the current timing is 60 fps, it will takes at least 10/60 second. The suggested min acceptable value for these two are 3 and max is 15. > Sorry for my ignorance, but if you could make it two patches, that’d be > great. Sure, I will make it two patches in next update. > >> 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); >> } >> > > Kind regards, > > Paul -- Best Regards Jammy