diff options
author | Dave Airlie <airlied@redhat.com> | 2008-10-06 16:40:20 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2008-10-06 16:40:20 +1000 |
commit | 4a4d7727c6c6eff4cf19d5debb91a6fcac555832 (patch) | |
tree | 5eed5788798180817e947ac722d2c27edb8a5fd1 | |
parent | a981a6860365065682f3ca295939e629b989a9d1 (diff) |
radeon: fix pin ioctl interface to mesa can find offset for pinned buffers
-rw-r--r-- | linux-core/radeon_gem.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/linux-core/radeon_gem.c b/linux-core/radeon_gem.c index 8c6f836f..b9c3b80d 100644 --- a/linux-core/radeon_gem.c +++ b/linux-core/radeon_gem.c @@ -347,8 +347,9 @@ int radeon_gem_pin_ioctl(struct drm_device *dev, void *data, flags |= DRM_BO_FLAG_MEM_TT; else if (args->pin_domain == RADEON_GEM_DOMAIN_VRAM) flags |= DRM_BO_FLAG_MEM_VRAM; - else - return -EINVAL; + else /* hand back the offset we currently have if no args supplied + - this is to allow old mesa to work - its a hack */ + flags = 0; } obj = drm_gem_object_lookup(dev, file_priv, args->handle); @@ -359,11 +360,11 @@ int radeon_gem_pin_ioctl(struct drm_device *dev, void *data, /* validate into a pin with no fence */ DRM_DEBUG("got here %p %p %d\n", obj, obj_priv->bo, atomic_read(&obj_priv->bo->usage)); - if (!(obj_priv->bo->type != drm_bo_type_kernel && !DRM_SUSER(DRM_CURPROC))) { + if (flags && !(obj_priv->bo->type != drm_bo_type_kernel && !DRM_SUSER(DRM_CURPROC))) { ret = drm_bo_do_validate(obj_priv->bo, flags, mask, DRM_BO_HINT_DONT_FENCE, 0); } else - ret = 0; + ret = 0; args->offset = obj_priv->bo->offset; DRM_DEBUG("got here %p %p %x\n", obj, obj_priv->bo, obj_priv->bo->offset); |