Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1290829pxb; Fri, 18 Feb 2022 04:54:06 -0800 (PST) X-Google-Smtp-Source: ABdhPJzmohMIkWN61wShWbE5qAVIZ0OrveAXe7v9cwiR2e2UBb9s+lut+NvqDr0A4s65ddK5OyKV X-Received: by 2002:a17:90a:8583:b0:1b9:337d:4ac with SMTP id m3-20020a17090a858300b001b9337d04acmr12510544pjn.171.1645188846317; Fri, 18 Feb 2022 04:54:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645188846; cv=none; d=google.com; s=arc-20160816; b=RTy8NzicepxCWk24jF1GOdd5N5HQH+bzZGKPxeerTmHMPNEiwvSte2fqUyj2rEAwGA 7TpbXMFyU0ct8Bl9M3yrA3YxjoezAx8Db9j1HOZDWHCDcKFbGwSzj6okH92U6kmszE7i OslcDy1H3UP5sgjnvTJb+mPLRK9dFnShC1JPxjCkB/8GopiGvMIjHWQwLN/dZKHP9MGf ADUGc1QY6E9ezYh4qzI82GBJB+CqP0cf8FSJC3uHUe5TWG5ktCzsv2/yjDWZCv2hwo1m DkqA1Vn+ArbRSEVLB7Ogy5beFi1Y1GWsCT8wnh8RWX3Yv71OGTz+xoSQYJCnlFKUrBNm rSSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:reply-to:cc:from:to :dkim-signature:date; bh=obcqmVH+DAiCiMe4lhhI6hr1y7IfE4219TpOs/ZsuSQ=; b=K2TrMvQcs3fJGGpa4I/ZafrkhA2jWRaU+gNZn7Ou/2dDLuuKVKxs/GWPjljmccB5ya AdMIQvRFQdBWlOB5NhTxBQBebYIAwS+mXM7SjGwUTRvQqGXkEEugK2JdOGrgRgLOS2/P +28UMIc1SEUwHotgrJ5urjRQekW7W0BUV7/vrFXMMieJr4wN96qCG9X03JISPww9l0V7 VPkzESSX2j4Oyul/maMbG5L0bYVmQfIu2pKs52vvSthG8sdBkj2Sz/mPHu5LC2UWW2lK me1JsUue1ZdJWZmyXkbq+lz9MHBpOGHcGsEFGTGl+OoYAqAW5eSw0UeoFsZJa3iW3OPe Cglg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@emersion.fr header.s=protonmail2 header.b=ZEFODOlF; 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=emersion.fr Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id nu18si3810344pjb.173.2022.02.18.04.53.51; Fri, 18 Feb 2022 04:54:06 -0800 (PST) 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=@emersion.fr header.s=protonmail2 header.b=ZEFODOlF; 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=emersion.fr Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235023AbiBRMNP (ORCPT + 99 others); Fri, 18 Feb 2022 07:13:15 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:47228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232329AbiBRMNO (ORCPT ); Fri, 18 Feb 2022 07:13:14 -0500 Received: from mail-4317.proton.ch (mail-4317.proton.ch [185.70.43.17]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6331025B6D0 for ; Fri, 18 Feb 2022 04:12:56 -0800 (PST) Date: Fri, 18 Feb 2022 12:12:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emersion.fr; s=protonmail2; t=1645186373; bh=obcqmVH+DAiCiMe4lhhI6hr1y7IfE4219TpOs/ZsuSQ=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID; b=ZEFODOlFQCGBrINCjM2CuIs1XTHQJc1w7H096U/gm4jy5vxGR+gw29LNgGcp9+8zN o6VjXAKG4pIyu0IkmQdozIlocBuXjNO96dfF1zr2bIve1p/twEDsFj83JrjHyDZ1c3 Rni3amD5vVJLgqF7uMQb4Q3Wdr4RhSYDsIHExBiVcEL+rW2IulpxB1pEV1xXgK8J90 nHU0zBOR3kJyWdWt68oXac71i6ZEKwjQtVBZEVu5fod53M/9v8grxYWCW2zxfL2Sm8 cZETRSe/cvKANyWWSGuKIoUYJ7xyTf07frTMfuPP+VLNsBc3c2Zf5Ies01iCqVJL5z aHik0JtrIO7Pw== To: Hans de Goede From: Simon Ser Cc: Emil Velikov , Maxime Ripard , Chun-Kuang Hu , Thomas Zimmermann , devicetree , David Airlie , Intel Graphics Development , "Linux-Kernel@Vger. Kernel. Org" , amd-gfx mailing list , Matthias Brugger , Rob Herring , linux-mediatek@lists.infradead.org, ML dri-devel , Hsin-Yi Wang , Alex Deucher , Harry Wentland , LAKML , Daniel Vetter Reply-To: Simon Ser Subject: Re: [Intel-gfx] [PATCH v8 1/3] gpu: drm: separate panel orientation property creating and value setting Message-ID: In-Reply-To: References: <20220208084234.1684930-1-hsinyi@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Friday, February 18th, 2022 at 12:54, Hans de Goede wrote: > On 2/18/22 12:39, Simon Ser wrote: > > On Friday, February 18th, 2022 at 11:38, Hans de Goede wrote: > > > >> What I'm reading in the above is that it is being considered to allow > >> changing the panel-orientation value after the connector has been made > >> available to userspace; and let userspace know about this through a ue= vent. > >> > >> I believe that this is a bad idea, it is important to keep in mind her= e > >> what userspace (e.g. plymouth) uses this prorty for. This property is > >> used to rotate the image being rendered / shown on the framebuffer to > >> adjust for the panel orientation. > >> > >> So now lets assume we apply the correct upside-down orientation later > >> on a device with an upside-down mounted LCD panel. Then on boot the > >> following could happen: > >> > >> 1. amdgpu exports a connector for the LCD panel to userspace without > >> setting panel-orient=3Dupside-down > >> 2. plymouth sees this and renders its splash normally, but since the > >> panel is upside-down it will now actually show upside-down > > > > At this point amdgpu hasn't probed the connector yet. So the connector > > will be marked as disconnected, and plymouth shouldn't render anything. > > If before the initial probe of the connector there is a /dev/dri/card0 > which plymouth can access, then plymouth may at this point decide > to disable any seemingly unused crtcs, which will make the screen go blac= k... > > I'm not sure if plymouth will actually do this, but AFAICT this would > not be invalid behavior for a userspace kms consumer to do and I > believe it is likely that mutter will disable unused crtcs. > > IMHO it is just a bad idea to register /dev/dri/card0 with userspace > before the initial connector probe is done. Nothing good can come > of that. > > If all the exposed connectors initially are going to show up as > disconnected anyways what is the value in registering /dev/dri/card0 > with userspace early ? OK. I'm still unsure how I feel about this, but I think I agree with you. That said, the amdgpu architecture is quite involved with multiple abstraction levels, so I don't think I'm equipped to write a patch to fix this... cc Daniel Vetter: can you confirm probing all connectors is a good thing to do on driver module load? > >> I guess the initial modeline is inherited from the video-bios, but > >> what about the physical size? Note that you cannot just change the > >> physical size later either, that gets used to determine the hidpi > >> scaling factor in the bootsplash, and changing that after the initial > >> bootsplash dislay will also look ugly > >> > >> b) Why you need the edid for the panel-orientation property at all, > >> typically the edid prom is part of the panel and the panel does not > >> know that it is mounted e.g. upside down at all, that is a property > >> of the system as a whole not of the panel as a standalone unit so > >> in my experience getting panel-orient info is something which comes > >> from the firmware /video-bios not from edid ? > > > > This is an internal DRM thing. The orientation quirks logic uses the > > mode size advertised by the EDID. > > The DMI based quirking does, yes. But e.g. the quirk code directly > reading this from the Intel VBT does not rely on the mode. > > But if you are planning on using a DMI based quirk for the steamdeck > then yes that needs the mode. > > Thee mode check is there for 2 reasons: > > 1. To avoid also applying the quirk to external displays, but > I think that that is also solved in most drivers by only checking for > a quirk at all on the eDP connector > > 2. Some laptop models ship with different panels in different badges > some of these are portrait (so need a panel-orient) setting and others > are landscape. That makes sense. So yeah the EDID mode based matching logic needs to stay to accomodate for these cases. > > I agree that at least in the Steam > > Deck case it may not make a lot of sense to use any info from the > > EDID, but that's needed for the current status quo. > > We could extend the DMI quirk mechanism to allow quirks which don't > do the mode check, for use on devices where we can guarantee neither > 1 nor 2 happens, then amdgpu could call the quirk code early simply > passing 0x0 as resolution. Yeah. But per the above amdgpu should maybe probe connectors on module load. If/when amdgpu is fixed to do this, then we don't need to disable the mode matching logic in panel-orientation quirks anymore.