diff options
Diffstat (limited to 'sys/dev/pci/drm')
-rw-r--r-- | sys/dev/pci/drm/drmP.h | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_drv.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/drm/drm_irq.c | 4 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_drv.c | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/i915_irq.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/mach64_drv.c | 3 | ||||
-rw-r--r-- | sys/dev/pci/drm/mach64_drv.h | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/mach64_irq.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/mga_drv.c | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/mga_irq.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/r128_drv.c | 2 | ||||
-rw-r--r-- | sys/dev/pci/drm/r128_drv.h | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/r128_irq.c | 5 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon_drv.c | 1 | ||||
-rw-r--r-- | sys/dev/pci/drm/radeon_irq.c | 5 |
15 files changed, 18 insertions, 33 deletions
diff --git a/sys/dev/pci/drm/drmP.h b/sys/dev/pci/drm/drmP.h index bb7237561ae..603b59e6965 100644 --- a/sys/dev/pci/drm/drmP.h +++ b/sys/dev/pci/drm/drmP.h @@ -453,6 +453,7 @@ struct drm_driver_info { int (*irq_postinstall)(struct drm_device *); void (*irq_uninstall)(struct drm_device *); irqreturn_t (*irq_handler)(DRM_IRQ_ARGS); + int vblank_pipes; u_int32_t (*get_vblank_counter)(struct drm_device *, int); int (*enable_vblank)(struct drm_device *, int); void (*disable_vblank)(struct drm_device *, int); diff --git a/sys/dev/pci/drm/drm_drv.c b/sys/dev/pci/drm/drm_drv.c index 3c798cefa30..da2a780f033 100644 --- a/sys/dev/pci/drm/drm_drv.c +++ b/sys/dev/pci/drm/drm_drv.c @@ -125,6 +125,12 @@ drm_attach(struct device *parent, struct device *self, void *aux) drm_mem_init(); TAILQ_INIT(&dev->files); + if (dev->driver->vblank_pipes != 0 && drm_vblank_init(dev, + dev->driver->vblank_pipes)) { + printf(": failed to allocate vblank data\n"); + goto error; + } + /* * the dma buffers api is just weird. offset 1Gb to ensure we don't * conflict with it. @@ -167,10 +173,14 @@ drm_detach(struct device *self, int flags) { struct drm_device *dev = (struct drm_device *)self; + drm_lastclose(dev); + drm_ctxbitmap_cleanup(dev); extent_destroy(dev->handle_ext); + drm_vblank_cleanup(dev); + if (dev->agp && dev->agp->mtrr) { int retcode; @@ -179,7 +189,6 @@ drm_detach(struct device *self, int flags) DRM_DEBUG("mtrr_del = %d", retcode); } - drm_lastclose(dev); if (dev->agp != NULL) { drm_free(dev->agp, sizeof(*dev->agp), DRM_MEM_AGPLISTS); diff --git a/sys/dev/pci/drm/drm_irq.c b/sys/dev/pci/drm/drm_irq.c index bb03f79a2b3..ede6c66baf4 100644 --- a/sys/dev/pci/drm/drm_irq.c +++ b/sys/dev/pci/drm/drm_irq.c @@ -111,7 +111,8 @@ drm_irq_install(struct drm_device *dev) DRM_DEBUG("%s: interrupting at %s\n", dev->device.dv_xname, istr); /* After installing handler */ - dev->driver->irq_postinstall(dev); + if (dev->driver->irq_postinstall != NULL) + dev->driver->irq_postinstall(dev); return 0; err: @@ -141,7 +142,6 @@ drm_irq_uninstall(struct drm_device *dev) pci_intr_disestablish(dev->pa.pa_pc, dev->irqh); - drm_vblank_cleanup(dev); DRM_SPINUNINIT(&dev->irq_lock); return 0; diff --git a/sys/dev/pci/drm/i915_drv.c b/sys/dev/pci/drm/i915_drv.c index 2e128acff15..6425c36f823 100644 --- a/sys/dev/pci/drm/i915_drv.c +++ b/sys/dev/pci/drm/i915_drv.c @@ -95,6 +95,7 @@ static const struct drm_driver_info inteldrm_driver = { .preclose = i915_driver_preclose, .lastclose = i915_driver_lastclose, .device_is_agp = i915_driver_device_is_agp, + .vblank_pipes = 2, .get_vblank_counter = i915_get_vblank_counter, .enable_vblank = i915_enable_vblank, .disable_vblank = i915_disable_vblank, diff --git a/sys/dev/pci/drm/i915_irq.c b/sys/dev/pci/drm/i915_irq.c index 1d6777507ba..567ee14b093 100644 --- a/sys/dev/pci/drm/i915_irq.c +++ b/sys/dev/pci/drm/i915_irq.c @@ -415,11 +415,6 @@ void i915_driver_irq_preinstall(struct drm_device * dev) int i915_driver_irq_postinstall(struct drm_device * dev) { drm_i915_private_t *dev_priv = (drm_i915_private_t *) dev->dev_private; - int ret, num_pipes = 2; - - ret = drm_vblank_init(dev, num_pipes); - if (ret) - return ret; dev->max_vblank_count = 0xffffff; /* only 24 bits of frame count */ diff --git a/sys/dev/pci/drm/mach64_drv.c b/sys/dev/pci/drm/mach64_drv.c index c61231a9afb..9e7446c9ba5 100644 --- a/sys/dev/pci/drm/mach64_drv.c +++ b/sys/dev/pci/drm/mach64_drv.c @@ -71,11 +71,11 @@ static const struct drm_driver_info machdrm_driver = { .buf_priv_size = 1, /* No dev_priv */ .ioctl = machdrm_ioctl, .lastclose = mach64_driver_lastclose, + .vblank_pipes = 1, .get_vblank_counter = mach64_get_vblank_counter, .enable_vblank = mach64_enable_vblank, .disable_vblank = mach64_disable_vblank, .irq_preinstall = mach64_driver_irq_preinstall, - .irq_postinstall = mach64_driver_irq_postinstall, .irq_uninstall = mach64_driver_irq_uninstall, .irq_handler = mach64_driver_irq_handler, .dma_ioctl = mach64_dma_buffers, @@ -90,7 +90,6 @@ static const struct drm_driver_info machdrm_driver = { .flags = DRIVER_AGP | DRIVER_MTRR | DRIVER_PCI_DMA | DRIVER_DMA | DRIVER_SG | DRIVER_IRQ, }; - int machdrm_probe(struct device *parent, void *match, void *aux) { diff --git a/sys/dev/pci/drm/mach64_drv.h b/sys/dev/pci/drm/mach64_drv.h index fb1c4567bb4..7d95fbc0b55 100644 --- a/sys/dev/pci/drm/mach64_drv.h +++ b/sys/dev/pci/drm/mach64_drv.h @@ -168,7 +168,6 @@ extern int mach64_enable_vblank(struct drm_device *dev, int crtc); extern void mach64_disable_vblank(struct drm_device *dev, int crtc); extern irqreturn_t mach64_driver_irq_handler(DRM_IRQ_ARGS); extern void mach64_driver_irq_preinstall(struct drm_device *dev); -extern int mach64_driver_irq_postinstall(struct drm_device *dev); extern void mach64_driver_irq_uninstall(struct drm_device *dev); /* ================================================================ diff --git a/sys/dev/pci/drm/mach64_irq.c b/sys/dev/pci/drm/mach64_irq.c index 0b350b2ffe2..55c2cb14c57 100644 --- a/sys/dev/pci/drm/mach64_irq.c +++ b/sys/dev/pci/drm/mach64_irq.c @@ -141,11 +141,6 @@ void mach64_driver_irq_preinstall(struct drm_device * dev) mach64_disable_vblank_local(dev, 0); } -int mach64_driver_irq_postinstall(struct drm_device * dev) -{ - return drm_vblank_init(dev, 1); -} - void mach64_driver_irq_uninstall(struct drm_device * dev) { drm_mach64_private_t *dev_priv = dev->dev_private; diff --git a/sys/dev/pci/drm/mga_drv.c b/sys/dev/pci/drm/mga_drv.c index dad674091fd..776a0d5e7ba 100644 --- a/sys/dev/pci/drm/mga_drv.c +++ b/sys/dev/pci/drm/mga_drv.c @@ -106,6 +106,7 @@ static const struct drm_driver_info mga_driver = { .buf_priv_size = sizeof(drm_mga_buf_priv_t), .ioctl = mgadrm_ioctl, .lastclose = mga_driver_lastclose, + .vblank_pipes = 1, .enable_vblank = mga_enable_vblank, .disable_vblank = mga_disable_vblank, .get_vblank_counter = mga_get_vblank_counter, diff --git a/sys/dev/pci/drm/mga_irq.c b/sys/dev/pci/drm/mga_irq.c index 4783e65eb29..a4ed2b18546 100644 --- a/sys/dev/pci/drm/mga_irq.c +++ b/sys/dev/pci/drm/mga_irq.c @@ -154,11 +154,6 @@ void mga_driver_irq_preinstall(struct drm_device * dev) int mga_driver_irq_postinstall(struct drm_device * dev) { drm_mga_private_t *dev_priv = (drm_mga_private_t *) dev->dev_private; - int ret; - - ret = drm_vblank_init(dev, 1); - if (ret) - return ret; /* Turn on soft trap interrupt. Vertical blank interrupts are enabled * in mga_enable_vblank. diff --git a/sys/dev/pci/drm/r128_drv.c b/sys/dev/pci/drm/r128_drv.c index e04c7fee4a3..d864567a97e 100644 --- a/sys/dev/pci/drm/r128_drv.c +++ b/sys/dev/pci/drm/r128_drv.c @@ -87,11 +87,11 @@ static const struct drm_driver_info ragedrm_driver = { .ioctl = ragedrm_ioctl, .preclose = r128_driver_preclose, .lastclose = r128_driver_lastclose, + .vblank_pipes = 1, .get_vblank_counter = r128_get_vblank_counter, .enable_vblank = r128_enable_vblank, .disable_vblank = r128_disable_vblank, .irq_preinstall = r128_driver_irq_preinstall, - .irq_postinstall = r128_driver_irq_postinstall, .irq_uninstall = r128_driver_irq_uninstall, .irq_handler = r128_driver_irq_handler, .dma_ioctl = r128_cce_buffers, diff --git a/sys/dev/pci/drm/r128_drv.h b/sys/dev/pci/drm/r128_drv.h index 08df6195960..37d697e2930 100644 --- a/sys/dev/pci/drm/r128_drv.h +++ b/sys/dev/pci/drm/r128_drv.h @@ -166,7 +166,6 @@ extern void r128_disable_vblank(struct drm_device *dev, int crtc); extern u32 r128_get_vblank_counter(struct drm_device *dev, int crtc); extern irqreturn_t r128_driver_irq_handler(DRM_IRQ_ARGS); extern void r128_driver_irq_preinstall(struct drm_device * dev); -extern int r128_driver_irq_postinstall(struct drm_device * dev); extern void r128_driver_irq_uninstall(struct drm_device * dev); extern void r128_driver_lastclose(struct drm_device * dev); extern void r128_driver_preclose(struct drm_device * dev, diff --git a/sys/dev/pci/drm/r128_irq.c b/sys/dev/pci/drm/r128_irq.c index 5b95bd898f9..50f1f08920d 100644 --- a/sys/dev/pci/drm/r128_irq.c +++ b/sys/dev/pci/drm/r128_irq.c @@ -100,11 +100,6 @@ void r128_driver_irq_preinstall(struct drm_device * dev) R128_WRITE(R128_GEN_INT_STATUS, R128_CRTC_VBLANK_INT_AK); } -int r128_driver_irq_postinstall(struct drm_device * dev) -{ - return drm_vblank_init(dev, 1); -} - void r128_driver_irq_uninstall(struct drm_device * dev) { drm_r128_private_t *dev_priv = (drm_r128_private_t *) dev->dev_private; diff --git a/sys/dev/pci/drm/radeon_drv.c b/sys/dev/pci/drm/radeon_drv.c index e8407f94f93..337101a30a4 100644 --- a/sys/dev/pci/drm/radeon_drv.c +++ b/sys/dev/pci/drm/radeon_drv.c @@ -484,6 +484,7 @@ static const struct drm_driver_info radeondrm_driver = { .preclose = radeon_driver_preclose, .postclose = radeon_driver_postclose, .lastclose = radeon_driver_lastclose, + .vblank_pipes = 2, .get_vblank_counter = radeon_get_vblank_counter, .enable_vblank = radeon_enable_vblank, .disable_vblank = radeon_disable_vblank, diff --git a/sys/dev/pci/drm/radeon_irq.c b/sys/dev/pci/drm/radeon_irq.c index 956d4a37438..f0255e28017 100644 --- a/sys/dev/pci/drm/radeon_irq.c +++ b/sys/dev/pci/drm/radeon_irq.c @@ -339,14 +339,9 @@ int radeon_driver_irq_postinstall(struct drm_device * dev) { drm_radeon_private_t *dev_priv = (drm_radeon_private_t *) dev->dev_private; - int ret; atomic_set(&dev_priv->swi_emitted, 0); - ret = drm_vblank_init(dev, 2); - if (ret) - return ret; - dev->max_vblank_count = 0x001fffff; radeon_irq_set_state(dev, RADEON_SW_INT_ENABLE, 1); |