From: "Lee, Chun-Yi" <joeyli.kernel@gmail.com>
To: mjg@redhat.com
Cc: linux-kernel@vger.kernel.org, gregkh@suse.de, jlee@novell.com,
Dennis.Jansen@web.de, linux-acpi@vger.kernel.org, trenn@suse.de
Subject: [PATCH] Add intel drm blacklist to intel_opregion_present detect
Date: Mon, 23 Aug 2010 19:40:48 +0800 [thread overview]
Message-ID: <1282563648-21935-1-git-send-email-jlee@novell.com> (raw)
There have some machines not support by i915 drm driver, e.g. MSI U110/U150,
there are use poulsbo chip and drm driver not support it because legal issue.
Those machines's acpi backlight control actually work fine and don't need apply
the intel opregion support.
So, add intel drm blacklist to intel_opregion_present, it can enable the acpi
brightness interface on Poulsbo/Morrestown.
Signed-off-by: Lee, Chun-Yi <jlee@novell.com>
---
drivers/acpi/video.c | 26 +++++++++++++++++++++++++-
include/linux/pci_ids.h | 10 ++++++++++
2 files changed, 35 insertions(+), 1 deletions(-)
diff --git a/drivers/acpi/video.c b/drivers/acpi/video.c
index 67dec0c..de16769 100644
--- a/drivers/acpi/video.c
+++ b/drivers/acpi/video.c
@@ -88,6 +88,20 @@ static int acpi_video_bus_add(struct acpi_device *device);
static int acpi_video_bus_remove(struct acpi_device *device, int type);
static void acpi_video_bus_notify(struct acpi_device *device, u32 event);
+static const struct pci_device_id intel_drm_blacklist[] = {
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_VGA_0) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_SCH_VGA_1) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_0) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_1) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_2) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_3) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_4) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_5) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_6) },
+ { PCI_DEVICE(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_MRST_VGA_7) },
+ { } /* Terminating entry */
+};
+
static const struct acpi_device_id video_device_ids[] = {
{ACPI_VIDEO_HID, 0},
{"", 0},
@@ -2558,8 +2572,11 @@ static int __init intel_opregion_present(void)
#if defined(CONFIG_DRM_I915) || defined(CONFIG_DRM_I915_MODULE)
struct pci_dev *dev = NULL;
u32 address;
+ int i;
+ bool in_blacklist;
for_each_pci_dev(dev) {
+ in_blacklist = 0;
if ((dev->class >> 8) != PCI_CLASS_DISPLAY_VGA)
continue;
if (dev->vendor != PCI_VENDOR_ID_INTEL)
@@ -2567,7 +2584,14 @@ static int __init intel_opregion_present(void)
pci_read_config_dword(dev, 0xfc, &address);
if (!address)
continue;
- return 1;
+ for (i = 0; intel_drm_blacklist[i].device != 0; i++) {
+ if (dev->device == intel_drm_blacklist[i].device) {
+ in_blacklist = 1;
+ break;
+ }
+ }
+ if (!in_blacklist)
+ return 1;
}
#endif
return 0;
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index f6a3b2d..d7866d0 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2675,6 +2675,8 @@
#define PCI_DEVICE_ID_INTEL_82443GX_0 0x71a0
#define PCI_DEVICE_ID_INTEL_82443GX_2 0x71a2
#define PCI_DEVICE_ID_INTEL_82372FB_1 0x7601
+#define PCI_DEVICE_ID_INTEL_SCH_VGA_0 0x8108
+#define PCI_DEVICE_ID_INTEL_SCH_VGA_1 0x8109
#define PCI_DEVICE_ID_INTEL_SCH_LPC 0x8119
#define PCI_DEVICE_ID_INTEL_SCH_IDE 0x811a
#define PCI_DEVICE_ID_INTEL_82454GX 0x84c4
@@ -2685,6 +2687,14 @@
#define PCI_DEVICE_ID_INTEL_IXP4XX 0x8500
#define PCI_DEVICE_ID_INTEL_IXP2800 0x9004
#define PCI_DEVICE_ID_INTEL_S21152BB 0xb152
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_0 0x4100
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_1 0x4101
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_2 0x4102
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_3 0x4103
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_4 0x4104
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_5 0x4105
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_6 0x4106
+#define PCI_DEVICE_ID_INTEL_MRST_VGA_7 0x4107
#define PCI_VENDOR_ID_SCALEMP 0x8686
#define PCI_DEVICE_ID_SCALEMP_VSMP_CTL 0x1010
--
1.6.0.2
next reply other threads:[~2010-08-23 11:42 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-23 11:40 Lee, Chun-Yi [this message]
2010-08-23 11:49 ` Matthew Garrett
2010-08-23 17:53 ` Thomas Renninger
2010-08-23 17:51 ` Matthew Garrett
2010-08-23 14:18 ` Thomas Renninger
-- strict thread matches above, loose matches on Subject: below --
2010-08-25 9:52 Joey Lee
2010-08-24 14:51 Joey Lee
2010-08-24 10:08 Joey Lee
2010-08-24 14:20 ` Matthew Garrett
2010-08-24 14:22 ` Matthew Garrett
2010-08-24 14:51 ` Greg KH
2010-08-24 14:58 ` Matthew Garrett
2010-08-24 21:35 ` Greg KH
2010-08-24 7:03 Joey Lee
2010-08-24 4:53 Joey Lee
2010-08-23 12:43 Joey Lee
2010-07-13 8:13 Joey Lee
2010-07-12 15:12 Joey Lee
2010-07-12 15:19 ` Matthew Garrett
2010-07-11 0:30 Lee, Chun-Yi
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=1282563648-21935-1-git-send-email-jlee@novell.com \
--to=joeyli.kernel@gmail.com \
--cc=Dennis.Jansen@web.de \
--cc=gregkh@suse.de \
--cc=jlee@novell.com \
--cc=linux-acpi@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mjg@redhat.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
all inboxes | Powered by JetHome®