From: Thomas Renninger <trenn@suse.de>
To: linux-acpi <linux-acpi@vger.kernel.org>
Cc: Len Brown <lenb@kernel.org>, "Li, Shaohua" <shaohua.li@intel.com>,
Christian Birchinger <joker@netswarm.net>,
ibm-acpi-devel <ibm-acpi-devel@lists.sourceforge.net>
Subject: [PATCH 2/2] Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it
Date: Mon, 15 Oct 2007 18:33:15 +0200 [thread overview]
Message-ID: <1192465995.9847.587.camel@queen.suse.de> (raw)
Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it
Those laptops define one grahpics device on a PCI Express (e.g. Internal Intel
965 card) and one on a separate PCI bus (via a PCI root bridge, e.g. in AGP
case for an Nvidia graphics card).
PCI devices need to be enumerated and checked whether on the ACPI video device
a graphics card is really connected to.
This patch only checks whether a PCI device exists (could also be a PCI bridge).
To really get the pci_dev struct and check it whether it really is of class
"graphics card" or to further make use of it in this driver, it must be checked
what got set up behind a possilbe bridge.
Signed-off-by: Thomas Renninger <trenn@suse.de>
---
drivers/acpi/video.c | 20 ++++++++++++++++++++
1 file changed, 20 insertions(+)
Index: lenb/drivers/acpi/video.c
===================================================================
--- lenb.orig/drivers/acpi/video.c
+++ lenb/drivers/acpi/video.c
@@ -34,6 +34,8 @@
#include <linux/input.h>
#include <linux/backlight.h>
#include <linux/video_output.h>
+#include <linux/pci.h>
+#include <linux/acpi.h>
#include <asm/uaccess.h>
#include <acpi/acpi_bus.h>
@@ -1901,11 +1903,29 @@ static int acpi_video_bus_add(struct acp
acpi_status status = 0;
struct acpi_video_bus *video = NULL;
struct input_dev *input;
+ struct pci_dev *pci = NULL;
if (!device)
return -EINVAL;
+ /* TBD(trenn):
+ * Check against pci->class whether we have a graphics device
+ * If we have a bridge, find out the bus no. it is associated
+ * to and check whether there a graphics device sits.
+ *
+ * Not sure whether this is needed, maybe it's enough to find out
+ * whether there is a PCI device registered at as done now,
+ * but it might be helpful for the video module to access the
+ * video device's struct pci_dev* structure.
+ */
+ result = acpi_find_pci_device(device, pci);
+ if (result < 0) {
+ printk (KERN_DEBUG PREFIX "Video device %s not physically"
+ " connected, ignoring\n", acpi_device_bid(device));
+ return -ENODEV;
+ }
+
video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL);
if (!video)
return -ENOMEM;
next reply other threads:[~2007-10-15 16:33 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-10-15 16:33 Thomas Renninger [this message]
[not found] ` <1192465995.9847.587.camel-X8wR35IVlAxolqkO4TVVkw@public.gmane.org>
2007-10-16 17:50 ` [PATCH 2/2] Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it Christian Birchinger
2007-10-16 18:09 ` Maik Broemme
2007-10-17 8:25 ` Thomas Renninger
2007-10-17 10:12 ` Maik Broemme
2007-10-17 10:40 ` Thomas Renninger
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=1192465995.9847.587.camel@queen.suse.de \
--to=trenn@suse.de \
--cc=ibm-acpi-devel@lists.sourceforge.net \
--cc=joker@netswarm.net \
--cc=lenb@kernel.org \
--cc=linux-acpi@vger.kernel.org \
--cc=shaohua.li@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