From e0f53e59be4b96ed6eb28bd2df9f6a9d789d1734 Mon Sep 17 00:00:00 2001 From: Thomas Hellstrom Date: Fri, 16 Feb 2007 20:22:24 +0100 Subject: Simple fence object sample driver for via, based on idling the GPU. Buffer object driver for via. Some changes to buffer object driver callbacks. Improve fence flushing. --- shared-core/via_map.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'shared-core/via_map.c') diff --git a/shared-core/via_map.c b/shared-core/via_map.c index a37f5fd2..83324cfa 100644 --- a/shared-core/via_map.c +++ b/shared-core/via_map.c @@ -28,6 +28,7 @@ static int via_do_init_map(drm_device_t * dev, drm_via_init_t * init) { drm_via_private_t *dev_priv = dev->dev_private; + int ret = 0; DRM_DEBUG("%s\n", __FUNCTION__); @@ -64,8 +65,22 @@ static int via_do_init_map(drm_device_t * dev, drm_via_init_t * init) #ifdef VIA_HAVE_DMABLIT via_init_dmablit( dev ); #endif +#ifdef VIA_HAVE_FENCE + dev_priv->emit_0_sequence = 0; + dev_priv->have_idlelock = 0; + spin_lock_init(&dev_priv->fence_lock); + init_timer(&dev_priv->fence_timer); + dev_priv->fence_timer.function = &via_fence_timer; + dev_priv->fence_timer.data = (unsigned long) dev; +#endif /* VIA_HAVE_FENCE */ dev->dev_private = (void *)dev_priv; - return 0; +#ifdef VIA_HAVE_BUFFER + ret = drm_bo_driver_init(dev); + if (ret) + DRM_ERROR("Could not initialize buffer object driver.\n"); +#endif + return ret; + } int via_do_cleanup_map(drm_device_t * dev) -- cgit v1.2.3