From: Pasi =?iso-8859-1?Q?K=E4rkk=E4inen?= Subject: Re: Radeon 3650HD laptop LVDS lid open/closed detection problem Date: Tue, 21 Sep 2010 11:35:50 +0300 Message-ID: <20100921083550.GG2804@reaktio.net> References: <20100726194242.GI17817@reaktio.net> <20100727084112.GN17817@reaktio.net> <20100919111834.GU2804@reaktio.net> <20100919113403.GV2804@reaktio.net> <20100919122547.GW2804@reaktio.net> <20100919145607.GX2804@reaktio.net> <20100920055332.GZ2804@reaktio.net> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from smtp.tele.fi (smtp.tele.fi [192.89.123.25]) by gabe.freedesktop.org (Postfix) with ESMTP id 7EF0E9E7BC for ; Tue, 21 Sep 2010 01:36:08 -0700 (PDT) Content-Disposition: inline In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org Errors-To: dri-devel-bounces+sf-dri-devel=m.gmane.org@lists.freedesktop.org To: Alex Deucher Cc: dri-devel@lists.freedesktop.org List-Id: dri-devel@lists.freedesktop.org On Tue, Sep 21, 2010 at 01:09:37AM -0400, Alex Deucher wrote: > On Mon, Sep 20, 2010 at 1:53 AM, Pasi K=E4rkk=E4inen wrote: > > On Sun, Sep 19, 2010 at 11:56:27PM -0400, Alex Deucher wrote: > >> On Sun, Sep 19, 2010 at 10:56 AM, Pasi K=E4rkk=E4inen w= rote: > >> > On Sun, Sep 19, 2010 at 03:25:47PM +0300, Pasi K=E4rkk=E4inen wrote: > >> >> > > > >> >> > > so "/proc/acpi/button/lid/LID/state" seems to work properly on = my laptop, > >> >> > > but is there a way to monitor the state of the drm/kms outputs = from /proc, /sys or from somewhere? > >> >> > > > >> >> > > I'd like to see the state before X is started, and verify what = happens when GDM is started etc.. > >> >> > > (ie. if outputs are enabled/active or not). > >> >> > > > >> >> > > >> >> > Ah, found it: > >> >> > > >> >> > $ ls /sys/class/drm/card0 > >> >> > card0-DVI-D-1 =A0 =A0 =A0 =A0card0-LVDS-1 =A0dev =A0 =A0 power = =A0 =A0 =A0uevent > >> >> > card0-HDMI Type A-1 =A0card0-VGA-1 =A0 device =A0subsystem > >> >> > > >> >> > $ cat /sys/class/drm/card0/card0-LVDS-1/status > >> >> > connected > >> >> > > >> >> > $ cat /sys/class/drm/card0/card0-LVDS-1/enabled > >> >> > enabled > >> >> > > >> >> > >> >> So I added those to rc.local so that they get executed before GDM.. > >> >> and I booted up the laptop with the lid closed.. > >> >> > >> >> And the result was: lid state "closed", lvds-status "connected" and= lvds-enabled was "enabled".. > >> >> > >> >> Does that mean Fedora plymouth is doing it wrong, > >> >> or is t possible the driver itself always enabled the lvds, even wh= en the lid is closed? > >> >> > >> > > >> > I did some more investigations. I'm currently using Fedora 13 Linux = 2.6.34.6-47.fc13.x86_64 kernel. > >> > I hacked the initrd image to echo debug stuff right after drm module= s are loaded, > >> > and *before* plymouth is started (and then sleep for some time so th= at I have time to see the debug values.) > >> > > >> > The result was this: > >> > > >> > acpi lid/state: closed > >> > lvds-1/status: connected > >> > lvds-1/enabled: enabled > >> > > >> > So to me it looks like the problem is in the driver itself.. > >> > lvds shouldn't get enabled (turned on) when the lid is closed.. > >> > >> As I've stated previously, the driver always reports LVDS as connected > >> because it is always connected. =A0It's up to userspace to decide on > >> what policy (enabled or disabled) to implement when the lid is open vs > >> closed. > >> > > > > Yep, I do realize it's always connected. > > > > But the question was supposed to be more about the enabled/disabled par= t.. > > It isn't possible to check the acpi lid status from the driver? > = > It is possible but: > = > 1. Acpi lid status is very unreliable on a lot of notebooks > Yeah.. seems to work fine on mine though. > 2. Policy is set in userspace, so your desktop manager should decide > what to enable in what cases. > = Police in userspace makes sense.. > Also there are laptops with built in color management tools that > require the panel be on when the lid is closed to run. > = Hmm.. ok. So I guess I'll have to continue with plymouth/gdm/Xorg people.. Thanks! -- Pasi