Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp1850848ybz; Thu, 30 Apr 2020 06:39:20 -0700 (PDT) X-Google-Smtp-Source: APiQypKF+61BiUd1PHmFY1Ihqu1ZwkU+lg7qEjng2D+T5NqgRQ8VauP9crIswz3JLjhiUX0bJ5Vq X-Received: by 2002:aa7:d342:: with SMTP id m2mr2705906edr.130.1588253960604; Thu, 30 Apr 2020 06:39:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588253960; cv=none; d=google.com; s=arc-20160816; b=B8A0nFYO9jL0vALmti1zfvO1C+JjejrzmkZZqW/fvlgVWi2oE1GRJcvC8w/8vSIRJb 4a7c+W7g8VVcWWJE94p6kk60CbnqxUXdQYRtW8eX3UMABMXbVM97onh2vfP6YGzEvPl1 hzGktNc8PN+o1bDo3tDCWfhGnb2rKPv7r0HMubi7ZOuEOn1DhkiWKe0Hw/2Y5ZRyzVqu 4a2DbVu0+XmGLF9fXJ5B+4GW15wDC4TcQLOq2HyCtAOtopqHK1lJewuh19rWa3L5Vla6 mxZ+lq1SAso/AqqhPv70C8EeeIxZDJVP2GmoTN4P9Mc/JR1XGhJBuFzmsFiwnC03yvE0 Q9oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:mail-followup-to:message-id:subject:cc:to :from:date:dkim-signature; bh=cIp9DbU+6rRfiPbG8uAVaJPBU9twoue+ADTvawohLJ4=; b=fjRhX7IIjgXGI6OAQGT6LuHbkOvyubUC2nTzgVz9LExgs/WmR7AsBey/a1jFxP4EVH uMU8/pVFe04oNWbXhBFJZMuaI0girCcrkzfM/Bvcwk4nHMxzmbX+RtjWjgmyhTLIgNnl vStTbkQkTh/rzXHFGE6hvIAFqu3l5vLLSJbs//vjp0ohlkR5bsVUAHVizKaUjJoQaRFh DiPKtk6yKD7Fn2k0rpwZDNBMJw91wLBWtp6Xtnaf3/lXppUwe+PeBKbPI6UoaFdz4maa UuZHU0YTxTVtaS7EpJt/wYy0vSlKNFa39e3Rl58DG+Ylt3iAE9dGDCeJ1qXXWFrSZvTj hD7A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=AUQMg9Bf; 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 v10si5303667edl.365.2020.04.30.06.38.57; Thu, 30 Apr 2020 06:39:20 -0700 (PDT) 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; dkim=pass header.i=@ffwll.ch header.s=google header.b=AUQMg9Bf; 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 S1726906AbgD3Nhl (ORCPT + 99 others); Thu, 30 Apr 2020 09:37:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726577AbgD3Nhl (ORCPT ); Thu, 30 Apr 2020 09:37:41 -0400 Received: from mail-wr1-x444.google.com (mail-wr1-x444.google.com [IPv6:2a00:1450:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDC2FC035494 for ; Thu, 30 Apr 2020 06:37:40 -0700 (PDT) Received: by mail-wr1-x444.google.com with SMTP id g13so6926582wrb.8 for ; Thu, 30 Apr 2020 06:37:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=cIp9DbU+6rRfiPbG8uAVaJPBU9twoue+ADTvawohLJ4=; b=AUQMg9Bfr7hBR51Z28J9x9t2Irvw2vW5PyG4R/MxI6yDPK6/b/N3PFe0ZbPEv/oNXD MX/9JYqZK8jR0AvdRC6mo7BRI2JjjnAX3A4N7FC2xazulqlbx3GfSuQFUyJZhPZ12dNt UQTEgyH586iFrg6yerVwQymf3ZQWBP7qFMeTs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=cIp9DbU+6rRfiPbG8uAVaJPBU9twoue+ADTvawohLJ4=; b=gATfWVpwsKt6WtpbGRnBJfAbH9FkepGMIgHDiu12Gz56c5oKS5pZm/I8jcq59Q9u2G qkKDOIoFbVY+Y0QolzycMSJ0x+I6/58EsuJSHDv77UfCVOktdOY+OkwtIkYjc6RgS728 KCP5Zn0l4FIwodqOd+zyciQOUM74U75JJOEqu5wI3hu1F9J/dOCSxdP06RHymQWCM4g1 Pqa5HNbqpThUqEx7T2UenqWZ9p1CkO+uZppFamnG7NA1eaY+qRf86beQc79FXno5Cjoe iUL4i0KdpcnFmLCW6+ezPD/7KhtASEyHPb80CuXPdFU0JenvxiGxow7TrZ6AN2JDjOJ+ Ezzg== X-Gm-Message-State: AGi0PubeqcIn8O2Q4YI+GyihN3FTvFqqiW6tbw8jsCEwXg6nNe3kYutL 0PhLRwPKC1HPGz3X5YMF/QI/FQ== X-Received: by 2002:adf:df8d:: with SMTP id z13mr4003100wrl.304.1588253859692; Thu, 30 Apr 2020 06:37:39 -0700 (PDT) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id o3sm4146326wru.68.2020.04.30.06.37.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Apr 2020 06:37:38 -0700 (PDT) Date: Thu, 30 Apr 2020 15:37:31 +0200 From: Daniel Vetter To: Xin Ji Cc: Daniel Vetter , Nicolas Boichat , devel@driverdev.osuosl.org, Laurent Pinchart , Dan Carpenter , Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Pi-Hsun Shih , Sheng Pan , Qilin Wen , Ming Liu Subject: Re: [PATCH v7 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver Message-ID: <20200430133731.GA10381@phenom.ffwll.local> Mail-Followup-To: Xin Ji , Nicolas Boichat , devel@driverdev.osuosl.org, Laurent Pinchart , Dan Carpenter , Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , David Airlie , linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, Pi-Hsun Shih , Sheng Pan , Qilin Wen , Ming Liu References: <20200424065124.GA31922@xin-VirtualBox> <20200428100508.GD3456981@phenom.ffwll.local> <20200430033614.GA6645@xin-VirtualBox> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200430033614.GA6645@xin-VirtualBox> X-Operating-System: Linux phenom 5.4.0-4-amd64 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 30, 2020 at 11:36:14AM +0800, Xin Ji wrote: > On Tue, Apr 28, 2020 at 12:05:08PM +0200, Daniel Vetter wrote: > > On Fri, Apr 24, 2020 at 08:12:04PM +0800, Nicolas Boichat wrote: > > > On Fri, Apr 24, 2020 at 2:51 PM Xin Ji wrote: > > > > > > > > On Thu, Apr 23, 2020 at 07:55:15PM +0800, Nicolas Boichat wrote: > > > > > Hi, > > > > > > > > > > Just commenting on the mode_fixup function that was added in v7. > > > > > > > > > [snip] > > > > > > + /* > > > > > > + * once illegal timing detected, use default HFP, HSYNC, HBP > > > > > > + */ > > > > > > + if (hblanking < HBLANKING_MIN || (hfp < HP_MIN && hbp < HP_MIN)) { > > > > > > > > > > should this be adj_hblanking/adj_hfp/adj_hbp? > > > > NO, need check original HFP and HBP, if they are not legal, driver need > > > > set default value to adj_hsync, adj_hfp, adj_hbp. > > > > > > > > > > > + adj_hsync = SYNC_LEN_DEF; > > > > > > + adj_hfp = HFP_HBP_DEF; > > > > > > + adj_hbp = HFP_HBP_DEF; > > > > > > + vref = adj->clock * 1000 / (adj->htotal * adj->vtotal); > > > > > > + if (hblanking < HBLANKING_MIN) { > > > > > > + delta_adj = HBLANKING_MIN - hblanking; > > > > > > + adj_clock = vref * delta_adj * adj->vtotal; > > > > > > + adj->clock += DIV_ROUND_UP(adj_clock, 1000); > > > > > > + } else { > > > > > > + delta_adj = hblanking - HBLANKING_MIN; > > > > > > + adj_clock = vref * delta_adj * adj->vtotal; > > > > > > + adj->clock -= DIV_ROUND_UP(adj_clock, 1000); > > > > > > + } > > > > > > + > > > > > > + DRM_WARN("illegal hblanking timing, use default.\n"); > > > > > > + DRM_WARN("hfp(%d),hbp(%d),hsync(%d).\n", hfp, hbp, hsync); > > > > > > > > > > How likely is it that this mode is going to work? Can you just return > > > > > false here to reject the mode? > > > > We want to set the default minimal Hblancking value, then it may display, > > > > otherwise. If we just return false, there is no display for sure. > > > > > > Right, understand your argument. I'm pondering if it's not just better > > > to reject the mode rather than trying a timing that is definitely > > > quite different from what the monitor was asking for. No super strong > > > opinion, I'll let other people on the list weigh in. > > > > Yeah mode_fixup is supposed to be used to adjust the mode in intermediate > > stages (e.g. if you go from progressive to interlaced only at the end of > > your pipeline or something like that). It's not meant for adjusting the > > mode yout actually put out through a hdmi or dp connector. For fixed > > panels adjusting modes to fit the panel is also fairly common, but not for > > external outputs. > > > > Since this is a DP bridge I'd say no adjusting, just reject what doesn't > > fit. > We have found some panel which HBP less than 8, if we reject to adjust > video timing, then there is no display. The customer does not accept it, > they push us to fix it, the only resolve way is to adjust timing. Are we talking about external DP screen here, or some built-in panel? For the later case we do a lot of mode adjusting in many drivers ... I haven't checked, by if our connector type is eDP then this should be all fine. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch