Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp549013ybz; Fri, 24 Apr 2020 05:14:08 -0700 (PDT) X-Google-Smtp-Source: APiQypLE+3EOdD3jb91b3krzKDlcetcGB7YaDg1AoHMRw4EO5/dAk59KKc0+5F6vc0cJW/clBHW4 X-Received: by 2002:a50:9d42:: with SMTP id j2mr6773279edk.249.1587730448071; Fri, 24 Apr 2020 05:14:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587730448; cv=none; d=google.com; s=arc-20160816; b=B7lDeALx6Tz2erFjccJSRoqCuodc2jeAV8bvmriJHJxHjKBGcKvUpzg6b3tJH9dJsn 1XmKs49ua77YVoBbn5vTH6E2CcsVH0d+xyTz3Svhi1eBtXJjMVgFW3m6hxlEG1AwyoaB L9/NTgVXaYZyxI20W5E/MCYXPPO7ceCb2gsmD71w2gJotepbZbbE1IZ6Mu92qE4xrFcl TtWc+lYxir9B6GwBECdMHuHdXlOV/krGKBaZpVBZbc09z294eq0ouXvuUMHvgjG00wjz wmHsn7uXpznHqYbZ9iUZASye4tA2uFvxt4yS81Irl8bg9Pywc2hYGlfh9CoiCDL4T3pq U/1g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=h0z5ld1WSv+uCtbs/DgylXlcT9i3DCsdVOPXc/hPY7o=; b=pD9K+ILlvnKIl9IM7BA3H3I0LtUxbBFcJiGj2hLZV24l10duybBMaj+ByneSpvfNam ++PdX/uGwr0kgEfGezRoCFqJ2W+44KNIcqxbrn7RK/WAAhNIEebXIt/IY95PHZtUULTH zz/4tgLJArJCv+Q46vV+uolxXkgbOmnRx0cebvsgLNUYaFaDtm3qAuihVJ/C6kr0EgEa gwIyOnUE1k76PujBGE20l1pO8/YxNerVqHDKCGeZLhT40Fib2d2rBvDn/oz3T1lP7AWA 2O0MuIfY8HSHfeGi9/hY5AenC2dTNrF7YLxwYJvGuEWhRFvLjrn3ZGBjIsu656LHm92q WFvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="hwQepM/b"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si2780289ejd.448.2020.04.24.05.13.44; Fri, 24 Apr 2020 05:14:08 -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=@chromium.org header.s=google header.b="hwQepM/b"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726908AbgDXMMR (ORCPT + 99 others); Fri, 24 Apr 2020 08:12:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49196 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbgDXMMQ (ORCPT ); Fri, 24 Apr 2020 08:12:16 -0400 Received: from mail-ua1-x943.google.com (mail-ua1-x943.google.com [IPv6:2607:f8b0:4864:20::943]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9B625C09B045 for ; Fri, 24 Apr 2020 05:12:16 -0700 (PDT) Received: by mail-ua1-x943.google.com with SMTP id 36so5081481uaf.9 for ; Fri, 24 Apr 2020 05:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=h0z5ld1WSv+uCtbs/DgylXlcT9i3DCsdVOPXc/hPY7o=; b=hwQepM/bXpUDZkqdGyGGTFFGFNmGx+VGOU1xAn2w6kWh7TpIs1TVzUvC7Y8WfV5Avv eBW9GDKE1srlE8pjEXdpZU4tXNiz4H7u5pefQcy0FulLXzcxvs79P05uhucqMfCVMQYQ 7XujRwL1+db0Xik9NlNhqzowuqaVg69dHl2J8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=h0z5ld1WSv+uCtbs/DgylXlcT9i3DCsdVOPXc/hPY7o=; b=OMxlyFhXMZlydlOjy7VDfOHfkh87HjkhUzQP3UX5rxm66PzGTHB3ML+aTPlt0/e4zD 23h1WFYRGZmTLpSpWu2LUeWcFfOrTN2YUrCTbjJeG39YpxAplZXhbkNPkqWnEcPVqXSg /IH5NOHuyxDV7nFUnHTXNjHa6p+6j7zZA7JyCZckPYbq1d0GLL5A2aTACmD1QeFButB2 Bpx9lrzkk2Tb9mxERHeYTDM5Mz/mEcu+gwXvGnZmrMGuc5u9sDdoab2hyqKb2LuQVrLI oDpk9CeKQfht1EDyEYiW8KIDmZAwq9sMCxvUJKQeM+JN/HLXPJ5nqjP5gRc4eGGMyFER Mscw== X-Gm-Message-State: AGi0PuaKj3+83KWRv2JDJJYq2b2p7ObE/xHXY+62vB1kq7T3ACfDg2rJ hAT/z7M84MinhD/NMmW2AZCEeaKU+7ibkhPJumCEeQ== X-Received: by 2002:a05:6102:308b:: with SMTP id l11mr6943000vsb.14.1587730335778; Fri, 24 Apr 2020 05:12:15 -0700 (PDT) MIME-Version: 1.0 References: <20200424065124.GA31922@xin-VirtualBox> In-Reply-To: <20200424065124.GA31922@xin-VirtualBox> From: Nicolas Boichat Date: Fri, 24 Apr 2020 20:12:04 +0800 Message-ID: Subject: Re: [PATCH v7 2/2] drm/bridge: anx7625: Add anx7625 MIPI DSI/DPI to DP bridge driver To: Xin Ji Cc: devel@driverdev.osuosl.org, Laurent Pinchart , Dan Carpenter , Andrzej Hajda , Neil Armstrong , Jonas Karlman , Jernej Skrabec , David Airlie , Daniel Vetter , lkml , dri-devel , Pi-Hsun Shih , Sheng Pan Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.