From: Matthew Garrett <mjg59@srcf.ucam.org>
To: Thomas Renninger <trenn@suse.de>
Cc: linux-acpi <linux-acpi@vger.kernel.org>,
Len Brown <lenb@kernel.org>, Andrew Morton <akpm@osdl.org>,
"Li, Shaohua" <shaohua.li@intel.com>
Subject: Re: [PATCH] Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it
Date: Thu, 17 Jan 2008 03:11:56 +0000 [thread overview]
Message-ID: <20080117031154.GA26703@srcf.ucam.org> (raw)
In-Reply-To: <1197290906.28990.329.camel@queen.suse.de>
I've had more time to look at this now. Let's take one of the most
pathological cases, the Dell d610. It's available with either Intel or
ATI graphics. The DSDT declares three video devices. Two are called VID,
the third is called VID2. I'll call the first two VID(a) and VID(b) to
reduce confusion.
The layout is as follows:
host bridge (_ADR 0x00)
|
|
/ \
/ \
AGP (_ADR 0x00010000) |
| / \
| / \
VID(a) (_ADR 0x00) / \
VID(b) (_ADR 0x00020000) VID2 (_ADR 0x00020001)
If we call acpi_get_physical_device on VID(a), we'll get nothing - there
isn't a corresponding physical device. Therefore we have to call it on
the parent, and so will get the AGP bridge if the machine is configured
that way. If not, we can be sure that VID(a) doesn't exist.
If we call acpi_get_physical_device on VID(b), then either the device
exists and we get something, or the device doesn't exist and we don't.
In the second case, how do we distinguish between that being because the
device doesn't exist and that being because the physical device is the
parent? If we call acpi_get_physical_device on the parent of VID(b),
then we'll hit the host bridge and we'll get a PCI device back. This
then looks almost identical to the AGP bridge case.
There are two things we can do here. The first is to examine the _ADR
field and use that to determine whether we should look at the parent or
not (if it's parsable as a PCI address, look at the current device. If
not, look at the parent device). The second is to always look at the
parent device and ignore it if the host bridge is returned.
I think the first approach is probably better, since it doesn't result
in us depending on the vagueries of bus topology. However, I'm concerned
about the inherent assumption it makes about video devices being
PCI-like. That's true now, but I'm aware of at least one forthcoming
platform where that may not be the case. The spec certainly doesn't
require it. I'll try to come up with a patch in any case.
--
Matthew Garrett | mjg59@srcf.ucam.org
next prev parent reply other threads:[~2008-01-17 3:12 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-07 12:55 [PATCH] Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it Thomas Renninger
2007-12-07 15:27 ` Thomas Renninger
2007-12-07 22:50 ` Matthew Garrett
2007-12-10 12:48 ` Thomas Renninger
2008-01-17 3:11 ` Matthew Garrett [this message]
2008-01-17 3:39 ` [PATCH] Ignore ACPI video devices that aren't present in hardware Matthew Garrett
2008-01-17 10:57 ` Thomas Renninger
2008-01-17 12:02 ` Matthew Garrett
2008-01-22 8:52 ` Zhang Rui
2008-01-22 12:11 ` Julian Sikorski
2008-01-24 22:21 ` Len Brown
2008-01-27 2:09 ` Matthew Garrett
2008-02-02 7:12 ` Len Brown
2008-02-03 0:03 ` Matthew Garrett
2008-02-07 1:44 ` Matthew Garrett
2008-02-07 7:03 ` Len Brown
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=20080117031154.GA26703@srcf.ucam.org \
--to=mjg59@srcf.ucam.org \
--cc=akpm@osdl.org \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=shaohua.li@intel.com \
--cc=trenn@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;
as well as URLs for NNTP newsgroup(s).