Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp1622922pxb; Fri, 18 Feb 2022 11:40:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJxeYm/d4mS4UprhPURX1NJ3PCBfeB26sKoh0QjqRKgpd/Pw+I4qK1pxoNT3QztJwBszqy5v X-Received: by 2002:a17:903:31cd:b0:14d:bb40:2a17 with SMTP id v13-20020a17090331cd00b0014dbb402a17mr8718990ple.1.1645213202176; Fri, 18 Feb 2022 11:40:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645213202; cv=none; d=google.com; s=arc-20160816; b=DbGGaJplLjmrqQZ9X8P5qM+oGwrZVHVDkaUWe50Px0NWZOotHb6bxhoMPHHGz5J3y7 1Vdp3D1+0DQca68mlhWN5WREZbSAWmU8MtP1ojtIghuA8ec5udTOgiDBQdQsxvh7NMkj kpMHWR34roVzsrDegb0yO9I2i5ZpBKb44LwYVH/5C2BFoLhz658AcuwdVjq24svfRBFA foI/hhGjElkerCj+G2mYVkJyZkLw91ZNejlUkdHe3d4LIPJO4f3fa0isUQzRMc8Gl8Z7 SaKH9uRtluq+w/A9mj+xN7h4EEC77TzIctPlPZvBSbvmgex36NB8fRlhc9aBEd40cy0K 5zDw== 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=QQJnGEvj1IWlzn/kQU3xNdCOUk3mjEmKlzY4/R3+WQI=; b=G0dGxH7ycLWSDZ2eJ4njXLvOPgOasil9R3DQ1bXP02Qav0lswnoNTwrNsiLewTN3aY wq5oshats1NQDX+kk90rH111RJFBONHsZZQnG6hwt3GJQ+7qDE0jk77ii3pYOJbj4+gs z8FTlI4NjdqtdCYKrvIeWHsTwK3CpzLDYSq9Ny0cozzW1KJhaAt7J/gB+fQmJ8xz5+LP 6kZn1joc7ByVd1z5tgcTUdzsakeAh1539vcGHfReVqrBU4MrjFwdgx0yJCndpY+1aSe+ PIe1w1opqB7+5zIB6cLHN5Z7K4rreg/t4koTdDfroXIVDdi/Y8r3fJd8NXKFvB87LDhC AlSA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=TNwwv5eZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b28si12742723pgb.584.2022.02.18.11.39.46; Fri, 18 Feb 2022 11:40:02 -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=@gmail.com header.s=20210112 header.b=TNwwv5eZ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235602AbiBRPyu (ORCPT + 99 others); Fri, 18 Feb 2022 10:54:50 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:52490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231990AbiBRPys (ORCPT ); Fri, 18 Feb 2022 10:54:48 -0500 Received: from mail-oo1-xc2c.google.com (mail-oo1-xc2c.google.com [IPv6:2607:f8b0:4864:20::c2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9136220D34E; Fri, 18 Feb 2022 07:54:31 -0800 (PST) Received: by mail-oo1-xc2c.google.com with SMTP id 189-20020a4a03c6000000b003179d7b30d8so3991190ooi.2; Fri, 18 Feb 2022 07:54:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=QQJnGEvj1IWlzn/kQU3xNdCOUk3mjEmKlzY4/R3+WQI=; b=TNwwv5eZMYbFtrgVKrARlarq8w8wALPJqQI5N6JlSz/H2LztXDQbUGRUntS5NXl9vW ir3mzNqNOWkGdrrFqsuH9HlzFZ9U2bDym6d1oBn+Amhs89BzlCziudAdOK95f3sHMOze 8nGeIDsNK0LF7P1NwGyO5I3DNGPk7DRj+kmNHqFOoJssyPr0luIY0KDZZQAGfu/jkHGD sMXGXQZPTmxAFQlkkmvluTXy1JUZC6mzV0aXS5IqLTARe3VDOyvwd+Of5jNsdXfDU+Ir KgZd53astXMwxGQHcdZgviLNRZLJDBK7gZFTsvf2ygKNykpEaPYYaoWBqwd3cizATuAe 1y3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=QQJnGEvj1IWlzn/kQU3xNdCOUk3mjEmKlzY4/R3+WQI=; b=kEpixGN4BKx6yw3W+FuoCi9jHSDbher/w+7ee/jJtfb4YNab/TFG9sQP/QFL+ATBNn /o2gASLQCc9/1bXKVl3767EVhka6nvNoBCFuaiXxj5iZ1wbXvBnl7LWtMXo0i+nydq7B 28XS5vhZ9tNv46eWif+ZFgvw3W1/BfgE8A+L3+xA1Fu1+D3mZTYWqVc2ZX8l1C1NFCZ3 yrA+5zibkotYs5/9JCbCaW9P2XeTdEhL09V6UxGP6h9T43uXBahl8tJJy9evVMVKY/QE WcCNzyGgzDKiGHvYGFCxROk2lOieCrZrGX0F7LCfdNVDB12nZYt1vSnV5jPRj40OlkeP ShaQ== X-Gm-Message-State: AOAM532wwGHCJzAjoPJnOmTRgHk2GC0nlPu/cBZHXYk7azls7puzAnRx WgyVB4LEGslvYG6xft4/kCJD84VX+gU3cQuwz1A= X-Received: by 2002:a05:6870:912c:b0:d3:44be:7256 with SMTP id o44-20020a056870912c00b000d344be7256mr3246887oae.73.1645199670906; Fri, 18 Feb 2022 07:54:30 -0800 (PST) MIME-Version: 1.0 References: <20220208084234.1684930-1-hsinyi@chromium.org> In-Reply-To: From: Alex Deucher Date: Fri, 18 Feb 2022 10:54:19 -0500 Message-ID: Subject: Re: [Intel-gfx] [PATCH v8 1/3] gpu: drm: separate panel orientation property creating and value setting To: Simon Ser Cc: Hans de Goede , Chun-Kuang Hu , ML dri-devel , devicetree , David Airlie , Daniel Vetter , Intel Graphics Development , Emil Velikov , "Linux-Kernel@Vger. Kernel. Org" , Maxime Ripard , Alex Deucher , Rob Herring , linux-mediatek@lists.infradead.org, amd-gfx mailing list , Thomas Zimmermann , Hsin-Yi Wang , Matthias Brugger , Harry Wentland , LAKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,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 Fri, Feb 18, 2022 at 7:13 AM Simon Ser wrote: > > 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 uevent. > > >> > > >> I believe that this is a bad idea, it is important to keep in mind here > > >> 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=upside-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 black... > > > > 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 don't think it's a big deal to change, but at least my understanding, albeit this was back in the early KMS days, was that probing was driven by things outside of the driver. I.e., there is no need to probe displays if nothing is going to use them. If you want to use the displays, you'd call probe first before trying to use them so you know what is available. Alex > > > >> 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.