diff options
author | Eric Anholt <eric@anholt.net> | 2008-05-01 16:38:37 -0700 |
---|---|---|
committer | Eric Anholt <eric@anholt.net> | 2008-05-01 16:38:37 -0700 |
commit | 7d5f783eca3302ec7efa164e2980c75e5e591585 (patch) | |
tree | 63d49b55c4ecec1bc3b1423069afd78bc2c46710 | |
parent | c530011aaaf485157ba6284c0c32c0db83523b64 (diff) |
Make GEM object handles be nonzero.
-rw-r--r-- | linux-core/drm_gem.c | 3 | ||||
-rw-r--r-- | shared-core/drm.h | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/linux-core/drm_gem.c b/linux-core/drm_gem.c index 7326d6bb..f6038d5c 100644 --- a/linux-core/drm_gem.c +++ b/linux-core/drm_gem.c @@ -182,7 +182,8 @@ drm_gem_alloc_ioctl(struct drm_device *dev, void *data, return -EFAULT; } - ret = idr_get_new(&file_priv->object_idr, obj, &handle); + ret = idr_get_new_above(&file_priv->object_idr, obj, 1, + &handle); } while (ret == -EAGAIN); if (ret != 0) { diff --git a/shared-core/drm.h b/shared-core/drm.h index 6d62af6a..1f49cbb0 100644 --- a/shared-core/drm.h +++ b/shared-core/drm.h @@ -968,7 +968,11 @@ struct drm_gem_alloc { * The (page-aligned) allocated size for the object will be returned. */ uint32_t size; - /** Returned handle for the object. */ + /** + * Returned handle for the object. + * + * Object handles are nonzero. + */ uint32_t handle; }; |