From 751765dba5b15f431a12308e09237d895c65e471 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Mon, 6 Jun 2005 06:45:41 +0000 Subject: Add a few more bits of Tonnerre's NetBSD port (Still need to deal with the device attachment). --- bsd-core/drm_drv.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'bsd-core/drm_drv.c') diff --git a/bsd-core/drm_drv.c b/bsd-core/drm_drv.c index 71fcb7c8..44a6c85a 100644 --- a/bsd-core/drm_drv.c +++ b/bsd-core/drm_drv.c @@ -202,7 +202,7 @@ MOD_DEV("drm", LM_DT_CHAR, CDEV_MAJOR, &drm_cdevsw); int drm_lkmentry(struct lkm_table *lkmtp, int cmd, int ver); static int drm_lkmhandle(struct lkm_table *lkmtp, int cmd); -int drm_modprobe(); +int drm_modprobe(void); int drm_probe(struct pci_attach_args *pa); void drm_attach(struct pci_attach_args *pa, dev_t kdev); @@ -212,10 +212,7 @@ int drm_lkmentry(struct lkm_table *lkmtp, int cmd, int ver) { static int drm_lkmhandle(struct lkm_table *lkmtp, int cmd) { - int j, error = 0; -#if defined(__NetBSD__) && (__NetBSD_Version__ > 106080000) - struct lkm_dev *args = lkmtp->private.lkm_dev; -#endif + int error = 0; switch(cmd) { case LKM_E_LOAD: @@ -242,7 +239,8 @@ static int drm_lkmhandle(struct lkm_table *lkmtp, int cmd) return error; } -int drm_modprobe() { +int drm_modprobe(void) +{ struct pci_attach_args pa; int error; @@ -279,6 +277,13 @@ void drm_attach(struct pci_attach_args *pa, dev_t kdev, memset(dev, 0, sizeof(drm_device_t)); memcpy(&dev->pa, pa, sizeof(dev->pa)); + dev->irq = pa->pa_intrline; + dev->pci_domain = 0; + dev->pci_bus = pa->pa_bus; + dev->pci_slot = pa->pa_device; + dev->pci_func = pa->pa_function; + dev->dma_tag = pa->pa_dmat; + DRM_INFO("%s", drm_find_description(PCI_VENDOR(pa->pa_id), PCI_PRODUCT(pa->pa_id), idlist)); drm_init(dev); } -- cgit v1.2.3