Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp2210895rwo; Thu, 3 Aug 2023 06:25:36 -0700 (PDT) X-Google-Smtp-Source: APBJJlEB7AIe1xQHRn7xVhbgZE3R5QVNx0OATz3J8ije1IUyCzWABscBUdyKK+A/9/zHvRKJ6TBH X-Received: by 2002:a17:903:32cf:b0:1b9:d38d:efb1 with SMTP id i15-20020a17090332cf00b001b9d38defb1mr24273257plr.8.1691069135388; Thu, 03 Aug 2023 06:25:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691069135; cv=none; d=google.com; s=arc-20160816; b=pA4f2eEIM/zpcdNm1o4kjawFZ4kOOr7c/CnKv4chX62pmIhbyHXeB/+HcXcJCzLyV6 hLzMqfaH/9MkBWOOmm6UtN6J0ROn7H8riggOwhnBdM3vc0Kizcvre5qoTDLsZmj3sTxq gQr1gSDcVGOynV5ANri4hRS3ICcUXdGNV9PesjhnxbbZoSSiQryALGPinTeIQNHm2CbO 4KRk3Ai5aKiH9atLNLYXfk3rx4BfsTI2CHee/AbPQwLoKc8Af6SZjc08mC7I2pBA997t 0cnCy0j6Zl5f/7SwrhklPlLHD355ug7ecO3AF5xLyHSiyLNNjVCaHZuWoUGR0+RSvzKP J+tQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=QBxv3qBXN9/E3wvwn5MR0wsDoKPtCS2zOkczh8tpeyw=; fh=+r6zShXfitbLCsvp1ZBpH+AN9GfO170Lh62wNbnQ+VQ=; b=gzae02VfZIXeS2YSfhynMuEqDUbEA+vYikC8dtsRoE7toAX04yqmBik9ybwy+iuQdk oJMLqzYL8QX0ZKJrThPKk0g59PDBThcHwX3y5EzW5UnTHj5gBNCeWhZwTtlGXXW1pLQB uH8aEooTtL1bUVfBP7ZuPLKXKUeh5gyQUhPbVsq3aP0Lw3XXgIzmyHAQhBwh1073Vaaz llcV/zbLF/uC70tbI4XVbmw2M9X/6Ns0cGZElrcjXBeUgfGVzdZbnskKiEFTlNdcfsEU EsPTdOb0HwxaqYqeBgGD8dLtIaQDJiPabrSn7Gd2T2LXRll6Ncy+L0VQe5JtnRGb70cv 9dfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lBjBSA7l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e5-20020a17090301c500b001bb00cc105csi1031024plh.632.2023.08.03.06.24.52; Thu, 03 Aug 2023 06:25:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=lBjBSA7l; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S234432AbjHCMoj (ORCPT + 99 others); Thu, 3 Aug 2023 08:44:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229760AbjHCMog (ORCPT ); Thu, 3 Aug 2023 08:44:36 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 05CCB3586; Thu, 3 Aug 2023 05:44:36 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 89DBF61D80; Thu, 3 Aug 2023 12:44:35 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9848EC433C8; Thu, 3 Aug 2023 12:44:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1691066675; bh=QBxv3qBXN9/E3wvwn5MR0wsDoKPtCS2zOkczh8tpeyw=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lBjBSA7l3sDdf/7fOzX4+S0/7qIN2a1UfGvScxvUsvvnpXgk+n3+kk92KWOWr420W BMEqbNzVp4ESGn59OziDYGfIpKyhd989WUMu8iUcr+ZmwSZfjMQpGiKx44Ok8bDwJK qSSDTGmpPLlvGlwvT8r06TUdC76+Hi7VIYzdFzuM57htxE7BRMUCXgav8VmhgoXQMW XwUwOiOB56tXPV1fUtADRTXcjoGCfkI9a1ik6ttrtWHRzm8L4d/h+gPcNT/WNzA167 lKGfdCcmaDYAQlznnZL8qgUdkUsRTaxYNWtxhBEoJmmldzz1jq7NJSm+HgRu/ZHjhh dT2U4+MVa9MmA== Date: Thu, 3 Aug 2023 14:44:32 +0200 From: Maxime Ripard To: Neil Armstrong Cc: Daniel Vetter , Michael Riesch , Sam Ravnborg , Sebastian Reichel , Gerald Loacker , David Airlie , Miquel Raynal , Conor Dooley , Krzysztof Kozlowski , Rob Herring , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org Subject: Re: [PATCH 0/4] drm/panel: sitronix-st7789v: add support for partial mode Message-ID: <6x6wiyjqopz6nytv4wb6wn3iowhnwh2ce25v4v7n7xcwfzjk2a@4gsgjfqa44pt> References: <20230718-feature-lcd-panel-v1-0-e9a85d5374fd@wolfvision.net> <292c3e7d-82ea-2631-bd4b-ef747f56287c@linaro.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="hrr6rzrnikjkdjir" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --hrr6rzrnikjkdjir Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Aug 03, 2023 at 02:34:58PM +0200, Neil Armstrong wrote: > > > > > > I think I'll still like to have something clarified before we m= erge it: > > > > > > if userspace forces a mode, does it contain the margins or not?= I don't > > > > > > have an opinion there, I just think it should be documented. > > > > >=20 > > > > > The mode comes with the margins, so if userspace does something r= eally > > > > > funny then either it gets garbage (as in, part of it's crtc area = isn't > > > > > visible, or maybe black bars on the screen), or the driver reject= s it > > > > > (which I think is the case for panels, they only take their mode = and > > > > > nothing else). > > > >=20 > > > > Panels can usually be quite flexible when it comes to the timings t= hey > > > > accept, and we could actually use that to our advantage, but even i= f we > > > > assume that they have a single mode, I don't think we have anything= that > > > > enforces that, either at the framework or documentation levels? > > >=20 > > > Maybe more bugs? We've been slowly filling out all kinds of atomic kms > > > validation bugs in core/helper code because as a rule of thumb, > > > drivers get it wrong. Developers test until things work, then call it > > > good enough, and very few driver teams make a serious effort in trying > > > to really validate all invalid input. Because doing that is an > > > enormous amount of work. > > >=20 > > > I think for clear-cut cases like drm_panel the fix is to just put more > > > stricter validation into shared code (and then if we break something, > > > figure out how we can be sufficiently lenient again). > >=20 > > Panels are kind of weird, since they essentially don't exist at all in > > the framework so it's difficult to make it handle them or their state. > >=20 > > It's typically handled by encoders directly, so each and every driver > > would need to make that check, and from a quick grep, none of them are > > (for the reasons you said). > >=20 > > Just like for HDMI, even though we can commit to changing those facts, > > it won't happen overnight, so to circle back to that series, I'd like a > > comment in the driver when the partial mode is enabled that if userspace > > ever pushes a mode different from the expected one, we'll add the margi= ns. >=20 > To be fair, a majority of the panel drivers would do the wrong > init of the controller with a different mode because: > - mainly the controller model is unknown > - when it's known the datasheet is missing > - when the datasheet is here, most of the registers are missing > - and most of the time the timings are buried in the init sequence >=20 > It's sad but it's the real situation. Again, I agree. As far as I'm aware, none of them add arbitrary numbers to timings though, so it's easy enough to figure out what the mode is meant to be: it's the mode. Here, we add some numbers to the mode, so the interaction with the userspace forcing a mode is less clear. > Only a few drivers can handle a different mode, and we should perhaps > add a flag when not set rejecting a different mode for those controllers = and > mark the few ones who can handle that... > And this should be a first step before adding an atomic Panel API. I'm really just asking for a comment in the code here. Everything that you mentioned are improvements that we should have on our todo list, but I don't see them as pre-requisite for this series and we get to it later on. Maxime --hrr6rzrnikjkdjir Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYKAB0WIQRcEzekXsqa64kGDp7j7w1vZxhRxQUCZMuhLwAKCRDj7w1vZxhR xWM9AQD+q7nwioeLqvuLTy7EyE2QFTOY/Afbgj6fm6OTMMZ1awD+JyCCiP7jNIb8 otqd7ccpMdOLRvFno1dnyuj/TKaamgM= =bpPs -----END PGP SIGNATURE----- --hrr6rzrnikjkdjir--