Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp1838776pxf; Fri, 26 Mar 2021 16:53:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzi7KuzlXP/ZECHNePZTKJkd1RJZlmzLU7ygE5LCLlZN4Ph0wPwx/4+bgT2Pz5N5FAQNGaW X-Received: by 2002:a05:6402:1393:: with SMTP id b19mr17658473edv.333.1616802827633; Fri, 26 Mar 2021 16:53:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616802827; cv=none; d=google.com; s=arc-20160816; b=yOFk0XZFpeUdK2cWeY2YQx9pspPq9/ApDtkWU7XF3pFuekRppZj+aH1vo0zH+2+czF 0weCxUIyQzg5YomDWb7Ei/LjCJhhmTO8DLm+KuC7/mmTHjq0DSiHsVBzjZZWEU0bYcdl oqt8u58/7BayPjzMOiUtQqreNWCyVH1R7H26Ar7O7AZOTZKYCEV344tAVfoyROeU6inv cf7tqYhnCvg+hFEIb4tXvoFS1XksIibKLQKDqUFpF9v+XaFPSdJQCoWfydhmHxdF/REN 2BBUidHY9aQBExVWert6REhwT87tJgUdl9MUSiYbTiTo159yEnL2Xv+ji50P3RlpS/kb tbIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=rXDnlo584TT3XdqSCmG1a4KCuTtOeikSfIe+ga6FWZY=; b=hncOMhRYnC83MExDbN1h63xPqE7gSMXUPHmAe1uzaRxbEJYJZfrp1qbrXSsOMLfQHl LmMLLkusfJl2xTCFvKWJ84k3oduFwARKSzt/1N4UTc8rXaMp85ifKZB0/Q8+rj4gt73v pa0t5gNqc4wcn4PmfCyUn2BRvBiQbPEJQBtsIx4bi+GiJTVnrEZc/OXQPM0t1xOCEHyg 0kaMVHFEtEouJyJgxXFlYjlYtkzzaXp9bZ04z8nYbihURNFUS0vBGHtCk2iG+dpSeGkA k2d2iPYfDGVA06WsfU2OrA7Pk5tqo8loLzm5eTHhJM0EvlN2rF3BXr5w7NyoK7O6xfKy fsMQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=onFYtCyV; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k19si7586730eja.265.2021.03.26.16.53.24; Fri, 26 Mar 2021 16:53:47 -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=@kernel.org header.s=k20201202 header.b=onFYtCyV; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230512AbhCZXsd (ORCPT + 99 others); Fri, 26 Mar 2021 19:48:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:51758 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229969AbhCZXsY (ORCPT ); Fri, 26 Mar 2021 19:48:24 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 468AD619E5; Fri, 26 Mar 2021 23:48:24 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1616802504; bh=HL4n+BnM9gvNqp6e7ow2lvqRI0UoGPH0Nc8z3H9uRKc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=onFYtCyVx5sjJRmYNlhDjmuAWyrV+iGtpQi0yAkmlhfdFPSGH3gbHLp698ay2lRAx UX0m3n5oyaKtQjLBZxC8S2Cp6y8AEKs57DuWkyiBCRLcfp+dZrwYMP4DdJU5Ur6ziK JqAizNpNIAFhsogRH20cMDrKwziiL70TMc3x1mcgZ9txXIjQO6pQLq+mmdHvyhdynu qsRH7a3uLanOAeVFHHc5HaWXcgkhUB/hMaQyzBj6tWmySJiwHKFxjx6z7m5kKNPo3B dwEHRmd3MgwJ8W7L/azUXk6GEaFV4E4CeS/vuZDCYQ+bUUNQDJznwalzpVyWO8qnde bN3+ueoqk1j8Q== Received: by mail-qv1-f46.google.com with SMTP id t16so3792183qvr.12; Fri, 26 Mar 2021 16:48:24 -0700 (PDT) X-Gm-Message-State: AOAM532bipkb8sG2UhGzv2YGwjtOERqoRC2ieYY3LMGg7Cq/OE+9ILcd Lh/gkwtH6a3WzcmeG5zLF3wR2GpDkDNj3yA4ZA== X-Received: by 2002:a0c:a5a5:: with SMTP id z34mr16052242qvz.4.1616802503249; Fri, 26 Mar 2021 16:48:23 -0700 (PDT) MIME-Version: 1.0 References: <20210316140707.RFC.1.I3a21995726282f1e9fcb70da5eb96f19ed96634f@changeid> In-Reply-To: From: Rob Herring Date: Fri, 26 Mar 2021 17:48:11 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH 1/3] dt-bindings: display: simple: Add the panel on sc7180-trogdor-pompom To: Rob Clark Cc: Thierry Reding , Matthias Kaehlcke , Douglas Anderson , Rob Clark , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , Nicolas Boichat , David Airlie , linux-arm-msm , Andy Gross , dri-devel , Bjorn Andersson , Steev Klimaszewski , Stephen Boyd , Sam Ravnborg , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Mar 26, 2021 at 4:13 PM Rob Clark wrote: > > On Fri, Mar 26, 2021 at 12:48 PM Rob Herring wrote: > > > > On Fri, Mar 26, 2021 at 9:20 AM Rob Clark wrote: > > > > > > On Fri, Mar 26, 2021 at 8:18 AM Rob Clark wrote: > > > > > > > > On Fri, Mar 26, 2021 at 5:38 AM Thierry Reding wrote: > > > > > > > > > > On Wed, Mar 17, 2021 at 06:53:04PM -0700, Rob Clark wrote: > > > > > > On Wed, Mar 17, 2021 at 4:27 PM Matthias Kaehlcke wrote: > > > > > > > > > > > > > > On Tue, Mar 16, 2021 at 02:08:19PM -0700, Douglas Anderson wrote: > > > > > > > > The sc7180-trogdor-pompom board might be attached to any number of a > > > > > > > > pile of eDP panels. At the moment I'm told that the list might include: > > > > > > > > - KD KD116N21-30NV-A010 > > > > > > > > - KD KD116N09-30NH-A016 > > > > > > > > - Starry 2081116HHD028001-51D > > > > > > > > - Sharp LQ116M1JW10 > > > > > > > > > > > > > > > > It should be noted that while the EDID programmed in the first 3 > > > > > > > > panels indicates that they should run with exactly the same timing (to > > > > > > > > keep things simple), the 4th panel not only needs different timing but > > > > > > > > has a different resolution. > > > > > > > > > > > > > > > > As is true in general with eDP panels, we can figure out which panel > > > > > > > > we have and all the info needed to drive its pixel clock by reading > > > > > > > > the EDID. However, we can do this only after we've powered the panel > > > > > > > > on. Powering on the panels requires following the timing diagram in > > > > > > > > each panel's datasheet which specifies delays between certain > > > > > > > > actions. This means that, while we can be quite dynamic about handling > > > > > > > > things we can't just totally skip out on describing the panel like we > > > > > > > > could do if it was connected to an external-facing DP port. > > > > > > > > > > > > > > > > While the different panels have slightly different delays, it's > > > > > > > > possible to come up with a set of unified delays that will work on all > > > > > > > > the panels. From reading the datasheets: > > > > > > > > * KD KD116N21-30NV-A010 and KD KD116N09-30NH-A016 > > > > > > > > - HPD absent delay: 200 ms > > > > > > > > - Unprepare delay: 150 ms (datasheet is confusing, might be 500 ms) > > > > > > > > * Starry 2081116HHD028001-51D > > > > > > > > - HPD absent delay: 100 ms > > > > > > > > - Enable delay: (link training done till enable BL): 200 ms > > > > > > > > - Unprepare delay: 500 ms > > > > > > > > * Sharp LQ116M1JW10 > > > > > > > > - HPD absent delay: 200 ms > > > > > > > > - Unprepare delay: 500 ms > > > > > > > > - Prepare to enable delay (power on till backlight): 100 ms > > > > > > > > > > > > > > > > Unified: > > > > > > > > - HPD absent delay: 200 ms > > > > > > > > - Unprepare delay: 500 ms > > > > > > > > - Enable delay: 200 ms > > > > > > > > > > > > > > > > NOTE: in theory the only thing that we _really_ need unity on is the > > > > > > > > "HPD absent delay" since once the panel asserts HPD we can read the > > > > > > > > EDID and could make per-panel decisions if we wanted. > > > > > > > > > > > > > > > > Let's create a definition of "a panel that can be attached to pompom" > > > > > > > > as a panel that provides a valid EDID and can work with the standard > > > > > > > > pompom power sequencing. If more panels are later attached to pompom > > > > > > > > then it's fine as long as they work in a compatible way. > > > > > > > > > > > > > > > > One might ask why we can't just use a generic string here and provide > > > > > > > > the timings directly in the device tree file. As I understand it, > > > > > > > > trying to describe generic power sequencing in the device tree is > > > > > > > > frowned upon and the one instance (SD/MMC) is regarded as a mistake > > > > > > > > that shouldn't be repeated. Specifying a power sequence per board (or > > > > > > > > per board class) feels like a reasonable compromise. We're not trying > > > > > > > > to define fully generic power sequence bindings but we can also take > > > > > > > > advantage of the semi-probable properties of the attached device. > > > > > > > > > > > > > > > > NOTE: I believe that past instances of supporting this type of thing > > > > > > > > have used the "white lie" approach. One representative panel was > > > > > > > > listed in the device tree. The power sequencings of this > > > > > > > > representative panel were OK to use across all panels that might be > > > > > > > > attached and other differences were handled by EDID. This patch > > > > > > > > attempts to set a new precedent and avoid the need for the white lie. > > > > > > > > > > > > > > > > Signed-off-by: Douglas Anderson > > > > > > > > --- > > > > > > > > > > > > > > Sounds reasonable to me if DT maintainers can live with this abstract > > > > > > > hardware definition. It's clearer than the 'white lie' approach. > > > > > > > > > > > > Yeah, it is a weird grey area between "discoverable" and "not > > > > > > discoverable".. but I favor DT reflecting reality as much as > > > > > > possible/feasible, so I think this is definity cleaner than "white > > > > > > lies" > > > > > > > > > > This is practically no different than the "white lie". I suppose you > > > > > could perhaps call it "more honest", if you want. > > > > > > > > > > The point remains that unless we describe exactly which panel we're > > > > > dealing with, we ultimately have no way of properly quirking anything if > > > > > we ever have to. Also, once we allow this kind of wildcard we can > > > > > suddenly get into a situation where people might want to reuse this on > > > > > something that's not at all a google-pompom board because the same > > > > > particular power sequence happens to work on on some other board. > > > > > > > > > > Similarly I can imagine a situation where we could now have the same > > > > > panel supported by multiple different wildcard compatible strings. How > > > > > is that supposed to be any cleaner than what we have now? > > > > > > > > > > And I still keep wondering why bootloaders can't be taught about these > > > > > kinds of things. We have in the past discussed various solutions where > > > > > the bootloader could detect the type of panel connected and set the > > > > > proper compatible string. > > > > > > > > The bootloader cannot detect the panel without powering up the panel, > > > > which it normally does not do if you are not in dev-mode (it would add > > > > a significant amount of time to bootup, which is why we can't do this) > > > > > > what if we had a sort of multi-choice panel node: > > > > > > panel: panel { > > > compatible = "panel,one-of"; > > > compatible-one-of = "vendor1,panel-a", "vendor2,panel-b", > > > "vendor3,panel-c"; > > > }; > > > > > > The kernel could construct power sequence timings that are the > > > superset of all the possible panels. That seems about as explicit as > > > we could get in this sort of case. > > > > If we were to go this route, I'm inclined to say just shove all the > > possible panel compatibles into 'compatible'. That kind of breaks the > > notion of most specific to least specific. OTOH, it is saying the set > > of panels are somehow 'compatible' with each other. > > > > If there's not some level of compatibility between the panels, then > > it's still the bootloader's problem. > > > > I'm not sure about this.. since there could be slight differences in > various delay params between the possible panels. I'd prefer that in > panel-simple.c, we listed exact delay params "vendorFoo,panelBar", but > it could mean that for a device that had three possible panels the > worst case (max of all possible delays) could be higher than any > individual choice.. and I don't think we should encourage the "white > lie" approach (which will be the obvious outcome of not handling this > directly in dt IME, based on prior art). OTOH pushing it to the > bootloader, when the bootloader actually has to power up the panel > (and abide by the necessary delays) to figure out what choice we have > isn't a viable option either. I was only saying if the panels are different enough and there's not a worse case setting, then it's back to a bootloader problem. If we have multiple distinct compatibles, then it means the kernel should be able to figure out settings that work on all the possible panels listed. > It is better to be explicit about what we know and at the same time > about what we don't know. Can you be explicit about what we know and don't know here? With what you proposed and my alternative, at the end of the day we just have a list of compatibles. The only implicit part is the expectation that the set is somehow compatible with each other. Rob