Make GEM object handles be nonzero.
authorEric Anholt <eric@anholt.net>
Thu, 1 May 2008 23:38:37 +0000 (16:38 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 1 May 2008 23:38:37 +0000 (16:38 -0700)
linux-core/drm_gem.c
shared-core/drm.h

index 7326d6b..f6038d5 100644 (file)
@@ -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) {
index 6d62af6..1f49cbb 100644 (file)
@@ -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;
 };