From: Mario Limonciello <mario.limonciello@amd.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org,
Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
Maxime Ripard <mripard@kernel.org>,
Thomas Zimmermann <tzimmermann@suse.de>,
David Airlie <airlied@gmail.com>, Daniel Vetter <daniel@ffwll.ch>,
linux-kernel@vger.kernel.org,
Chris Bainbridge <chris.bainbridge@gmail.com>,
hughsient@gmail.com
Subject: Re: [PATCH v2] drm/client: Detect when ACPI lid is closed during initialization
Date: Wed, 29 May 2024 11:26:58 -0500 [thread overview]
Message-ID: <1f8ccefa-204f-4477-814f-4a1dfbbe6741@amd.com> (raw)
In-Reply-To: <ZldMKZ1MzSDXOheJ@intel.com>
>>>
>>> If you don't hook into some lid notify event how is one supposed to get
>>> the display back to life after opening the lid?
>>
>> I guess in my mind it's a tangential to the "initial modeset". The DRM
>> master can issue a modeset to enable the combination as desired.
>
> This code is run whenever there's a hotplug/etc. Not sure why you're
> only thinking about the initial modeset.
Got it; so in that case adding a notification chain for lid events to
run it again should do the trick.
>
>>
>> When I tested I did confirm that with mutter such an event is received
>> and it does the modeset to enable the eDP when lid is opened.
>
> This code isn't relevant when you have a userspace drm master
> calling the shots.
Right.
>
>>
>> Let me ask this - what happens if no DRM master running and you hotplug
>> a DP cable? Does a "new" clone configuration get done?
>
> Yes, this code reprobes the displays and comes up with a new
> config to suit the new situation.
Got it; in this case you're right we should have some notification
chain. Do you think it should be in the initial patch or a follow up?
>
> The other potential issue here is whether acpi_lid_open() is actually
> trustworthy. Some kms drivers have/had some lid handling in their own
> code, and I'm pretty sure those have often needed quirks/modparams
> to actually do sensible things on certain machines.
>
> FWIW I ripped out all the lid crap from i915 long ago since it was
> half backed, mostly broken, and ugly, and I'm not looking to add it
> back there. But I do think handling that in drm_client does seem
> somewhat sane, as that should more or less match what userspace
> clients would do. Just a question of how bad the quirk situation
> will get...
>
If the lid reporting is wrong it's not just drm_client that would
falter. There are other parts of the kernel that rely upon
acpi_lid_open() being accurate and IMO it would be best to put any
quirks to the effect in drivers/acpi/button.c.
If it can't be relied upon then it's best to just report -EINVAL or -ENODEV.
>
> Also a direct acpi_lid_open() call seems a bit iffy. But I guess if
> someone needs this to work on non-ACPI system they get to figure out
> how to abstract it better. acpi_lid_open() does seem to return != 0
> when ACPI is not supported, so at least it would err on the side
> of enabling everything.
>
Yeah acpi_lid_open() seemed fine to me specifically because non ACPI
hardcodes to open.
next prev parent reply other threads:[~2024-05-29 16:27 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-28 21:03 [PATCH v2] drm/client: Detect when ACPI lid is closed during initialization Mario Limonciello
2024-05-29 13:33 ` Alex Deucher
2024-05-29 13:51 ` Jani Nikula
2024-05-29 13:55 ` Alex Deucher
2024-05-29 14:34 ` Mario Limonciello
2024-05-29 14:14 ` Ville Syrjälä
2024-05-29 14:45 ` Mario Limonciello
2024-05-29 15:39 ` Ville Syrjälä
2024-05-29 16:26 ` Mario Limonciello [this message]
2024-05-29 17:55 ` Dmitry Baryshkov
2024-05-30 4:41 ` Limonciello, Mario
2024-05-30 8:07 ` Dmitry Baryshkov
2024-05-30 20:44 ` Dmitry Torokhov
2024-06-04 2:02 ` kernel test robot
2024-06-05 15:08 ` Chris Bainbridge
2024-06-06 7:21 ` Jani Nikula
2024-06-06 12:31 ` Ville Syrjälä
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=1f8ccefa-204f-4477-814f-4a1dfbbe6741@amd.com \
--to=mario.limonciello@amd.com \
--cc=airlied@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=chris.bainbridge@gmail.com \
--cc=daniel@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=hughsient@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maarten.lankhorst@linux.intel.com \
--cc=mripard@kernel.org \
--cc=tzimmermann@suse.de \
--cc=ville.syrjala@linux.intel.com \
/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