From ec3e11dc526f447eb9ff75bbd7ed3f4f8b30231c Mon Sep 17 00:00:00 2001 From: anholt Date: Sat, 3 Dec 2005 01:23:50 +0000 Subject: [PATCH] Merge DRM CVS as of 2005-12-02, adding i915 DRM support thanks to Alexey Popov, and a new r300 PCI ID. --- sys/amd64/conf/NOTES | 1 + sys/conf/files | 4 ++++ sys/dev/drm/drm_drv.c | 13 +++++++++---- sys/dev/drm/drm_pciids.h | 1 + sys/dev/drm/i915_drv.c | 2 +- sys/i386/conf/NOTES | 1 + sys/modules/drm/Makefile | 1 + 7 files changed, 18 insertions(+), 5 deletions(-) diff --git a/sys/amd64/conf/NOTES b/sys/amd64/conf/NOTES index 2a90df515b7..cdb8d66edce 100644 --- a/sys/amd64/conf/NOTES +++ b/sys/amd64/conf/NOTES @@ -204,6 +204,7 @@ device cpufreq # Direct Rendering modules for 3D acceleration. device drm # DRM core module required by DRM drivers +device i915drm # Intel i830 through i915 device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL device mgadrm # AGP Matrox G200, G400, G450, G550 device r128drm # ATI Rage 128 diff --git a/sys/conf/files b/sys/conf/files index 6e6832cc847..f7efe09c15d 100644 --- a/sys/conf/files +++ b/sys/conf/files @@ -535,6 +535,10 @@ dev/drm/drm_pci.c optional drm dev/drm/drm_scatter.c optional drm dev/drm/drm_sysctl.c optional drm dev/drm/drm_vm.c optional drm +dev/drm/i915_dma.c optional i915drm +dev/drm/i915_drv.c optional i915drm +dev/drm/i915_irq.c optional i915drm +dev/drm/i915_mem.c optional i915drm dev/drm/mach64_dma.c optional mach64drm dev/drm/mach64_drv.c optional mach64drm dev/drm/mach64_irq.c optional mach64drm diff --git a/sys/dev/drm/drm_drv.c b/sys/dev/drm/drm_drv.c index 1801bee266a..eb9c644661e 100644 --- a/sys/dev/drm/drm_drv.c +++ b/sys/dev/drm/drm_drv.c @@ -153,9 +153,14 @@ int drm_probe(device_t dev, drm_pci_id_list_t *idlist) { drm_pci_id_list_t *id_entry; int vendor, device; + device_t realdev; - vendor = pci_get_vendor(dev); - device = pci_get_device(dev); + if (!strcmp(device_get_name(dev), "drmsub")) + realdev = device_get_parent(dev); + else + realdev = dev; + vendor = pci_get_vendor(realdev); + device = pci_get_device(realdev); id_entry = drm_find_description(vendor, device, idlist); if (id_entry != NULL) { @@ -190,8 +195,8 @@ int drm_attach(device_t nbdev, drm_pci_id_list_t *idlist) mtx_init(&dev->dev_lock, "drm device", NULL, MTX_DEF); #endif - id_entry = drm_find_description(pci_get_vendor(nbdev), - pci_get_device(nbdev), idlist); + id_entry = drm_find_description(pci_get_vendor(dev->device), + pci_get_device(dev->device), idlist); dev->id_entry = id_entry; return drm_load(dev); diff --git a/sys/dev/drm/drm_pciids.h b/sys/dev/drm/drm_pciids.h index d0868a5bed7..42e9a09f898 100644 --- a/sys/dev/drm/drm_pciids.h +++ b/sys/dev/drm/drm_pciids.h @@ -93,6 +93,7 @@ {0x1002, 0x5c63, CHIP_RV280|CHIP_IS_MOBILITY, "ATI Radeon RV280 Mobility"}, \ {0x1002, 0x5c64, CHIP_RV280, "ATI Radeon RV280"}, \ {0x1002, 0x5d4d, CHIP_R350, "ATI Radeon R480"}, \ + {0x1002, 0x5e4b, CHIP_R420, "ATI Radeon RV410 X700PRO"}, \ {0, 0, 0, NULL} #define r128_PCI_IDS \ diff --git a/sys/dev/drm/i915_drv.c b/sys/dev/drm/i915_drv.c index 3a632d4b8ef..f2ab3940be0 100644 --- a/sys/dev/drm/i915_drv.c +++ b/sys/dev/drm/i915_drv.c @@ -104,7 +104,7 @@ static driver_t i915_driver = { }; extern devclass_t drm_devclass; -DRIVER_MODULE(i915, pci, i915_driver, drm_devclass, 0, 0); +DRIVER_MODULE(i915, agp, i915_driver, drm_devclass, 0, 0); MODULE_DEPEND(i915, drm, 1, 1, 1); #elif defined(__NetBSD__) || defined(__OpenBSD__) diff --git a/sys/i386/conf/NOTES b/sys/i386/conf/NOTES index 347b43c1267..6e4d7019025 100644 --- a/sys/i386/conf/NOTES +++ b/sys/i386/conf/NOTES @@ -467,6 +467,7 @@ device cpufreq # Direct Rendering modules for 3D acceleration. device drm # DRM core module required by DRM drivers +device i915drm # Intel i830 through i915 device mach64drm # ATI Rage Pro, Rage Mobility P/M, Rage XL device mgadrm # AGP Matrox G200, G400, G450, G550 device r128drm # ATI Rage 128 diff --git a/sys/modules/drm/Makefile b/sys/modules/drm/Makefile index b2cfa040a1f..a953b3700eb 100644 --- a/sys/modules/drm/Makefile +++ b/sys/modules/drm/Makefile @@ -2,6 +2,7 @@ SUBDIR = \ drm \ + i915 \ mach64 \ mga \ r128 \ -- 2.45.0