diff options
author | Dave Airlie <airlied@redhat.com> | 2008-11-03 09:44:03 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-11-03 09:44:03 +1000 |
commit | 31f8d4218c0f6455751d8bbc788172912359b0df (patch) | |
tree | 4db56878fc880906dc9c5f53b1bfb9377fd6d443 /linux-core | |
parent | fc25c81eab2d847c854e0a44cae29f8c2213bba6 (diff) |
radeon: add wait rendering API
Diffstat (limited to 'linux-core')
-rw-r--r-- | linux-core/radeon_gem.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/linux-core/radeon_gem.c b/linux-core/radeon_gem.c index ce33979e..f5d6b94a 100644 --- a/linux-core/radeon_gem.c +++ b/linux-core/radeon_gem.c @@ -416,14 +416,33 @@ int radeon_gem_busy(struct drm_device *dev, void *data, return 0; } -int radeon_gem_execbuffer(struct drm_device *dev, void *data, - struct drm_file *file_priv) +int radeon_gem_wait_rendering(struct drm_device *dev, void *data, + struct drm_file *file_priv) { - return -ENOSYS; + struct drm_radeon_gem_wait_rendering *args = data; + struct drm_gem_object *obj; + struct drm_radeon_gem_object *obj_priv; + int ret; + + + obj = drm_gem_object_lookup(dev, file_priv, args->handle); + if (obj == NULL) + return -EINVAL; + obj_priv = obj->driver_private; + mutex_lock(&obj_priv->bo->mutex); + ret = drm_bo_wait(obj_priv->bo, 0, 1, 1, 0); + mutex_unlock(&obj_priv->bo->mutex); + + mutex_lock(&dev->struct_mutex); + drm_gem_object_unreference(obj); + mutex_unlock(&dev->struct_mutex); + return ret; } + + /* * Depending on card genertation, chipset bugs, etc... the amount of vram * accessible to the CPU can vary. This function is our best shot at figuring |