diff options
author | Robert Noland <rnoland@2hip.net> | 2007-12-01 17:09:49 -0500 |
---|---|---|
committer | Robert Noland <rnoland@2hip.net> | 2007-12-01 17:23:09 -0500 |
commit | 787d500c15c964f2a715ea0c949177c1d38dc367 (patch) | |
tree | 24d40b34fc590eede7fd2cb96797cd0c076296be | |
parent | e6ca3f5754d649b6290ea017f815aeb18d565718 (diff) |
bsd: Hook secondary vblank support.
-rw-r--r-- | bsd-core/drmP.h | 1 | ||||
-rw-r--r-- | bsd-core/drm_irq.c | 10 | ||||
-rw-r--r-- | bsd-core/i915_drv.c | 1 | ||||
-rw-r--r-- | bsd-core/radeon_drv.c | 1 |
4 files changed, 11 insertions, 2 deletions
diff --git a/bsd-core/drmP.h b/bsd-core/drmP.h index d90660a3..243a984c 100644 --- a/bsd-core/drmP.h +++ b/bsd-core/drmP.h @@ -650,6 +650,7 @@ struct drm_driver_info { void (*irq_uninstall)(drm_device_t *dev); void (*irq_handler)(DRM_IRQ_ARGS); int (*vblank_wait)(drm_device_t *dev, unsigned int *sequence); + int (*vblank_wait2)(drm_device_t *dev, unsigned int *sequence); drm_pci_id_list_t *id_entry; /* PCI ID, name, and chipset private */ diff --git a/bsd-core/drm_irq.c b/bsd-core/drm_irq.c index 0772445a..a58307c5 100644 --- a/bsd-core/drm_irq.c +++ b/bsd-core/drm_irq.c @@ -244,8 +244,14 @@ int drm_wait_vblank(drm_device_t *dev, void *data, struct drm_file *file_priv) } else { DRM_LOCK(); /* shared code returns -errno */ - ret = -dev->driver.vblank_wait(dev, - &vblwait->request.sequence); + if (flags & _DRM_VBLANK_SECONDARY) { + if (dev->driver.vblank_wait2) + ret = -dev->driver.vblank_wait2(dev, + &vblwait->request.sequence); + } else if (dev->driver.vblank_wait) + ret = -dev->driver.vblank_wait(dev, + &vblwait->request.sequence); + DRM_UNLOCK(); microtime(&now); diff --git a/bsd-core/i915_drv.c b/bsd-core/i915_drv.c index 89a1eb70..5150cf9f 100644 --- a/bsd-core/i915_drv.c +++ b/bsd-core/i915_drv.c @@ -48,6 +48,7 @@ static void i915_configure(drm_device_t *dev) dev->driver.lastclose = i915_driver_lastclose; dev->driver.device_is_agp = i915_driver_device_is_agp; dev->driver.vblank_wait = i915_driver_vblank_wait; + dev->driver.vblank_wait2 = i915_driver_vblank_wait2; dev->driver.irq_preinstall = i915_driver_irq_preinstall; dev->driver.irq_postinstall = i915_driver_irq_postinstall; dev->driver.irq_uninstall = i915_driver_irq_uninstall; diff --git a/bsd-core/radeon_drv.c b/bsd-core/radeon_drv.c index f66bc795..114b98dd 100644 --- a/bsd-core/radeon_drv.c +++ b/bsd-core/radeon_drv.c @@ -53,6 +53,7 @@ static void radeon_configure(drm_device_t *dev) dev->driver.postclose = radeon_driver_postclose; dev->driver.lastclose = radeon_driver_lastclose; dev->driver.vblank_wait = radeon_driver_vblank_wait; + dev->driver.vblank_wait2 = radeon_driver_vblank_wait2; dev->driver.irq_preinstall = radeon_driver_irq_preinstall; dev->driver.irq_postinstall = radeon_driver_irq_postinstall; dev->driver.irq_uninstall = radeon_driver_irq_uninstall; |