From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alan Amaral" Subject: Is there a way to determine which display is the laptop display? Date: Thu, 2 Feb 2012 15:28:15 -0600 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2060431572==" Return-path: Received: from server514.appriver.com (server514a.exghost.com [72.32.253.68]) by gabe.freedesktop.org (Postfix) with ESMTP id 05E60A1363 for ; Thu, 2 Feb 2012 14:28:29 -0800 (PST) Received: from [72.32.253.65] (HELO FE06.exg4.exghost.com) by server514.appriver.com (CommuniGate Pro SMTP 5.4.3k) with ESMTP id 263631742 for intel-gfx@lists.freedesktop.org; Thu, 02 Feb 2012 15:28:28 -0600 Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============2060431572== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CCE1F1.9A856CFB" This is a multi-part message in MIME format. ------_=_NextPart_001_01CCE1F1.9A856CFB Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable With earlier hardware it was pretty easy to determine which display was = the laptop display as it was usually (always?) "LVDS". With new hardware it's sometimes an = embedded display port (eDP) display, and I've seen at least one laptop which has the = laptop monitor listed as simply Display Port (DP), although that may not have been an Intel machine. In = the DP case the laptop monitor can't be distinguished from a normal display port monitor. =20 Is there a way to definitively determine which, if any, monitor is the = one that belongs to the laptop on a laptop machine? I need to know in order to write a utility which = tracks the laptop lid state (i.e. open or closed), and automatically enables or disables the laptop = monitor via XRandR when the state changes. It has to work across all Intel (and if possible ATI) = machines. =20 The current code I have uses some heuristics to figure out what outputs = are available on the system, i.e. checks for LVDS, then eDP, then DP, and makes a guess as to which = one is the laptop monitor, but in some cases, like the DisplayPort case I described above, it's = impossible to know for sure, and if a future release changes the names it will fail. =20 One thing I have seen is that the serial number contained in the = laptop's display EDID information for the laptops I've tried have all been 0, but that may simply be a = fluke of the particular machines I've tried. Plus there are normal monitors which provide badly formed = EDID information, so I can't rely on this. =20 Thanks, =20 Al Amaral Virtual Computer ------_=_NextPart_001_01CCE1F1.9A856CFB Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =0A= =0A= =0A= =0A=
With earlier hardware = it was pretty easy to determine which display was the laptop = display
=0A=
as it was usually (always?) = "LVDS".  With new hardware it's sometimes an embedded = display
=0A=
port (eDP) display, and I've seen at = least one laptop which has the laptop monitor listed as = simply
=0A=
Display Port (DP), although that may = not have been an Intel machine.  In the DP case the = laptop
=0A=
monitor can't be distinguished from a = normal display port monitor.
=0A=
 
=0A=
Is there a way to definitively = determine which, if any, monitor is the one that belongs to the = laptop
=0A=
on a laptop machine?  I need to = know in order to write a utility which tracks the laptop lid state = (i.e.
=0A=
open or closed), and automatically = enables or disables the laptop monitor via XRandR when the = state
=0A=
changes.  It has to work across = all Intel (and if possible ATI) machines.
=0A=
 
=0A=
The current code I have uses some = heuristics to figure out what outputs are available on the = system,
=0A=
i.e. checks for LVDS, then eDP, then = DP, and makes a guess as to which one = is the laptop monitor,
=0A=
but in some cases, like the DisplayPort = case I described above, it's = impossible to know for sure, and
=0A=
if a future release changes the names = it will fail.
=0A=
 
=0A=
One thing I have seen is that the = serial number contained in the laptop's display EDID = information
=0A=
for the laptops I've tried have all = been 0, but that may simply be a fluke of the particular = machines
=0A=
I've tried.  Plus there are normal = monitors which provide badly formed EDID information, so I can't
=0A=
rely on this.
=0A=
 
=0A=
Thanks,
=0A=
 
