aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/drm
diff options
context:
space:
mode:
authorRobert Noland <rnoland@FreeBSD.org>2009-04-19 16:54:33 +0000
committerRobert Noland <rnoland@FreeBSD.org>2009-04-19 16:54:33 +0000
commit8f6d3bf7a2fe2760ab90f09ea28e3a11f5511fc2 (patch)
tree43daf02f5ebbe9334233627f1e636ac2e56fccf6 /sys/dev/drm
parentc0020399a650364d0134f79f3fa319f84064372d (diff)
Notes
Diffstat (limited to 'sys/dev/drm')
-rw-r--r--sys/dev/drm/drm_drv.c39
1 files changed, 21 insertions, 18 deletions
diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c
index 161212088e21..dca4feabfc64 100644
--- a/sys/dev/drm/drm_drv.c
+++ b/sys/dev/drm/drm_drv.c
@@ -134,7 +134,7 @@ static struct cdevsw drm_cdevsw = {
.d_flags = D_TRACKCLOSE
};
-int drm_msi = 1; /* Enable by default. */
+static int drm_msi = 1; /* Enable by default. */
TUNABLE_INT("hw.drm.msi", &drm_msi);
static struct drm_msi_blacklist_entry drm_msi_blacklist[] = {
@@ -228,27 +228,30 @@ int drm_attach(device_t kdev, drm_pci_id_list_t *idlist)
dev->pci_vendor = pci_get_vendor(dev->device);
dev->pci_device = pci_get_device(dev->device);
- if (drm_msi &&
- !drm_msi_is_blacklisted(dev->pci_vendor, dev->pci_device)) {
- msicount = pci_msi_count(dev->device);
- DRM_DEBUG("MSI count = %d\n", msicount);
- if (msicount > 1)
- msicount = 1;
+ if (drm_core_check_feature(dev, DRIVER_HAVE_IRQ)) {
+ if (drm_msi &&
+ !drm_msi_is_blacklisted(dev->pci_vendor, dev->pci_device)) {
+ msicount = pci_msi_count(dev->device);
+ DRM_DEBUG("MSI count = %d\n", msicount);
+ if (msicount > 1)
+ msicount = 1;
- if (pci_alloc_msi(dev->device, &msicount) == 0) {
- DRM_INFO("MSI enabled %d message(s)\n", msicount);
- dev->msi_enabled = 1;
- dev->irqrid = 1;
+ if (pci_alloc_msi(dev->device, &msicount) == 0) {
+ DRM_INFO("MSI enabled %d message(s)\n",
+ msicount);
+ dev->msi_enabled = 1;
+ dev->irqrid = 1;
+ }
}
- }
- dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ,
- &dev->irqrid, RF_SHAREABLE);
- if (!dev->irqr) {
- return ENOENT;
- }
+ dev->irqr = bus_alloc_resource_any(dev->device, SYS_RES_IRQ,
+ &dev->irqrid, RF_SHAREABLE);
+ if (!dev->irqr) {
+ return ENOENT;
+ }
- dev->irq = (int) rman_get_start(dev->irqr);
+ dev->irq = (int) rman_get_start(dev->irqr);
+ }
mtx_init(&dev->dev_lock, "drmdev", NULL, MTX_DEF);
mtx_init(&dev->irq_lock, "drmirq", NULL, MTX_DEF);