Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 359336
b: refs/heads/master
c: c8c470a
h: refs/heads/master
v: v3
  • Loading branch information
Tejun Heo authored and Linus Torvalds committed Feb 28, 2013
1 parent fb38a63 commit a968e18
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8550cb2e3a3f4a5f2f6aa40b6c99691056f85b9d
refs/heads/master: c8c470afe316002d5d5259a134984ed03f40e249
21 changes: 5 additions & 16 deletions trunk/drivers/gpu/drm/i915/i915_gem_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ create_hw_context(struct drm_device *dev,
{
struct drm_i915_private *dev_priv = dev->dev_private;
struct i915_hw_context *ctx;
int ret, id;
int ret;

ctx = kzalloc(sizeof(*ctx), GFP_KERNEL);
if (ctx == NULL)
Expand All @@ -164,22 +164,11 @@ create_hw_context(struct drm_device *dev,

ctx->file_priv = file_priv;

again:
if (idr_pre_get(&file_priv->context_idr, GFP_KERNEL) == 0) {
ret = -ENOMEM;
DRM_DEBUG_DRIVER("idr allocation failed\n");
goto err_out;
}

ret = idr_get_new_above(&file_priv->context_idr, ctx,
DEFAULT_CONTEXT_ID + 1, &id);
if (ret == 0)
ctx->id = id;

if (ret == -EAGAIN)
goto again;
else if (ret)
ret = idr_alloc(&file_priv->context_idr, ctx, DEFAULT_CONTEXT_ID + 1, 0,
GFP_KERNEL);
if (ret < 0)
goto err_out;
ctx->id = ret;

return ctx;

Expand Down

0 comments on commit a968e18

Please sign in to comment.