=0A=
Al Amaral
=0A=
Virtual = Computer
------_=_NextPart_001_01CCE1F1.9A856CFB-- --===============2060431572== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============2060431572==-- From mboxrd@z Thu Jan 1 00:00:00 1970 From: Adam Jackson Subject: Re: Is there a way to determine which display is the laptop display? Date: Mon, 06 Feb 2012 16:44:16 -0500 Message-ID: <4F3049B0.20403@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTP id 732759E9A9 for ; Mon, 6 Feb 2012 13:44:18 -0800 (PST) In-Reply-To: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Alan Amaral Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On 2/2/12 4:28 PM, Alan Amaral wrote: > With earlier hardware it was pretty easy to determine which display was the laptop display > as it was usually (always?) "LVDS". With new hardware it's sometimes an embedded display > port (eDP) display, and I've seen at least one laptop which has the laptop monitor listed as simply > Display Port (DP), although that may not have been an Intel machine. In the DP case the laptop > monitor can't be distinguished from a normal display port monitor. If the driver isn't reporting an eDP display as eDP, the driver is broken. > The current code I have uses some heuristics to figure out what outputs are available on the system, > i.e. checks for LVDS, then eDP, then DP, and makes a guess as to which one is the laptop monitor, > but in some cases, like the DisplayPort case I described above, it's impossible to know for sure, and > if a future release changes the names it will fail. The names won't change. There might be some new embedded display connectivity in the future with a new name, but that's something you'd have to handle then anyway. Ideally we'd come up with a way to proxy laptop lid state into DRM connector state directly, but a) there's a lot of broken hardware in the world and b) the kernel tends to stridently resist getting anything right in kernelspace when it's easier to let people get it wrong in userspace instead. Yes I'm bitter. - ajax From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Alan Amaral" Subject: Re: Is there a way to determine which display is the laptop display? Date: Tue, 7 Feb 2012 14:42:43 -0600 Message-ID: References: <4F3049B0.20403@redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0440733509==" Return-path: Received: from server514.appriver.com (server514f.exghost.com [72.32.253.73]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F7369F674 for ; Tue, 7 Feb 2012 12:42:45 -0800 (PST) Content-class: urn:content-classes:message List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Adam Jackson Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org This is a multi-part message in MIME format. --===============0440733509== Content-class: urn:content-classes:message Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01CCE5D9.0A6A0BF6" This is a multi-part message in MIME format. ------_=_NextPart_001_01CCE5D9.0A6A0BF6 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Your idea about proxying the lid state to the drm connection state would = be perfect. Why leave the display turned on when you can't see it anyway? Closing the lid is = pretty much equivalent to yanking a monitor cable. =20 If that can't be done is there any chance something could be put into = /sys/class/drm/card*_foo, like a new entry for the laptop screen, such as = /sys/class/drm/card0-LVDS-1/laptop_screen? Could be created only for the laptop screen, or for every output but only the laptop = returns TRUE. =20 I've already got mapping from XRandR output names to drm output names = (quite a bitch that was to get working across all systems), so reading the contents of the sysfs = file wouldn't be hard. =20 Thanks for the reply, =20 Al Amaral ________________________________ From: Adam Jackson [mailto:ajax@redhat.com] Sent: Mon 2/6/2012 4:44 PM To: Alan Amaral Cc: intel-gfx@lists.freedesktop.org Subject: Re: [Intel-gfx] Is there a way to determine which display is = the laptop display? On 2/2/12 4:28 PM, Alan Amaral wrote: > With earlier hardware it was pretty easy to determine which display = was the laptop display > as it was usually (always?) "LVDS". With new hardware it's sometimes = an embedded display > port (eDP) display, and I've seen at least one laptop which has the = laptop monitor listed as simply > Display Port (DP), although that may not have been an Intel machine. = In the DP case the laptop > monitor can't be distinguished from a normal display port monitor. If the driver isn't reporting an eDP display as eDP, the driver is = broken. > The current code I have uses some heuristics to figure out what = outputs are available on the system, > i.e. checks for LVDS, then eDP, then DP, and makes a guess as to which = one is the laptop monitor, > but in some cases, like the DisplayPort case I described above, it's = impossible to know for sure, and > if a future release changes the names it will fail. The names won't change. There might be some new embedded display connectivity in the future with a new name, but that's something you'd have to handle then anyway. Ideally we'd come up with a way to proxy laptop lid state into DRM connector state directly, but a) there's a lot of broken hardware in the world and b) the kernel tends to stridently resist getting anything right in kernelspace when it's easier to let people get it wrong in userspace instead. Yes I'm bitter. - ajax ------_=_NextPart_001_01CCE5D9.0A6A0BF6 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Re: [Intel-gfx] Is there a way to determine = which display is the laptop display?=0A= =0A= =0A= =0A=
=0A=
Your idea = about proxying the lid state to the drm connection state would be = perfect.  Why leave the
=0A=
display turned on when you = can't see it anyway?  Closing the lid is pretty much equivalent to = yanking
=0A=
a monitor cable.
=0A=
 
=0A=
If that can't = be done is there any chance something could be put into = /sys/class/drm/card*_foo, like a
=0A=
new entry for = the laptop screen, such as = /sys/class/drm/card0-LVDS-1/laptop_screen?  Could be = created
=0A=
only for the laptop = screen, or for every output = but only the laptop returns TRUE.
=0A=
 
=0A=
I've already got mapping from = XRandR output names to drm output names (quite a bitch that was = to
=0A=
get working across all = systems), so reading the contents of the sysfs file wouldn't be = hard.
=0A=
 
=0A=
Thanks for the = reply,
=0A=
 
=0A=
Al Amaral
=0A=

=0A=
=0A= From: Adam Jackson = [mailto:ajax@redhat.com]
Sent: Mon 2/6/2012 4:44 = PM
To: Alan Amaral
Cc: = intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] Is = there a way to determine which display is the laptop = display?

=0A=
=0A=

On 2/2/12 4:28 PM, Alan Amaral wrote:
> With = earlier hardware it was pretty easy to determine which display was the = laptop display
> as it was usually (always?) "LVDS".  With = new hardware it's sometimes an embedded display
> port (eDP) = display, and I've seen at least one laptop which has the laptop monitor = listed as simply
> Display Port (DP), although that may not have = been an Intel machine.  In the DP case the laptop
> monitor = can't be distinguished from a normal display port monitor.

If the = driver isn't reporting an eDP display as eDP, the driver is = broken.

> The current code I have uses some heuristics to = figure out what outputs are available on the system,
> i.e. checks = for LVDS, then eDP, then DP, and makes a guess as to which one is the = laptop monitor,
> but in some cases, like the DisplayPort case I = described above, it's impossible to know for sure, and
> if a = future release changes the names it will fail.

The names won't = change.  There might be some new embedded display
connectivity = in the future with a new name, but that's something you'd
have to = handle then anyway.

Ideally we'd come up with a way to proxy = laptop lid state into DRM
connector state directly, but a) there's a = lot of broken hardware in the
world and b) the kernel tends to = stridently resist getting anything
right in kernelspace when it's = easier to let people get it wrong in
userspace instead.  Yes I'm = bitter.

- ajax

------_=_NextPart_001_01CCE5D9.0A6A0BF6-- --===============0440733509== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx --===============0440733509==--