From: Harry Wentland <harry.wentland@amd.com>
To: Simon Ser <contact@emersion.fr>, Hans de Goede <hdegoede@redhat.com>
Cc: Emil Velikov <emil.l.velikov@gmail.com>,
Maxime Ripard <mripard@kernel.org>,
Chun-Kuang Hu <chunkuang.hu@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
devicetree <devicetree@vger.kernel.org>,
David Airlie <airlied@linux.ie>,
Intel Graphics Development <intel-gfx@lists.freedesktop.org>,
"Linux-Kernel@Vger. Kernel. Org" <linux-kernel@vger.kernel.org>,
amd-gfx mailing list <amd-gfx@lists.freedesktop.org>,
Matthias Brugger <matthias.bgg@gmail.com>,
Rob Herring <robh+dt@kernel.org>,
linux-mediatek@lists.infradead.org,
ML dri-devel <dri-devel@lists.freedesktop.org>,
Hsin-Yi Wang <hsinyi@chromium.org>,
Alex Deucher <alexander.deucher@amd.com>,
LAKML <linux-arm-kernel@lists.infradead.org>,
Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [Intel-gfx] [PATCH v8 1/3] gpu: drm: separate panel orientation property creating and value setting
Date: Fri, 18 Feb 2022 10:57:27 -0500 [thread overview]
Message-ID: <16c1886f-d130-b299-9d09-ad11556f3bfd@amd.com> (raw)
In-Reply-To: <DM7TzJ-fZEHjoGXvMG8XLfJ2VxohRxotL40_0Vb4cAUvrELgV9BvPGbK6HAwOYOBCx8qXtY2LQ0xnZ-nlH_IVCyne7tMKfvkqxtoWI6MkTw=@emersion.fr>
On 2022-02-18 07:12, Simon Ser wrote:
> On Friday, February 18th, 2022 at 12:54, Hans de Goede <hdegoede@redhat.com> wrote:
>
>> On 2/18/22 12:39, Simon Ser wrote:
>>> On Friday, February 18th, 2022 at 11:38, Hans de Goede <hdegoede@redhat.com> 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...
>
amdgpu_dm's connector registration already triggers a detection. See the
calls to dc_link_detect and amdgpu_dm_update_connector_after_detect in
amdgpu_dm_initialize_drm_device.
dc_link_detect is supposed to read the edid via
dm_helpers_read_local_edid and amdgpu_dm_update_connector_after_detect
will update the EDID on the connector via a
drm_connector_update_edid_property call.
This all happens at driver load.
I don't know why you're seeing the embedded connector as disconnected
unless the DP-MIPI bridge for some reason doesn't indicate that the panel
is connected at driver load.
Harry
> 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.
next prev parent reply other threads:[~2022-02-18 15:57 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-08 8:42 Hsin-Yi Wang
2022-02-08 8:42 ` [PATCH v8 2/3] drm/mediatek: init panel orientation property Hsin-Yi Wang
2022-02-08 8:42 ` [PATCH v8 3/3] arm64: dts: mt8183: Add panel rotation Hsin-Yi Wang
2022-02-15 1:16 ` [PATCH v8 1/3] gpu: drm: separate panel orientation property creating and value setting Gabriel Krisman Bertazi
2022-02-15 3:15 ` Hsin-Yi Wang
2022-02-15 4:03 ` Gabriel Krisman Bertazi
2022-02-15 13:08 ` Hsin-Yi Wang
2022-02-15 12:04 ` [Intel-gfx] " Emil Velikov
2022-02-15 13:05 ` Hsin-Yi Wang
2022-02-15 13:55 ` Simon Ser
2022-02-15 14:38 ` Emil Velikov
2022-02-15 16:37 ` Simon Ser
2022-02-16 12:00 ` Emil Velikov
2022-02-18 10:38 ` Hans de Goede
2022-02-18 11:39 ` Simon Ser
2022-02-18 11:54 ` Hans de Goede
2022-02-18 12:12 ` Simon Ser
2022-02-18 15:54 ` Alex Deucher
2022-02-18 15:57 ` Harry Wentland [this message]
2022-03-18 8:29 ` Hsin-Yi Wang
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=16c1886f-d130-b299-9d09-ad11556f3bfd@amd.com \
--to=harry.wentland@amd.com \
--cc=airlied@linux.ie \
--cc=alexander.deucher@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chunkuang.hu@kernel.org \
--cc=contact@emersion.fr \
--cc=daniel.vetter@ffwll.ch \
--cc=devicetree@vger.kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=emil.l.velikov@gmail.com \
--cc=hdegoede@redhat.com \
--cc=hsinyi@chromium.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mediatek@lists.infradead.org \
--cc=matthias.bgg@gmail.com \
--cc=mripard@kernel.org \
--cc=robh+dt@kernel.org \
--cc=tzimmermann@suse.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®